Skip to content

ISMACrypt Support

Dimitri Podborski edited this page Sep 17, 2020 · 1 revision

ISMATransformSampleEntry

ISOErr ISMATransformSampleEntry( 
u32 newTrackFlags, 
MP4Handle insampleEntryH,
u8 selective_encryption, 
u8 key_indicator_length, 
u8 IV_length,
char* kms_URL,
MP4Handle outsampleEntryH );

ISMATransformSampleEntrySalt( 
u32 newTrackFlags, 
MP4Handle insampleEntryH,
u8 selective_encryption, 
u8 key_indicator_length, u8 IV_length,
char* kms_URL, 
u64 salt,
MP4Handle outsampleEntryH );

‘Transforms’ a sample entry into the format expected by ISMA for a sample entry for protected (encrypted) content. The flags are the same as for new tracks (audio or video track). The salt is an initial salt value which will be stored in the file if non-zero. The other parameters should be self-explanatory. (Note it is possible to build without ISMACrypt support using an ifdef).

ISMAUnTransformSampleEntry

ISOErr ISMAUnTransformSampleEntry( 
MP4Handle insampleEntryH,
u8* selective_encryption, 
u8* key_indicator_length, 
u8* IV_length,
char** kms_URL,
MP4Handle outsampleEntryH );

ISOErr ISMAUnTransformSampleEntrySalt( 
MP4Handle insampleEntryH,
u8* selective_encryption, 
u8* key_indicator_length, 
u8* IV_length,
char** kms_URL, 
u64* salt,
MP4Handle outsampleEntryH );

‘Untransforms’ a sample entry, from the encrypted form to the standard form, and returns the encryption parameter information previously supplied to the previous function, filling in salt if it was supplied in the file.