Bug 1310140. Part 7 - add BufferingState::HandleVideoSuspendTimeout(). draft
authorJW Wang <jwwang@mozilla.com>
Tue, 18 Oct 2016 10:52:24 +0800
changeset 426832 039d8c0cee73099a57f14b8f0a9f7e4ed4fcbc75
parent 426831 9ef8b894bafcb683c8cd9b8acc5bed000cd6efdf
child 426833 c6a84757250fb35faae6e5766ba907ed412ac6d3
push id32814
push userjwwang@mozilla.com
push dateWed, 19 Oct 2016 06:32:41 +0000
bugs1310140
milestone52.0a1
Bug 1310140. Part 7 - add BufferingState::HandleVideoSuspendTimeout(). MozReview-Commit-ID: IAhR9v3svpT
dom/media/MediaDecoderStateMachine.cpp
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -814,16 +814,23 @@ public:
     mMaster->ScheduleStateMachine();
     return true;
   }
 
   bool HandleEndOfStream() override;
 
   RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override;
 
+  void HandleVideoSuspendTimeout() override
+  {
+    mMaster->mVideoDecodeSuspended = true;
+    mMaster->mOnPlaybackEvent.Notify(MediaEventType::EnterVideoSuspend);
+    Reader()->SetVideoBlankDecode(true);
+  }
+
 private:
   TimeStamp mBufferingStart;
 
   // The maximum number of second we spend buffering when we are short on
   // unbuffered data.
   const uint32_t mBufferingWait = 15;
 };