зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1352319. P4 - move AudioPrerollUsecs/VideoPrerollFrames into DecodingState. r=kaku
MozReview-Commit-ID: 3VuDj1TXZV2 --HG-- extra : rebase_source : 53471b886ee48e845e31b70e9e13d82b0620a6a7 extra : source : 383119c9b722b892d300cb56b92116af3285b60a
This commit is contained in:
Родитель
428f953b53
Коммит
747b792884
|
@ -837,18 +837,34 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
// At the start of decoding we want to "preroll" the decode until we've
|
||||
// got a few frames decoded before we consider whether decode is falling
|
||||
// behind. Otherwise our "we're falling behind" logic will trigger
|
||||
// unnecessarily if we start playing as soon as the first sample is
|
||||
// decoded. These two fields store how many video frames and audio
|
||||
// samples we must consume before are considered to be finished prerolling.
|
||||
uint32_t AudioPrerollUsecs() const
|
||||
{
|
||||
return mMaster->mAmpleAudioThreshold.ToMicroseconds() / 2;
|
||||
}
|
||||
|
||||
uint32_t VideoPrerollFrames() const
|
||||
{
|
||||
return mMaster->GetAmpleVideoFrames() / 2;
|
||||
}
|
||||
|
||||
bool DonePrerollingAudio()
|
||||
{
|
||||
return !mMaster->IsAudioDecoding()
|
||||
|| mMaster->GetDecodedAudioDuration()
|
||||
>= mMaster->AudioPrerollUsecs() * mMaster->mPlaybackRate;
|
||||
>= AudioPrerollUsecs() * mMaster->mPlaybackRate;
|
||||
}
|
||||
|
||||
bool DonePrerollingVideo()
|
||||
{
|
||||
return !mMaster->IsVideoDecoding()
|
||||
|| static_cast<uint32_t>(mMaster->VideoQueue().GetSize())
|
||||
>= mMaster->VideoPrerollFrames() * mMaster->mPlaybackRate + 1;
|
||||
>= VideoPrerollFrames() * mMaster->mPlaybackRate + 1;
|
||||
}
|
||||
|
||||
void MaybeStopPrerolling()
|
||||
|
|
|
@ -593,24 +593,6 @@ private:
|
|||
// we detect that the decode can't keep up with rendering.
|
||||
media::TimeUnit mAmpleAudioThreshold;
|
||||
|
||||
// At the start of decoding we want to "preroll" the decode until we've
|
||||
// got a few frames decoded before we consider whether decode is falling
|
||||
// behind. Otherwise our "we're falling behind" logic will trigger
|
||||
// unnecessarily if we start playing as soon as the first sample is
|
||||
// decoded. These two fields store how many video frames and audio
|
||||
// samples we must consume before are considered to be finished prerolling.
|
||||
uint32_t AudioPrerollUsecs() const
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return mAmpleAudioThreshold.ToMicroseconds() / 2;
|
||||
}
|
||||
|
||||
uint32_t VideoPrerollFrames() const
|
||||
{
|
||||
MOZ_ASSERT(OnTaskQueue());
|
||||
return GetAmpleVideoFrames() / 2;
|
||||
}
|
||||
|
||||
// Only one of a given pair of ({Audio,Video}DataPromise, WaitForDataPromise)
|
||||
// should exist at any given moment.
|
||||
using AudioDataPromise = MediaDecoderReader::AudioDataPromise;
|
||||
|
|
Загрузка…
Ссылка в новой задаче