зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1328836 - Remove MDSM::DispatchMinimizePrerollUntilPlaybackStarts. r=kaku
MozReview-Commit-ID: 1EGHVhZqUTA --HG-- extra : rebase_source : c90c245683c50364d869566540f47927e0f64d04 extra : intermediate-source : ceb0660e9f35a0dbbd361a4dc4eb6bcef8add385 extra : source : e1dfbdac70feedc99a950c00aeda683e38919247
This commit is contained in:
Родитель
dd6884450a
Коммит
f4605f76d9
|
@ -633,9 +633,6 @@ void
|
|||
MediaDecoder::SetStateMachineParameters()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mMinimizePreroll) {
|
||||
mDecoderStateMachine->DispatchMinimizePrerollUntilPlaybackStarts();
|
||||
}
|
||||
if (mPlaybackRate != 1 && mPlaybackRate != 0) {
|
||||
mDecoderStateMachine->DispatchSetPlaybackRate(mPlaybackRate);
|
||||
}
|
||||
|
|
|
@ -192,6 +192,8 @@ public:
|
|||
// not be played. Note that seeking also doesn't cause us start prerolling.
|
||||
void SetMinimizePrerollUntilPlaybackStarts();
|
||||
|
||||
bool GetMinimizePreroll() const { return mMinimizePreroll; }
|
||||
|
||||
// All MediaStream-related data is protected by mReentrantMonitor.
|
||||
// We have at most one DecodedStreamData per MediaDecoder. Its stream
|
||||
// is used as the input for each ProcessedMediaStream created by calls to
|
||||
|
|
|
@ -2359,7 +2359,7 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
|
|||
mLowAudioThresholdUsecs(detail::LOW_AUDIO_USECS),
|
||||
mAmpleAudioThresholdUsecs(detail::AMPLE_AUDIO_USECS),
|
||||
mAudioCaptured(false),
|
||||
mMinimizePreroll(false),
|
||||
mMinimizePreroll(aDecoder->GetMinimizePreroll()),
|
||||
mSentLoadedMetadataEvent(false),
|
||||
mSentFirstFrameLoadedEvent(false),
|
||||
mVideoDecodeSuspended(false),
|
||||
|
|
|
@ -178,26 +178,6 @@ public:
|
|||
|
||||
RefPtr<ShutdownPromise> BeginShutdown();
|
||||
|
||||
// Notifies the state machine that should minimize the number of samples
|
||||
// decoded we preroll, until playback starts. The first time playback starts
|
||||
// the state machine is free to return to prerolling normally. Note
|
||||
// "prerolling" in this context refers to when we decode and buffer decoded
|
||||
// samples in advance of when they're needed for playback.
|
||||
void DispatchMinimizePrerollUntilPlaybackStarts()
|
||||
{
|
||||
RefPtr<MediaDecoderStateMachine> self = this;
|
||||
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([self] () -> void
|
||||
{
|
||||
MOZ_ASSERT(self->OnTaskQueue());
|
||||
self->mMinimizePreroll = true;
|
||||
|
||||
// Make sure that this arrives before playback starts, otherwise this won't
|
||||
// have the intended effect.
|
||||
MOZ_DIAGNOSTIC_ASSERT(self->mPlayState == MediaDecoder::PLAY_STATE_LOADING);
|
||||
});
|
||||
OwnerThread()->Dispatch(r.forget());
|
||||
}
|
||||
|
||||
// Set the media fragment end time. aEndTime is in microseconds.
|
||||
void DispatchSetFragmentEndTime(int64_t aEndTime)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче