summaryrefslogtreecommitdiffstats
path: root/include/media/stagefright/MetaData.h
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2012-04-12 13:05:44 -0700
committerAndreas Huber <andih@google.com>2012-04-12 13:15:48 -0700
commit5892e3e173f20e01956f318ae7dce43d46c5fc1d (patch)
treedafebc2a4cff31fe8788df3f70eba9192aff34c0 /include/media/stagefright/MetaData.h
parentb34364269683363ca54aeed4952937cf37da7e06 (diff)
downloadframeworks_av-5892e3e173f20e01956f318ae7dce43d46c5fc1d.zip
frameworks_av-5892e3e173f20e01956f318ae7dce43d46c5fc1d.tar.gz
frameworks_av-5892e3e173f20e01956f318ae7dce43d46c5fc1d.tar.bz2
Add metadata keys to communicate encrypted fragments and associated info.
Change-Id: I90a27c9bbe649328b88144b161c420916673846f related-to-bug: 6275919
Diffstat (limited to 'include/media/stagefright/MetaData.h')
-rw-r--r--include/media/stagefright/MetaData.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/media/stagefright/MetaData.h b/include/media/stagefright/MetaData.h
index 639446e..d0db98e 100644
--- a/include/media/stagefright/MetaData.h
+++ b/include/media/stagefright/MetaData.h
@@ -134,6 +134,28 @@ enum {
kKeyECM = 'ecm ', // raw data
kKeyIsADTS = 'adts', // bool (int32_t)
+
+ // If a MediaBuffer's data represents (at least partially) encrypted
+ // data, the following fields aid in decryption.
+ // The data can be thought of as pairs of plain and encrypted data
+ // fragments, i.e. plain and encrypted data alternate.
+ // The first fragment is by convention plain data (if that's not the
+ // case, simply specify plain fragment size of 0).
+ // kKeyEncryptedSizes and kKeyPlainSizes each map to an array of
+ // size_t values. The sum total of all size_t values of both arrays
+ // must equal the amount of data (i.e. MediaBuffer's range_length()).
+ // If both arrays are present, they must be of the same size.
+ // If only encrypted sizes are present it is assumed that all
+ // plain sizes are 0, i.e. all fragments are encrypted.
+ // To programmatically set these array, use the MetaData::setData API, i.e.
+ // const size_t encSizes[];
+ // meta->setData(
+ // kKeyEncryptedSizes, 0 /* type */, encSizes, sizeof(encSizes));
+ // A plain sizes array by itself makes no sense.
+ kKeyEncryptedSizes = 'encr', // size_t[]
+ kKeyPlainSizes = 'plai', // size_t[]
+ kKeyCryptoKey = 'cryK', // uint8_t[16]
+ kKeyCryptoIV = 'cryI', // uint8_t[16]
};
enum {