diff options
author | Robert Shih <robertshih@google.com> | 2014-02-06 14:25:25 -0800 |
---|---|---|
committer | Lajos Molnar <lajos@google.com> | 2014-03-06 16:26:49 -0800 |
commit | 2cd94583868b775a548233a4f7cd1d988fc6344f (patch) | |
tree | 3c61506c66f0f6f5140f4cda1dd4822922b052c8 /media/libstagefright/httplive/PlaylistFetcher.h | |
parent | 822a489e595336be447f47f5c2a051e8fdd1cdff (diff) | |
download | frameworks_av-2cd94583868b775a548233a4f7cd1d988fc6344f.tar.gz frameworks_av-2cd94583868b775a548233a4f7cd1d988fc6344f.tar.bz2 frameworks_av-2cd94583868b775a548233a4f7cd1d988fc6344f.zip |
PlaylistFetcher: Add support for block-by-block decryption.
Bug: 11854054
Change-Id: Ifd3f3369275889e716b360087b5b60d01635b578
Diffstat (limited to 'media/libstagefright/httplive/PlaylistFetcher.h')
-rw-r--r-- | media/libstagefright/httplive/PlaylistFetcher.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/media/libstagefright/httplive/PlaylistFetcher.h b/media/libstagefright/httplive/PlaylistFetcher.h index 78dea20bb1..ac04a77f59 100644 --- a/media/libstagefright/httplive/PlaylistFetcher.h +++ b/media/libstagefright/httplive/PlaylistFetcher.h @@ -119,8 +119,23 @@ private: uint64_t mFirstPTS; int64_t mAbsoluteTimeAnchorUs; + // Stores the initialization vector to decrypt the next block of cipher text, which can + // either be derived from the sequence number, read from the manifest, or copied from + // the last block of cipher text (cipher-block chaining). + unsigned char mAESInitVec[16]; + + // Set first to true if decrypting the first segment of a playlist segment. When + // first is true, reset the initialization vector based on the available + // information in the manifest; otherwise, use the initialization vector as + // updated by the last call to AES_cbc_encrypt. + // + // For the input to decrypt correctly, decryptBuffer must be called on + // consecutive byte ranges on block boundaries, e.g. 0..15, 16..47, 48..63, + // and so on. status_t decryptBuffer( - size_t playlistIndex, const sp<ABuffer> &buffer); + size_t playlistIndex, const sp<ABuffer> &buffer, + bool first = true); + status_t checkDecryptPadding(const sp<ABuffer> &buffer); void postMonitorQueue(int64_t delayUs = 0, int64_t minDelayUs = 0); void cancelMonitorQueue(); |