Go to the documentation of this file.
   29 static const uint8_t 
test_iv[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18};
 
   30 static const uint8_t 
test_key_id[] = {0x21, 0x22, 0x23, 0x24};
 
   36     if (!
a || !
b || 
a->scheme != 
b->scheme || 
a->crypt_byte_block != 
b->crypt_byte_block ||
 
   37         a->skip_byte_block != 
b->skip_byte_block || 
a->key_id_size != 
b->key_id_size ||
 
   38         a->iv_size != 
b->iv_size || 
a->subsample_count != 
b->subsample_count)
 
   41     if (memcmp(
a->key_id, 
b->key_id, 
a->key_id_size) != 0 ||
 
   42         memcmp(
a->iv, 
b->iv, 
a->iv_size) != 0 ||
 
   43         memcmp(
a->subsamples, 
b->subsamples, 
a->subsample_count * 
sizeof(
a->subsamples[0])))
 
   50     if (!
a || !
b || 
a->system_id_size != 
b->system_id_size ||
 
   51         a->num_key_ids != 
b->num_key_ids || 
a->key_id_size != 
b->key_id_size ||
 
   52         a->data_size != 
b->data_size)
 
   55     if (memcmp(
a->system_id, 
b->system_id, 
a->system_id_size) != 0 ||
 
   56         memcmp(
a->data, 
b->data, 
a->data_size) != 0)
 
   59     for (uint32_t 
i = 0; 
i < 
a->num_key_ids; 
i++) {
 
   60         if (memcmp(
a->key_ids[
i], 
b->key_ids[
i], 
a->key_id_size) != 0)
 
   64     if (
a->next || 
b->next) {
 
   65         if (!
a->next || !
b->next)
 
   78     size_t side_data_size;
 
   90     info->crypt_byte_block = 333;
 
   91     info->skip_byte_block = 444;
 
  145     size_t side_data_size;
 
  159     memset(
info->system_id, 0, 
info->system_id_size);
 
  172 int main(
int argc, 
char **argv)
 
  
AVEncryptionInfo * av_encryption_info_get_side_data(const uint8_t *buffer, size_t size)
Creates a copy of the AVEncryptionInfo that is contained in the given side data.
void av_encryption_init_info_free(AVEncryptionInitInfo *info)
Frees the given encryption init info object.
static int compare_encryption_init_info(const AVEncryptionInitInfo *a, const AVEncryptionInitInfo *b)
static const AVSubsampleEncryptionInfo test_subsamples[]
AVEncryptionInitInfo * av_encryption_init_info_get_side_data(const uint8_t *side_data, size_t side_data_size)
Creates a copy of the AVEncryptionInitInfo that is contained in the given side data.
static void run_encryption_info_test(void)
static const uint8_t test_data[]
static const uint8_t test_key_id[]
static const uint8_t test_key_id_2[]
AVEncryptionInfo * av_encryption_info_clone(const AVEncryptionInfo *info)
Allocates an AVEncryptionInfo structure with a copy of the given data.
static void run_encryption_init_info_test(void)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
This describes info used to initialize an encryption key system.
static const uint8_t test_system_id[]
uint8_t * av_encryption_info_add_side_data(const AVEncryptionInfo *info, size_t *size)
Allocates and initializes side data that holds a copy of the given encryption info.
static const size_t test_subsample_count
static void copy(const float *p1, float *p2, const int length)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
void av_encryption_info_free(AVEncryptionInfo *info)
Frees the given encryption info object.
This file is part of FFmpeg.
AVEncryptionInitInfo * av_encryption_init_info_alloc(uint32_t system_id_size, uint32_t num_key_ids, uint32_t key_id_size, uint32_t data_size)
Allocates an AVEncryptionInitInfo structure and sub-pointers to hold the given sizes.
#define i(width, name, range_min, range_max)
This describes encryption info for a packet.
static AVEncryptionInitInfo * create_init_info(void)
static int compare_encryption_info(const AVEncryptionInfo *a, const AVEncryptionInfo *b)
static const uint8_t test_iv[]
AVEncryptionInfo * av_encryption_info_alloc(uint32_t subsample_count, uint32_t key_id_size, uint32_t iv_size)
Allocates an AVEncryptionInfo structure and sub-pointers to hold the given number of subsamples.
int main(int argc, char **argv)
uint8_t * av_encryption_init_info_add_side_data(const AVEncryptionInitInfo *info, size_t *side_data_size)
Allocates and initializes side data that holds a copy of the given encryption init info.