28 static const uint8_t test_iv[] = {0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18};
77 size_t side_data_size;
91 memcpy(info->
key_id, test_key_id,
sizeof(test_key_id));
92 memcpy(info->
iv, test_iv,
sizeof(test_iv));
93 memcpy(info->
subsamples, test_subsamples,
sizeof(test_subsamples));
132 memcpy(info->
system_id, test_system_id,
sizeof(test_system_id));
133 memcpy(info->
key_ids[0], test_key_id,
sizeof(test_key_id));
134 memcpy(info->
key_ids[1], test_key_id_2,
sizeof(test_key_id_2));
135 memcpy(info->
data, test_data,
sizeof(test_data));
144 size_t side_data_size;
171 int main(
int argc,
char **argv)
static int compare_encryption_info(const AVEncryptionInfo *a, const AVEncryptionInfo *b)
static void copy(const float *p1, float *p2, const int length)
void av_encryption_info_free(AVEncryptionInfo *info)
Frees the given encryption info object.
static const uint8_t test_key_id_2[]
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.
void av_encryption_init_info_free(AVEncryptionInitInfo *info)
Frees the given encryption init info object.
uint32_t crypt_byte_block
Only used for pattern encryption.
This describes encryption info for a packet.
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...
uint32_t skip_byte_block
Only used for pattern encryption.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
uint8_t ** key_ids
An array of key IDs this initialization data is for.
AVEncryptionInfo * av_encryption_info_clone(const AVEncryptionInfo *info)
Allocates an AVEncryptionInfo structure with a copy of the given data.
uint32_t scheme
The fourcc encryption scheme, in big-endian byte order.
This file is part of FFmpeg.
This describes info used to initialize an encryption key system.
uint8_t * iv
The initialization vector.
static const AVSubsampleEncryptionInfo test_subsamples[]
static const uint8_t test_data[]
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.
AVSubsampleEncryptionInfo * subsamples
An array of subsample encryption info specifying how parts of the sample are encrypted.
static const size_t test_subsample_count
static void run_encryption_init_info_test(void)
static const uint8_t test_iv[]
static const uint8_t test_key_id[]
uint32_t num_key_ids
The number of key IDs.
simple assert() macros that are a bit more flexible than ISO C assert().
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.
struct AVEncryptionInitInfo * next
An optional pointer to the next initialization info in the list.
static AVEncryptionInitInfo * create_init_info(void)
static void run_encryption_info_test(void)
static const uint8_t test_system_id[]
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.
uint32_t key_id_size
The number of bytes in each key ID.
uint8_t * key_id
The ID of the key used to encrypt the packet.
uint8_t * data
Key-system specific initialization data.
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...
static int compare_encryption_init_info(const AVEncryptionInitInfo *a, const AVEncryptionInitInfo *b)
uint8_t * system_id
A unique identifier for the key system this is for, can be NULL if it is not known.