Bug 1310140. Part 10 - have SeekingState handle suspend-video-decoding. r=kaku,kamidphish

MozReview-Commit-ID: DRGfP3VN2OG

--HG--
extra : rebase_source : 6bca452d4612a1af4c929108dd9e21bf4d00465b
extra : source : a73b62cfa9b3dec2010c551a235affb7650603d4
This commit is contained in:
JW Wang 2016-10-18 11:11:38 +08:00
Родитель 7d1e644a36
Коммит d616baaf20
1 изменённых файлов: 14 добавлений и 3 удалений

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

@ -629,6 +629,15 @@ public:
{
mSeekJob = Move(aSeekJob);
// Always switch off the blank decoder otherwise we might become visible
// in the middle of seeking and won't have a valid video frame to show
// when seek is done.
if (mMaster->mVideoDecodeSuspended) {
mMaster->mVideoDecodeSuspended = false;
mMaster->mOnPlaybackEvent.Notify(MediaEventType::ExitVideoSuspend);
Reader()->SetVideoBlankDecode(false);
}
// SeekTask will register its callbacks to MediaDecoderReaderWrapper.
mMaster->CancelMediaDecoderReaderWrapperCallback();
@ -718,6 +727,11 @@ public:
RefPtr<MediaDecoder::SeekPromise> HandleSeek(SeekTarget aTarget) override;
void HandleVideoSuspendTimeout() override
{
// Do nothing since we want a valid video frame to show when seek is done.
}
private:
void OnSeekTaskResolved(const SeekTaskResolveValue& aValue)
{
@ -2328,9 +2342,6 @@ void MediaDecoderStateMachine::VisibilityChanged()
mVideoDecodeSuspendTimer.Reset();
if (mVideoDecodeSuspended) {
mVideoDecodeSuspended = false;
mOnPlaybackEvent.Notify(MediaEventType::ExitVideoSuspend);
mReader->SetVideoBlankDecode(false);
if (mIsReaderSuspended) {
return;