Bug 1185892. Part 3 - replace all calls to MediaDecoder::IsExpectingMoreData() with MediaResource::IsExpectingMoreData. r=jya.

This commit is contained in:
JW Wang 2015-07-22 20:58:00 +08:00
Родитель cc8b7e3ce1
Коммит e025bd63c4
5 изменённых файлов: 2 добавлений и 23 удалений

Просмотреть файл

@ -655,13 +655,6 @@ void MediaDecoder::QueueMetadata(int64_t aPublishTime,
mDecoderStateMachine->QueueMetadata(aPublishTime, aInfo, aTags);
}
bool
MediaDecoder::IsExpectingMoreData()
{
ReentrantMonitorAutoEnter mon(GetReentrantMonitor());
return !mResource || mResource->IsExpectingMoreData();
}
void MediaDecoder::MetadataLoaded(nsAutoPtr<MediaInfo> aInfo,
nsAutoPtr<MetadataTags> aTags,
MediaDecoderEventVisibility aEventVisibility)

Просмотреть файл

@ -622,13 +622,6 @@ public:
// the track list. Call on the main thread only.
virtual void RemoveMediaTracks() override;
// Returns true if the this decoder is expecting any more data to arrive
// sometime in the not-too-distant future, either from the network or from
// an appendBuffer call on a MediaSource element.
//
// Acquires the monitor. Call from any thread.
virtual bool IsExpectingMoreData();
// Called when the video has completed playing.
// Call on the main thread only.
void PlaybackEnded();

Просмотреть файл

@ -2367,7 +2367,7 @@ nsresult MediaDecoderStateMachine::RunStateMachine()
elapsed < TimeDuration::FromSeconds(mBufferingWait * mPlaybackRate) &&
(mQuickBuffering ? HasLowDecodedData(mQuickBufferingLowDataThresholdUsecs)
: HasLowUndecodedData(mBufferingWait * USECS_PER_S)) &&
mDecoder->IsExpectingMoreData())
mResource->IsExpectingMoreData())
{
DECODER_LOG("Buffering: wait %ds, timeout in %.3lfs %s",
mBufferingWait, mBufferingWait - elapsed.ToSeconds(),
@ -2727,7 +2727,7 @@ void MediaDecoderStateMachine::UpdateRenderedVideoFrames()
// If we don't, switch to buffering mode.
if (mState == DECODER_STATE_DECODING &&
mPlayState == MediaDecoder::PLAY_STATE_PLAYING &&
mDecoder->IsExpectingMoreData()) {
mResource->IsExpectingMoreData()) {
bool shouldBuffer;
if (mReader->UseBufferingHeuristics()) {
shouldBuffer = HasLowDecodedData(remainingTime + EXHAUSTED_DATA_MARGIN_USECS) &&

Просмотреть файл

@ -215,12 +215,6 @@ MediaSourceDecoder::Ended(bool aEnded)
mon.NotifyAll();
}
bool
MediaSourceDecoder::IsExpectingMoreData()
{
return GetResource()->IsExpectingMoreData();
}
void
MediaSourceDecoder::SetInitialDuration(int64_t aDuration)
{

Просмотреть файл

@ -65,7 +65,6 @@ public:
void OnTrackBufferConfigured(TrackBuffer* aTrackBuffer, const MediaInfo& aInfo);
void Ended(bool aEnded);
bool IsExpectingMoreData() override;
// Return the duration of the video in seconds.
virtual double GetDuration() override;