Bug 1371188 P2 - remove MediaDecoderReader::RequestVideoData()'s aSkipToNextKeyframe parameter; r=jya

It is not used.

MozReview-Commit-ID: EDPhN6RzKN0

--HG--
extra : rebase_source : ab743da08760cd4014504528581d935ea9aa6752
extra : source : 3a7f3b90239b4bdf96c25e5df2f0c49a6c326c42
This commit is contained in:
Kaku Kuo 2017-06-12 16:06:11 +08:00
Родитель 2b13f6092f
Коммит 458f8fcb6e
8 изменённых файлов: 26 добавлений и 41 удалений

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

@ -255,7 +255,7 @@ public:
// Make sure ResetDecode hasn't been called in the mean time.
if (!mReader->mBaseVideoPromise.IsEmpty()) {
mReader->RequestVideoData(/* aSkip = */ true, mTimeThreshold);
mReader->RequestVideoData(mTimeThreshold);
}
return NS_OK;
@ -291,11 +291,10 @@ private:
};
RefPtr<MediaDecoderReader::VideoDataPromise>
MediaDecoderReader::RequestVideoData(bool aSkipToNextKeyframe,
const media::TimeUnit& aTimeThreshold)
MediaDecoderReader::RequestVideoData(const media::TimeUnit& aTimeThreshold)
{
RefPtr<VideoDataPromise> p = mBaseVideoPromise.Ensure(__func__);
bool skip = aSkipToNextKeyframe;
bool skip = false;
while (VideoQueue().GetSize() == 0 &&
!VideoQueue().IsFinished()) {
if (!DecodeVideoFrame(skip, aTimeThreshold)) {

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

@ -141,12 +141,8 @@ public:
virtual RefPtr<AudioDataPromise> RequestAudioData();
// Requests one video sample from the reader.
//
// If aSkipToKeyframe is true, the decode should skip ahead to the
// the next keyframe at or after aTimeThreshold.
virtual RefPtr<VideoDataPromise>
RequestVideoData(bool aSkipToNextKeyframe,
const media::TimeUnit& aTimeThreshold);
RequestVideoData(const media::TimeUnit& aTimeThreshold);
// By default, the state machine polls the reader once per second when it's
// in buffering mode. Some readers support a promise-based mechanism by which

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

@ -62,8 +62,7 @@ MediaDecoderReaderWrapper::RequestAudioData()
}
RefPtr<MediaDecoderReaderWrapper::VideoDataPromise>
MediaDecoderReaderWrapper::RequestVideoData(bool aSkipToNextKeyframe,
media::TimeUnit aTimeThreshold)
MediaDecoderReaderWrapper::RequestVideoData(media::TimeUnit aTimeThreshold)
{
MOZ_ASSERT(mOwnerThread->IsCurrentThreadIn());
MOZ_ASSERT(!mShutdown);
@ -75,8 +74,7 @@ MediaDecoderReaderWrapper::RequestVideoData(bool aSkipToNextKeyframe,
int64_t startTime = StartTime().ToMicroseconds();
return InvokeAsync(
mReader->OwnerThread(), mReader.get(), __func__,
&MediaDecoderReader::RequestVideoData,
aSkipToNextKeyframe, aTimeThreshold)
&MediaDecoderReader::RequestVideoData, aTimeThreshold)
->Then(mOwnerThread, __func__,
[startTime] (RefPtr<VideoData> aVideo) {
aVideo->AdjustForStartTime(startTime);

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

@ -42,7 +42,7 @@ public:
RefPtr<AudioDataPromise> RequestAudioData();
RefPtr<VideoDataPromise>
RequestVideoData(bool aSkipToNextKeyframe, media::TimeUnit aTimeThreshold);
RequestVideoData(media::TimeUnit aTimeThreshold);
RefPtr<WaitForDataPromise> WaitForData(MediaData::Type aType);

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

@ -603,7 +603,7 @@ public:
void HandleVideoCanceled() override
{
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
void HandleEndOfVideo() override
@ -619,7 +619,7 @@ public:
void HandleVideoWaited(MediaData::Type aType) override
{
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
void HandleVideoSuspendTimeout() override
@ -737,8 +737,7 @@ public:
void HandleVideoCanceled() override
{
mMaster->RequestVideoData(
NeedToSkipToNextKeyframe(), mMaster->GetMediaTime());
mMaster->RequestVideoData(mMaster->GetMediaTime());
}
void HandleEndOfAudio() override;
@ -763,8 +762,7 @@ public:
void HandleVideoWaited(MediaData::Type aType) override
{
mMaster->RequestVideoData(
NeedToSkipToNextKeyframe(), mMaster->GetMediaTime());
mMaster->RequestVideoData(mMaster->GetMediaTime());
}
void HandleAudioCaptured() override
@ -1332,7 +1330,7 @@ private:
void RequestVideoData()
{
MOZ_ASSERT(!mDoneVideoSeeking);
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
void AdjustFastSeekIfNeeded(MediaData* aSample)
@ -1686,7 +1684,7 @@ private:
void RequestVideoData()
{
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
bool NeedMoreVideo() const
@ -1845,7 +1843,7 @@ public:
void HandleVideoCanceled() override
{
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
void HandleWaitingForAudio() override
@ -1865,7 +1863,7 @@ public:
void HandleVideoWaited(MediaData::Type aType) override
{
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
void HandleEndOfAudio() override;
@ -2263,7 +2261,7 @@ DecodingFirstFrameState::Enter()
mMaster->RequestAudioData();
}
if (mMaster->HasVideo()) {
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
}
@ -2398,8 +2396,7 @@ DecodingState::EnsureVideoDecodeTaskQueued()
|| mMaster->IsWaitingVideoData()) {
return;
}
mMaster->RequestVideoData(
NeedToSkipToNextKeyframe(), mMaster->GetMediaTime());
mMaster->RequestVideoData(mMaster->GetMediaTime());
}
bool
@ -2563,7 +2560,7 @@ BufferingState::DispatchDecodeTasksIfNeeded()
&& !mMaster->HaveEnoughDecodedVideo()
&& !mMaster->IsRequestingVideoData()
&& !mMaster->IsWaitingVideoData()) {
mMaster->RequestVideoData(false, media::TimeUnit());
mMaster->RequestVideoData(media::TimeUnit());
}
}
@ -3305,21 +3302,20 @@ MediaDecoderStateMachine::RequestAudioData()
}
void
MediaDecoderStateMachine::RequestVideoData(bool aSkipToNextKeyframe,
const media::TimeUnit& aCurrentTime)
MediaDecoderStateMachine::RequestVideoData(const media::TimeUnit& aCurrentTime)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(IsVideoDecoding());
MOZ_ASSERT(!IsRequestingVideoData());
MOZ_ASSERT(!IsWaitingVideoData());
LOGV("Queueing video task - queued=%" PRIuSIZE ", decoder-queued=%" PRIoSIZE
", skip=%i, time=%" PRId64,
", stime=%" PRId64,
VideoQueue().GetSize(), mReader->SizeOfVideoQueueInFrames(),
aSkipToNextKeyframe, aCurrentTime.ToMicroseconds());
aCurrentTime.ToMicroseconds());
TimeStamp videoDecodeStartTime = TimeStamp::Now();
RefPtr<MediaDecoderStateMachine> self = this;
mReader->RequestVideoData(aSkipToNextKeyframe, aCurrentTime)->Then(
mReader->RequestVideoData(aCurrentTime)->Then(
OwnerThread(), __func__,
[this, self, videoDecodeStartTime] (RefPtr<VideoData> aVideo) {
MOZ_ASSERT(aVideo);

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

@ -427,8 +427,7 @@ protected:
void RequestAudioData();
// Start a task to decode video.
void RequestVideoData(bool aSkipToNextKeyframe,
const media::TimeUnit& aCurrentTime);
void RequestVideoData(const media::TimeUnit& aCurrentTime);
void WaitForData(MediaData::Type aType);

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

@ -1557,8 +1557,7 @@ MediaFormatReader::ShouldSkip(TimeUnit aTimeThreshold)
}
RefPtr<MediaDecoderReader::VideoDataPromise>
MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
const TimeUnit& aTimeThreshold)
MediaFormatReader::RequestVideoData(const TimeUnit& aTimeThreshold)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty(),
@ -1567,8 +1566,7 @@ MediaFormatReader::RequestVideoData(bool aSkipToNextKeyframe,
MOZ_DIAGNOSTIC_ASSERT(!mVideo.mSeekRequest.Exists()
|| mVideo.mTimeThreshold.isSome());
MOZ_DIAGNOSTIC_ASSERT(!IsSeeking(), "called mid-seek");
LOGV("RequestVideoData(%d, %" PRId64 ")",
aSkipToNextKeyframe, aTimeThreshold.ToMicroseconds());
LOGV("RequestVideoData(%" PRId64 ")", aTimeThreshold.ToMicroseconds());
if (!HasVideo()) {
LOG("called with no video track");

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

@ -39,8 +39,7 @@ public:
size_t SizeOfAudioQueueInFrames() override;
RefPtr<VideoDataPromise>
RequestVideoData(bool aSkipToNextKeyframe,
const media::TimeUnit& aTimeThreshold) override;
RequestVideoData(const media::TimeUnit& aTimeThreshold) override;
RefPtr<AudioDataPromise> RequestAudioData() override;