Revert Widevine 6.0.0 -> 4.5.0 libraries

Includes Widevine libraries Version 4.5.0.7809

Also fixed samplePlayer's MediaCodec mode not running and
WVDrmInfoRequestStatusKey returning incorrect value.

Change-Id: Ibcc6d313790670a908ada93be80d6bf55a67b4ed
related-to-bug: 6929628
related-to-bug: 6833718
related-to-bug: 6889322
This commit is contained in:
Edwin Wong
2012-07-23 17:40:57 -07:00
parent 735ec731f2
commit e9f5431e78
33 changed files with 360 additions and 1082 deletions

View File

@@ -21,7 +21,6 @@
#define AES_BLOCK_SIZE 16
using namespace android;
static sp<DecryptHandle> sDecryptHandle;
@@ -33,6 +32,7 @@ static void _cb1(char *data, unsigned long size)
if (sDrmManagerClient != NULL) {
sDrmManagerClient->initializeDecryptUnit(sDecryptHandle, 0, &buf);
}
}
static int _cb2(char *in, char *out, int length, char *iv)
@@ -141,6 +141,10 @@ void WVMExtractorImpl::Initialize()
//ALOGD("WVMExtractorImpl::Initialize setting DecryptCallback\n");
callbacks.decrypt = WVMMediaSource::DecryptCallback;
}
#else
if (!mIsLiveStream && mClientContext->getCryptoPluginMode()) {
callbacks.decrypt = WVMMediaSource::DecryptCallback;
}
#endif
result = WV_Initialize(&callbacks);
@@ -351,8 +355,6 @@ status_t WVMExtractorImpl::readMetaData()
mClientContext->setVideoSource(mVideoSource);
mVideoSource->delegateClientContext(mClientContext);
mFileMetaData->setCString(kKeyMIMEType, "video/wvm");
mHaveMetaData = true;
mInfoListener->configureHeartbeat();
@@ -361,6 +363,26 @@ status_t WVMExtractorImpl::readMetaData()
// In crypto plugin mode, need to trigger the drm plugin to begin
// license use on playback since the media player isn't involved.
sDrmManagerClient->setPlaybackStatus(sDecryptHandle, Playback::START, 0);
#ifndef REQUIRE_SECURE_BUFFERS
if (!mIsLiveStream) {
// Get the content key for crypto plugin mode on L3 devices
char keyBuffer[AES_BLOCK_SIZE];
char nullBuffer[0];
DrmBuffer nullDrmBuffer(nullBuffer, 0);
DrmBuffer keyDrmBuffer(keyBuffer, sizeof(keyBuffer));
DrmBuffer *keyDrmBufferPtr = &keyDrmBuffer;
status_t status = sDrmManagerClient->decrypt(sDecryptHandle, 0, &nullDrmBuffer,
&keyDrmBufferPtr, &nullDrmBuffer);
if (status != OK) {
return status;
}
mVideoSource->SetCryptoPluginKey(keyBuffer);
mAudioSource->SetCryptoPluginKey(keyBuffer);
}
#endif
}
return OK;
@@ -375,7 +397,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
int limit = 500;
do {
size_t bytesRead;
bool auEnd, sync;
bool auStart, sync;
unsigned long long dts, pts;
unsigned char buf[1];
size_t bufSize = 0;
@@ -385,7 +407,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
// pull some audio data. But we can't use it yet, so just request 0 bytes.
//
(void)WV_GetEsData(mSession, WV_EsSelector_Audio, buf, bufSize,
bytesRead, dts, pts, sync, auEnd);
bytesRead, auStart, dts, pts, sync);
result = WV_Info_GetCodecConfig(mSession, WV_CodecConfigType_ESDS, config, size);
if (result != WV_Status_OK)
@@ -467,11 +489,7 @@ sp<MetaData> WVMExtractorImpl::getTrackMetaData(size_t index, uint32_t flags)
}
sp<MetaData> WVMExtractorImpl::getMetaData() {
status_t err;
if ((err = readMetaData()) != OK) {
return new MetaData;
}
mFileMetaData->setCString(kKeyMIMEType, "video/wvm");
return mFileMetaData;
}