Bug 1294320 - Remove MediaDecoderStateMachine::IsVideoDecodeSuspended()
MozReview-Commit-ID: 9iTzmMhw686
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -466,20 +466,16 @@ bool MediaDecoderStateMachine::HaveEnoug
// at which the DecodedStream is playing.
return true;
}
bool MediaDecoderStateMachine::HaveEnoughDecodedVideo()
{
MOZ_ASSERT(OnTaskQueue());
- if (IsVideoDecodeSuspended()) {
- return true;
- }
-
if (VideoQueue().GetSize() == 0) {
return false;
}
if (VideoQueue().GetSize() - 1 < GetAmpleVideoFrames() * mPlaybackRate) {
return false;
}
@@ -1799,23 +1795,16 @@ MediaDecoderStateMachine::EnsureVideoDec
SAMPLE_LOG("EnsureVideoDecodeTaskQueued isDecoding=%d status=%s",
IsVideoDecoding(), VideoRequestStatus());
if (mState != DECODER_STATE_DECODING &&
mState != DECODER_STATE_BUFFERING) {
return NS_OK;
}
- if (IsVideoDecodeSuspended() && !IsDecodingFirstFrame()) {
- // The element is invisible and background videos should be suspended.
- // If the first frame has already been decoded, don't request anymore video
- // frames.
- return NS_OK;
- }
-
if (!IsVideoDecoding() || mReader->IsRequestingVideoData() ||
mReader->IsWaitingVideoData()) {
return NS_OK;
}
RequestVideoData();
return NS_OK;
}
@@ -2631,22 +2620,16 @@ bool MediaDecoderStateMachine::OnTaskQue
}
bool MediaDecoderStateMachine::IsStateMachineScheduled() const
{
MOZ_ASSERT(OnTaskQueue());
return mDispatchedStateMachine || mDelayedScheduler.IsScheduled();
}
-bool MediaDecoderStateMachine::IsVideoDecodeSuspended() const
-{
- MOZ_ASSERT(OnTaskQueue());
- return mIsReaderSuspended;
-}
-
void
MediaDecoderStateMachine::LogicalPlaybackRateChanged()
{
MOZ_ASSERT(OnTaskQueue());
if (mLogicalPlaybackRate == 0) {
// This case is handled in MediaDecoder by pausing playback.
return;
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -591,20 +591,16 @@ protected:
bool IsStateMachineScheduled() const;
// Returns true if we're not playing and the decode thread has filled its
// decode buffers and is waiting. We can shut the decode thread down in this
// case as it may not be needed again.
bool IsPausedAndDecoderWaiting();
- // Returns true if the video decoding is suspended because the element is not
- // visible
- bool IsVideoDecodeSuspended() const;
-
// These return true if the respective stream's decode has not yet reached
// the end of stream.
bool IsAudioDecoding();
bool IsVideoDecoding();
private:
// Resolved by the MediaSink to signal that all audio/video outstanding
// work is complete and identify which part(a/v) of the sink is shutting down.