Bug 1056537 - Bustage fix: move DecodeToFirstVideoData back to MediaDecoderReader for now. r=UNDISCLOSED TREETOPS

This commit is contained in:
Matthew Gregan 2014-08-22 15:11:58 +12:00
parent 3d56b3a65a
commit 96ee646326
4 changed files with 23 additions and 21 deletions

View File

@ -105,6 +105,26 @@ nsresult MediaDecoderReader::ResetDecode()
return res;
}
VideoData* MediaDecoderReader::DecodeToFirstVideoData()
{
bool eof = false;
while (!eof && VideoQueue().GetSize() == 0) {
{
ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
if (mDecoder->IsShutdown()) {
return nullptr;
}
}
bool keyframeSkip = false;
eof = !DecodeVideoFrame(keyframeSkip, 0);
}
if (eof) {
VideoQueue().Finish();
}
VideoData* d = nullptr;
return (d = VideoQueue().PeekFront()) ? d : nullptr;
}
nsresult
MediaDecoderReader::GetBuffered(mozilla::dom::TimeRanges* aBuffered,
int64_t aStartTime)

View File

@ -163,6 +163,9 @@ public:
return mDecoder;
}
// TODO: DEPRECATED. This uses synchronous decoding.
VideoData* DecodeToFirstVideoData();
MediaInfo GetMediaInfo() { return mInfo; }
// Indicates if the media is seekable.

View File

@ -1894,26 +1894,6 @@ VideoData* OggReader::FindStartTime(int64_t& aOutStartTime)
return videoData;
}
VideoData* OggReader::DecodeToFirstVideoData()
{
bool eof = false;
while (!eof && VideoQueue().GetSize() == 0) {
{
ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
if (mDecoder->IsShutdown()) {
return nullptr;
}
}
bool keyframeSkip = false;
eof = !DecodeVideoFrame(keyframeSkip, 0);
}
if (eof) {
VideoQueue().Finish();
}
VideoData* d = nullptr;
return (d = VideoQueue().PeekFront()) ? d : nullptr;
}
AudioData* OggReader::DecodeToFirstAudioData()
{
bool eof = false;

View File

@ -90,7 +90,6 @@ private:
// frame, if we have video.
VideoData* FindStartTime(int64_t& aOutStartTime);
AudioData* DecodeToFirstAudioData();
VideoData* DecodeToFirstVideoData();
// This monitor should be taken when reading or writing to mIsChained.
ReentrantMonitor mMonitor;