Skip to main content
Version: 14 Oct 2024

MLMediaCodecCryptoInfo

Module: Media Player

Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. If pattern encryption applies, each of the encrypted runs is encrypted only partly, according to a repeating pattern of "encrypt" and "skip" blocks. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files". More...

#include <ml_media_codec.h>

Public Attributes

TypeName
uint32_tversion
size_tnumber_of_subsamples
MLMediaCodecCryptoModecrypto_mode
MLMediaCodecCryptoPatterncrypto_pattern
const uint8_t *key
const uint8_t *iv
const size_t *bytes_of_clear_data
const size_t *bytes_of_encrypted_data

Detailed Description

struct MLMediaCodecCryptoInfo;

Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. If pattern encryption applies, each of the encrypted runs is encrypted only partly, according to a repeating pattern of "encrypt" and "skip" blocks. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files".

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 20

Public Attributes Documentation

version

uint32_t version;

Version of this structure.


number_of_subsamples

size_t number_of_subsamples;

The number of subsamples that make up the buffer's contents.


crypto_mode

MLMediaCodecCryptoMode crypto_mode;

Cipher Mode associated with the encrypted blocks.


crypto_pattern

MLMediaCodecCryptoPattern crypto_pattern;
TypeDescription
MLMediaCodecCryptoPatternMetadata describing an encryption pattern for the protected bytes in a subsample.

Encryption pattern used by the subsample.


key

const uint8_t * key;

16 bytes of Key used for the encrypted blocks.


iv

const uint8_t * iv;

16 bytes of Initialization vector used for the encrypted blocks.


bytes_of_clear_data

const size_t * bytes_of_clear_data;

An array of size "number_of_subsamples", that contains the number of leading (potentially none, which is 0) unencrypted bytes in each subsample.


bytes_of_encrypted_data

const size_t * bytes_of_encrypted_data;

An array of size "number_of_subsamples", that contains the number of trailing (potentially none, which is 0) encrypted bytes in each subsample.