Widevine extractor changes to support secure media buffer playback.

Supports either secure or insecure buffer configurations, depending
on the build-time flag REQUIRE_SECURE_BUFFERS.

Change-Id: I5b8150315eced4ed9be656b73d91485a6216819d
This commit is contained in:
Jeff Tinker
2011-06-30 15:47:43 -07:00
parent fee0126ed8
commit ba335957e9
4 changed files with 33 additions and 51 deletions

View File

@@ -260,10 +260,6 @@ status_t WVMExtractorImpl::readMetaData()
status_t status;
status = readAVCCMetaData(videoMetaData);
if (status != OK)
return status;
status = readESDSMetaData(audioMetaData);
if (status != OK)
return status;
@@ -294,52 +290,6 @@ status_t WVMExtractorImpl::readMetaData()
return OK;
}
status_t WVMExtractorImpl::readAVCCMetaData(sp<MetaData> videoMetaData)
{
WVStatus result;
const unsigned char *config;
unsigned long size;
int limit = 500;
do {
size_t bytesRead;
bool auStart, sync;
unsigned long long dts, pts;
unsigned char buf[1];
size_t bufSize = 0;
//
// In order to get the codec config data, we need to have the WVMK
// pull some video data. But we can't use it yet, so just request 0 bytes.
//
(void)WV_GetEsData(mSession, WV_EsSelector_Video, buf, bufSize,
bytesRead, auStart, dts, pts, sync);
result = WV_Info_GetCodecConfig(mSession, WV_CodecConfigType_AVCC, config, size);
if (result != WV_Status_OK)
usleep(10000);
} while (result == WV_Status_Warning_Not_Available && limit-- > 0);
if (result != WV_Status_OK) {
LOGE("WV_Info_GetCodecConfig AVCC returned error %d\n", result);
return ERROR_IO;
}
#if 0
char *filename = "/data/wvm/avcc";
FILE *f = fopen(filename, "w");
if (!f)
LOGD("Failed to open %s", filename);
else {
fwrite(config, size, 1, f);
fclose(f);
}
#endif
videoMetaData->setData(kKeyAVCC, kTypeAVCC, config, size);
return OK;
}
status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
{
WVStatus result;