am 66d9ff5f: Fix for 4198445 HC - Support for Widevine Live Streaming (adaptive)

* commit '66d9ff5fb5f99ba77e02a4719e4c65aec2aa8c4a':
  Fix for 4198445 HC - Support for Widevine Live Streaming (adaptive)
This commit is contained in:
Jeffrey Tinker
2011-06-02 13:58:08 -07:00
committed by Android Git Automerger
7 changed files with 43 additions and 11 deletions

View File

@@ -249,6 +249,15 @@ status_t WVMExtractorImpl::readMetaData()
videoMetaData->setInt32(kKeyWidth, width);
videoMetaData->setInt32(kKeyHeight, height);
if (mIsLiveStream) {
float scaleUsed;
result = WV_Play(mSession, 1.0, &scaleUsed, "npt=now-");
if (result != WV_Status_OK) {
LOGE("WV_Play for live stream setup failed: %d", result);
return ERROR_IO;
}
}
status_t status;
status = readAVCCMetaData(videoMetaData);
@@ -259,8 +268,15 @@ status_t WVMExtractorImpl::readMetaData()
if (status != OK)
return status;
mAudioSource = new WVMMediaSource(mSession, WV_EsSelector_Audio, audioMetaData);
mVideoSource = new WVMMediaSource(mSession, WV_EsSelector_Video, videoMetaData);
if (mIsLiveStream) {
result = WV_Pause(mSession, "");
if (result != WV_Status_OK) {
LOGE("WV_Pause for live stream setup failed: %d", result);
}
}
mAudioSource = new WVMMediaSource(mSession, WV_EsSelector_Audio, audioMetaData, mIsLiveStream);
mVideoSource = new WVMMediaSource(mSession, WV_EsSelector_Video, videoMetaData, mIsLiveStream);
// Since the WVExtractor goes away soon after this, we delegate ownership of some resources
// to the constructed media source
@@ -284,7 +300,7 @@ status_t WVMExtractorImpl::readAVCCMetaData(sp<MetaData> videoMetaData)
const unsigned char *config;
unsigned long size;
int limit = 50;
int limit = 500;
do {
size_t bytesRead;
bool auStart, sync;
@@ -301,7 +317,7 @@ status_t WVMExtractorImpl::readAVCCMetaData(sp<MetaData> videoMetaData)
result = WV_Info_GetCodecConfig(mSession, WV_CodecConfigType_AVCC, config, size);
if (result != WV_Status_OK)
usleep(100);
usleep(10000);
} while (result == WV_Status_Warning_Not_Available && limit-- > 0);
if (result != WV_Status_OK) {
@@ -330,7 +346,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
const unsigned char *config;
unsigned long size;
int limit = 50;
int limit = 500;
do {
size_t bytesRead;
bool auStart, sync;
@@ -347,7 +363,7 @@ status_t WVMExtractorImpl::readESDSMetaData(sp<MetaData> audioMetaData)
result = WV_Info_GetCodecConfig(mSession, WV_CodecConfigType_ESDS, config, size);
if (result != WV_Status_OK)
usleep(100);
usleep(10000);
} while (result == WV_Status_Warning_Not_Available && limit-- > 0);
if (result != WV_Status_OK) {