Bug 1283718. Part 4 - rename some function. r=kaku
MozReview-Commit-ID: CGOiy8SBjMR
--- a/dom/media/NextFrameSeekTask.cpp
+++ b/dom/media/NextFrameSeekTask.cpp
@@ -239,17 +239,17 @@ NextFrameSeekTask::IsVideoSeekComplete()
{
AssertOwnerThread();
// Don't finish seek until there are no pending requests. Otherwise, we might
// lose video samples for the promise is resolved asynchronously.
return !IsVideoRequestPending() && !NeedMoreVideo();
}
void
-NextFrameSeekTask::CheckIfSeekComplete()
+NextFrameSeekTask::MaybeFinishSeek()
{
AssertOwnerThread();
const bool audioSeekComplete = IsAudioSeekComplete();
const bool videoSeekComplete = IsVideoSeekComplete();
if (!videoSeekComplete) {
// We haven't reached the target. Ensure we have requested another sample.
@@ -278,32 +278,32 @@ NextFrameSeekTask::OnAudioDecoded(MediaD
SAMPLE_LOG("OnAudioDecoded [%lld,%lld] disc=%d",
aAudioSample->mTime,
aAudioSample->GetEndTime(),
aAudioSample->mDiscontinuity);
// We accept any audio data here.
mSeekedAudioData = aAudioSample;
- CheckIfSeekComplete();
+ MaybeFinishSeek();
}
void
NextFrameSeekTask::OnAudioNotDecoded(MediaDecoderReader::NotDecodedReason aReason)
{
AssertOwnerThread();
MOZ_ASSERT(!mSeekTaskPromise.IsEmpty(), "Seek shouldn't be finished");
SAMPLE_LOG("OnAudioNotDecoded (aReason=%u)", aReason);
// We don't really handle audio deocde error here. Let MDSM to trigger further
// audio decoding tasks if it needs to play audio, and MDSM will then receive
// the decoding state from MediaDecoderReader.
- CheckIfSeekComplete();
+ MaybeFinishSeek();
}
void
NextFrameSeekTask::OnVideoDecoded(MediaData* aVideoSample)
{
AssertOwnerThread();
MOZ_ASSERT(aVideoSample);
MOZ_ASSERT(!mSeekTaskPromise.IsEmpty(), "Seek shouldn't be finished");
@@ -315,17 +315,17 @@ NextFrameSeekTask::OnVideoDecoded(MediaD
aVideoSample->mTime,
aVideoSample->GetEndTime(),
aVideoSample->mDiscontinuity);
if (aVideoSample->mTime > mCurrentTimeBeforeSeek) {
mSeekedVideoData = aVideoSample;
}
- CheckIfSeekComplete();
+ MaybeFinishSeek();
}
void
NextFrameSeekTask::OnVideoNotDecoded(MediaDecoderReader::NotDecodedReason aReason)
{
AssertOwnerThread();
MOZ_ASSERT(!mSeekTaskPromise.IsEmpty(), "Seek shouldn't be finished");
@@ -333,17 +333,17 @@ NextFrameSeekTask::OnVideoNotDecoded(Med
if (aReason == MediaDecoderReader::DECODE_ERROR) {
if (mVideoQueue.GetSize() > 0) {
// The video decoding request might be filed by MDSM not the
// NextFrameSeekTask itself. So, the NextFrameSeekTask might has already
// found its target in the VideoQueue but still waits the video decoding
// request (which is filed by the MDSM) to be resolved. In this case, we
// already have the target of this seek task, try to resolve this task.
- CheckIfSeekComplete();
+ MaybeFinishSeek();
return;
}
// Otherwise, we cannot get the target video frame of this seek task,
// delegate the decode error to the generic error path.
RejectIfExist(__func__);
return;
}
@@ -357,17 +357,17 @@ NextFrameSeekTask::OnVideoNotDecoded(Med
if (aReason == MediaDecoderReader::CANCELED) {
EnsureVideoDecodeTaskQueued();
return;
}
if (aReason == MediaDecoderReader::END_OF_STREAM) {
mIsVideoQueueFinished = true;
- CheckIfSeekComplete();
+ MaybeFinishSeek();
}
}
void
NextFrameSeekTask::SetCallbacks()
{
AssertOwnerThread();
@@ -391,17 +391,17 @@ NextFrameSeekTask::SetCallbacks()
OnVideoNotDecoded(aData.as<MediaDecoderReader::NotDecodedReason>());
}
});
mAudioWaitCallback = mReader->AudioWaitCallback().Connect(
OwnerThread(), [this] (WaitCallbackData aData) {
// We don't make an audio decode request here, instead, let MDSM to
// trigger further audio decode tasks if MDSM itself needs to play audio.
- CheckIfSeekComplete();
+ MaybeFinishSeek();
});
mVideoWaitCallback = mReader->VideoWaitCallback().Connect(
OwnerThread(), [this] (WaitCallbackData aData) {
if (aData.is<MediaData::Type>()) {
EnsureVideoDecodeTaskQueued();
}
});
--- a/dom/media/NextFrameSeekTask.h
+++ b/dom/media/NextFrameSeekTask.h
@@ -54,17 +54,17 @@ private:
bool NeedMoreVideo() const;
bool IsVideoRequestPending() const;
bool IsAudioSeekComplete() const;
bool IsVideoSeekComplete() const;
- void CheckIfSeekComplete();
+ void MaybeFinishSeek();
void OnAudioDecoded(MediaData* aAudioSample);
void OnAudioNotDecoded(MediaDecoderReader::NotDecodedReason aReason);
void OnVideoDecoded(MediaData* aVideoSample);
void OnVideoNotDecoded(MediaDecoderReader::NotDecodedReason aReason);