HLS, CBC, and Pattern for Android Glue Layer

[This is a merge of http://go/wvgerrit/16522 ]

This commit adds support for CBC and Pattern Mode to the MediaCrypto
implementation. These are the only changes needed to support HLS. (No
change is needed for MediaDrm, as it already passes HLS initialization
data along to the core without closely inspecting it, as it should.)

Following this change, the glue layer also supports the CENC, CBC1,
CENS, and CBCS modes from the forthcoming update to the ISO-CENC spec.

Note that, in order to differentiate CBC1 and CBCS, we have to cue on
the presence or absence of a pattern, which may not continue to be
sufficient in the future if a third CBC mode using patterns is ever
added.

Note that the unit tests for this code remain disabled for now. New
unit tests are forthcoming in a separate commit.

Bug: 25666017
Change-Id: I5942a8b70393e63b4de9d7dab985c4c2a98a20b3
This commit is contained in:
John "Juce" Bruce
2016-01-21 18:44:21 -08:00
parent 280a9e47a0
commit a61e0e01b1
2 changed files with 117 additions and 13 deletions

View File

@@ -45,6 +45,9 @@ class WVCryptoPlugin : public android::CryptoPlugin {
wvcdm::CdmSessionId mSessionId;
wvcdm::CdmSessionId configureTestMode(const void* data, size_t size);
static wvcdm::CdmResponseType countEncryptedBlocksInPatternedRange(
size_t range, size_t startingOffset, const Pattern& pattern,
size_t startingPatternOffset, uint64_t* result);
static void incrementIV(uint64_t increaseBy, std::vector<uint8_t>* ivPtr);
};