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:
JW Wang 2017-01-05 17:59:19 +08:00
Родитель dd6884450a
Коммит f4605f76d9
4 изменённых файлов: 3 добавлений и 24 удалений

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

@ -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)
{