Bug 1328831 - Remove MDSM::DispatchAudioOffloading.
MozReview-Commit-ID: JVJOpmUHNp6
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -2361,17 +2361,16 @@ MediaDecoderStateMachine::MediaDecoderSt
mAudioCaptured(false),
mMinimizePreroll(false),
mSentLoadedMetadataEvent(false),
mSentFirstFrameLoadedEvent(false),
mVideoDecodeSuspended(false),
mVideoDecodeSuspendTimer(mTaskQueue),
mOutputStreamManager(new OutputStreamManager()),
mResource(aDecoder->GetResource()),
- mAudioOffloading(false),
INIT_MIRROR(mBuffered, TimeIntervals()),
INIT_MIRROR(mEstimatedDuration, NullableTimeUnit()),
INIT_MIRROR(mExplicitDuration, Maybe<double>()),
INIT_MIRROR(mPlayState, MediaDecoder::PLAY_STATE_LOADING),
INIT_MIRROR(mNextPlayState, MediaDecoder::PLAY_STATE_PAUSED),
INIT_MIRROR(mVolume, 1.0),
INIT_MIRROR(mPreservesPitch, true),
INIT_MIRROR(mSameOriginMedia, false),
@@ -2702,21 +2701,18 @@ void MediaDecoderStateMachine::MaybeStar
MOZ_ASSERT(mState == DECODER_STATE_DECODING ||
mState == DECODER_STATE_COMPLETED);
if (IsPlaying()) {
// Logging this case is really spammy - don't do it.
return;
}
- bool playStatePermits = mPlayState == MediaDecoder::PLAY_STATE_PLAYING;
- if (!playStatePermits || mAudioOffloading) {
- DECODER_LOG("Not starting playback [playStatePermits: %d, "
- "mAudioOffloading: %d]",
- playStatePermits, mAudioOffloading);
+ if (mPlayState != MediaDecoder::PLAY_STATE_PLAYING) {
+ DECODER_LOG("Not starting playback [mPlayState=%d]", mPlayState.Ref());
return;
}
DECODER_LOG("MaybeStartPlayback() starting playback");
mOnPlaybackEvent.Notify(MediaEventType::PlaybackStarted);
StartMediaSink();
if (!IsPlaying()) {
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -203,28 +203,16 @@ public:
{
RefPtr<MediaDecoderStateMachine> self = this;
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([self, aEndTime] () {
self->mFragmentEndTime = aEndTime;
});
OwnerThread()->Dispatch(r.forget());
}
- void DispatchAudioOffloading(bool aAudioOffloading)
- {
- RefPtr<MediaDecoderStateMachine> self = this;
- nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
- if (self->mAudioOffloading != aAudioOffloading) {
- self->mAudioOffloading = aAudioOffloading;
- self->ScheduleStateMachine();
- }
- });
- OwnerThread()->Dispatch(r.forget());
- }
-
// Drop reference to mResource. Only called during shutdown dance.
void BreakCycles() {
MOZ_ASSERT(NS_IsMainThread());
mResource = nullptr;
}
TimedMetadataEventSource& TimedMetadataEvent() {
return mMetadataManager.TimedMetadataEvent();
@@ -725,20 +713,16 @@ private:
MediaEventProducerExc<nsAutoPtr<MediaInfo>,
MediaDecoderEventVisibility> mFirstFrameLoadedEvent;
MediaEventProducer<MediaEventType> mOnPlaybackEvent;
MediaEventProducer<MediaResult> mOnPlaybackErrorEvent;
MediaEventProducer<DecoderDoctorEvent> mOnDecoderDoctorEvent;
- // True if audio is offloading.
- // Playback will not start when audio is offloading.
- bool mAudioOffloading;
-
void OnCDMProxyReady(RefPtr<CDMProxy> aProxy);
void OnCDMProxyNotReady();
RefPtr<CDMProxy> mCDMProxy;
MozPromiseRequestHolder<MediaDecoder::CDMProxyPromise> mCDMProxyPromise;
private:
// The buffered range. Mirrored from the decoder thread.
Mirror<media::TimeIntervals> mBuffered;