Reduce Duplication in CryptoPlugin

(This is a merge of go/wvgerrit/22898)

This change moves some code - that was nearly identical between the
clear subsample and encrypted subsample paths - into a common helper
method.

Bug: 31381719
Test: libwvdrmmediacrypto_test
Change-Id: I64d3e03b3953cddd1cc0d370ba66fc634dfb1dd8
This commit is contained in:
John W. Bruce
2017-01-17 16:11:46 -08:00
parent d30c5f8d33
commit afae7d93d5
2 changed files with 58 additions and 73 deletions

View File

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