Add support for crypto HAL on L3 devices DO NOT MERGE

Includes widevine library release version 4.5.0.7571

Change-Id: I9e574d5606576aab376d0524a4bf1a81e5a61678
related-to-bug: 6427322
related-to-bug: 6427274
This commit is contained in:
Jeff Tinker
2012-06-09 14:59:20 -07:00
parent e6513d5c7c
commit b07508ef01
13 changed files with 183 additions and 53 deletions

View File

@@ -47,7 +47,8 @@ public:
int64_t getTime() { return mKeyTime; }; // usec.
#ifdef REQUIRE_SECURE_BUFFERS
static const int kCryptoBlockSize = 16;
class DecryptContext {
public:
void Initialize(MediaBuffer *mediaBuf) {
@@ -57,16 +58,19 @@ public:
}
MediaBuffer *mMediaBuf;
size_t mOffset;
static const int kCryptoBlockSize = 16;
unsigned char mIV[kCryptoBlockSize];
};
static void DecryptCallback(WVEsSelector esType, void* input, void* output, size_t length,
int key, void *context);
DecryptContext& getDecryptContext() { return mDecryptContext; }
void SetCryptoPluginKey(const char key[kCryptoBlockSize]) {
memcpy(mCryptoPluginKey, key, sizeof(mCryptoPluginKey));
}
private:
DecryptContext mDecryptContext;
#endif
protected:
virtual ~WVMMediaSource();
@@ -85,6 +89,7 @@ private:
bool mNewSegment;
bool mCryptoInitialized;
bool mIsStalled;
bool mStripADTS;
MediaBufferGroup *mGroup;
@@ -97,6 +102,7 @@ private:
sp<ClientContext> mClientContext;
Vector<size_t> mEncryptedSizes;
char mCryptoPluginKey[kCryptoBlockSize];
void allocBufferGroup();