Upgrade of Widevine libraries from 4.5.0 to 6.0.0
Upload for Dave Parsons 6.0.0 Widevine libraries contain the features required to support multiple audio tracks and subtitles. This is establishing the baseline for those features. Change-Id: If12074bb2e4364c8107339e2f69453c40698e91f related-to-bug: 5880566
This commit is contained in:
@@ -132,14 +132,19 @@ void WVMExtractorImpl::Initialize()
|
||||
|
||||
#ifdef REQUIRE_SECURE_BUFFERS
|
||||
if (!mIsLiveStream) {
|
||||
WVCallbacks callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, WVMMediaSource::DecryptCallback, SocketInfoCallback};
|
||||
//ALOGD("WVMExtractorImpl::Initialize setting DecryptCallback\n");
|
||||
WVCallbacks callbacks;
|
||||
callbacks.decrypt = WVMMediaSource::DecryptCallback;
|
||||
callbacks.socketInfo = SocketInfoCallback;
|
||||
result = WV_Initialize(&callbacks);
|
||||
} else {
|
||||
WVCallbacks callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, SocketInfoCallback};
|
||||
WVCallbacks callbacks;
|
||||
callbacks.socketInfo = SocketInfoCallback;
|
||||
result = WV_Initialize(&callbacks);
|
||||
}
|
||||
#else
|
||||
WVCallbacks callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, SocketInfoCallback};
|
||||
WVCallbacks callbacks;
|
||||
callbacks.socketInfo = SocketInfoCallback;
|
||||
result = WV_Initialize(&callbacks);
|
||||
#endif
|
||||
|
||||
@@ -352,7 +357,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
|
||||
int limit = 500;
|
||||
do {
|
||||
size_t bytesRead;
|
||||
bool auStart, sync;
|
||||
bool auEnd, sync;
|
||||
unsigned long long dts, pts;
|
||||
unsigned char buf[1];
|
||||
size_t bufSize = 0;
|
||||
@@ -362,7 +367,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, auStart, dts, pts, sync);
|
||||
bytesRead, dts, pts, sync, auEnd);
|
||||
|
||||
result = WV_Info_GetCodecConfig(mSession, WV_CodecConfigType_ESDS, config, size);
|
||||
if (result != WV_Status_OK)
|
||||
|
||||
@@ -243,7 +243,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
#endif
|
||||
|
||||
size_t bytesRead;
|
||||
bool auStart;
|
||||
bool auEnd;
|
||||
size_t offset = 0;
|
||||
int64_t keyTime;
|
||||
|
||||
@@ -259,7 +259,7 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
size_t size = mediaBuf->size() - offset;
|
||||
|
||||
WVStatus result = WV_GetEsData(mSession, mESSelector, (uint8_t *)mediaBuf->data() + offset,
|
||||
size, bytesRead, auStart, mDts, mPts, syncFrame);
|
||||
size, bytesRead, mDts, mPts, syncFrame, auEnd);
|
||||
|
||||
if (result != WV_Status_OK &&
|
||||
result != WV_Status_Warning_Need_Key &&
|
||||
@@ -397,14 +397,15 @@ status_t WVMMediaSource::read(MediaBuffer **buffer, const ReadOptions *options)
|
||||
|
||||
WVMMediaSource::DecryptContext WVMMediaSource::sDecryptContext[2] = {};
|
||||
|
||||
void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* output,
|
||||
size_t length, int key)
|
||||
WVStatus WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* output, size_t length,
|
||||
int key, unsigned long long dts, unsigned long long pts, bool au_end)
|
||||
{
|
||||
//ALOGD("DecryptCallback(type=%d, in=%p, out=%p, len=%d, key=%d\n",
|
||||
// (int)esType, input, output, length, key);
|
||||
DecryptContext &context = sDecryptContext[esType];
|
||||
OEMCrypto_UINT32 copied = length;
|
||||
OEMCryptoResult result;
|
||||
WVStatus status;
|
||||
unsigned char *iv = NULL;
|
||||
|
||||
if (key)
|
||||
@@ -420,11 +421,17 @@ void WVMMediaSource::DecryptCallback(WVEsSelector esType, void* input, void* out
|
||||
&copied);
|
||||
}
|
||||
|
||||
if (result != OEMCrypto_SUCCESS) {
|
||||
if (result == OEMCrypto_SUCCESS) {
|
||||
status = WV_Status_OK;
|
||||
}
|
||||
else {
|
||||
status = WV_Status_Unknown;
|
||||
ALOGD("OEMCrypto decrypt failure: %d", result);
|
||||
}
|
||||
|
||||
context.mOffset += copied;
|
||||
|
||||
return status;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -53,8 +53,9 @@ public:
|
||||
static const int kCryptoBlockSize = 16;
|
||||
unsigned char mIV[kCryptoBlockSize];
|
||||
};
|
||||
static void DecryptCallback(WVEsSelector esType, void* input, void* output,
|
||||
size_t length, int key);
|
||||
static WVStatus DecryptCallback(WVEsSelector esType, void* input, void* output, size_t length,
|
||||
int key, unsigned long long dts, unsigned long long pts, bool au_end);
|
||||
|
||||
static DecryptContext sDecryptContext[2]; // audio vs. video
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user