From 2a6206aecc984a572b65f842ff021f35cb3b94f2 Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 5 Jul 2016 17:00:28 +0800 Subject: [PATCH] Bug 1282658. Part 17 - rename and remove some functions. r=kaku MozReview-Commit-ID: 1v8WOlz2671 --HG-- extra : rebase_source : 1c80cc7afc0e6e5fec16904d7ca2b6d5b32a6666 --- dom/media/AccurateSeekTask.cpp | 48 +++++++--------------------------- dom/media/AccurateSeekTask.h | 8 ++---- 2 files changed, 12 insertions(+), 44 deletions(-) diff --git a/dom/media/AccurateSeekTask.cpp b/dom/media/AccurateSeekTask.cpp index f6e3b536cf76..94a3f471feae 100644 --- a/dom/media/AccurateSeekTask.cpp +++ b/dom/media/AccurateSeekTask.cpp @@ -104,7 +104,7 @@ AccurateSeekTask::Seek(const media::TimeUnit& aDuration) } void -AccurateSeekTask::EnsureAudioDecodeTaskQueued() +AccurateSeekTask::RequestAudioData() { AssertOwnerThread(); MOZ_ASSERT(!mDoneAudioSeeking); @@ -114,7 +114,7 @@ AccurateSeekTask::EnsureAudioDecodeTaskQueued() } void -AccurateSeekTask::EnsureVideoDecodeTaskQueued() +AccurateSeekTask::RequestVideoData() { AssertOwnerThread(); MOZ_ASSERT(!mDoneVideoSeeking); @@ -123,34 +123,6 @@ AccurateSeekTask::EnsureVideoDecodeTaskQueued() mReader->RequestVideoData(false, media::TimeUnit()); } -const char* -AccurateSeekTask::AudioRequestStatus() -{ - AssertOwnerThread(); - - if (mReader->IsRequestingAudioData()) { - MOZ_DIAGNOSTIC_ASSERT(!mReader->IsWaitingAudioData()); - return "pending"; - } else if (mReader->IsWaitingAudioData()) { - return "waiting"; - } - return "idle"; -} - -const char* -AccurateSeekTask::VideoRequestStatus() -{ - AssertOwnerThread(); - - if (mReader->IsRequestingVideoData()) { - MOZ_DIAGNOSTIC_ASSERT(!mReader->IsWaitingVideoData()); - return "pending"; - } else if (mReader->IsWaitingVideoData()) { - return "waiting"; - } - return "idle"; -} - nsresult AccurateSeekTask::DropAudioUpToSeekTarget(MediaData* aSample) { @@ -288,10 +260,10 @@ AccurateSeekTask::OnSeekResolved(media::TimeUnit) // We must decode the first samples of active streams, so we can determine // the new stream time. So dispatch tasks to do that. if (!mDoneVideoSeeking) { - EnsureVideoDecodeTaskQueued(); + RequestVideoData(); } if (!mDoneAudioSeeking) { - EnsureAudioDecodeTaskQueued(); + RequestAudioData(); } } @@ -354,7 +326,7 @@ AccurateSeekTask::OnAudioDecoded(MediaData* aAudioSample) } if (!mDoneAudioSeeking) { - EnsureAudioDecodeTaskQueued(); + RequestAudioData(); return; } MaybeFinishSeek(); @@ -384,9 +356,9 @@ AccurateSeekTask::OnNotDecoded(MediaData::Type aType, if (aReason == MediaDecoderReader::CANCELED) { if (aType == MediaData::AUDIO_DATA) { - EnsureAudioDecodeTaskQueued(); + RequestAudioData(); } else { - EnsureVideoDecodeTaskQueued(); + RequestVideoData(); } return; } @@ -440,7 +412,7 @@ AccurateSeekTask::OnVideoDecoded(MediaData* aVideoSample) } if (!mDoneVideoSeeking) { - EnsureVideoDecodeTaskQueued(); + RequestVideoData(); return; } MaybeFinishSeek(); @@ -475,14 +447,14 @@ AccurateSeekTask::SetCallbacks() mAudioWaitCallback = mReader->AudioWaitCallback().Connect( OwnerThread(), [this] (WaitCallbackData aData) { if (aData.is()) { - EnsureAudioDecodeTaskQueued(); + RequestAudioData(); } }); mVideoWaitCallback = mReader->VideoWaitCallback().Connect( OwnerThread(), [this] (WaitCallbackData aData) { if (aData.is()) { - EnsureVideoDecodeTaskQueued(); + RequestVideoData(); } }); } diff --git a/dom/media/AccurateSeekTask.h b/dom/media/AccurateSeekTask.h index be2ab258c49f..261fb3ddd7e0 100644 --- a/dom/media/AccurateSeekTask.h +++ b/dom/media/AccurateSeekTask.h @@ -33,13 +33,9 @@ public: private: ~AccurateSeekTask(); - void EnsureVideoDecodeTaskQueued(); + void RequestVideoData(); - void EnsureAudioDecodeTaskQueued(); - - const char* AudioRequestStatus(); - - const char* VideoRequestStatus(); + void RequestAudioData(); nsresult DropAudioUpToSeekTarget(MediaData* aSample);