Bug 1237482 - Remove MediaDecoderStateMachine::mStreamSink. r=kikuo.
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -332,19 +332,16 @@ MediaDecoderStateMachine::~MediaDecoderS
#endif
}
void
MediaDecoderStateMachine::InitializationTask(MediaDecoder* aDecoder)
{
MOZ_ASSERT(OnTaskQueue());
- mStreamSink = new DecodedStream(mTaskQueue, mAudioQueue, mVideoQueue,
- mOutputStreamManager, mSameOriginMedia.Ref());
-
// Connect mirrors.
mBuffered.Connect(mReader->CanonicalBuffered());
mEstimatedDuration.Connect(aDecoder->CanonicalEstimatedDuration());
mExplicitDuration.Connect(aDecoder->CanonicalExplicitDuration());
mPlayState.Connect(aDecoder->CanonicalPlayState());
mNextPlayState.Connect(aDecoder->CanonicalNextPlayState());
mLogicallySeeking.Connect(aDecoder->CanonicalLogicallySeeking());
mVolume.Connect(aDecoder->CanonicalVolume());
@@ -384,21 +381,20 @@ MediaDecoderStateMachine::CreateAudioSin
self->mInfo.mAudio, self->mAudioChannel);
};
return new AudioSinkWrapper(mTaskQueue, audioSinkCreator);
}
already_AddRefed<media::MediaSink>
MediaDecoderStateMachine::CreateMediaSink(bool aAudioCaptured)
{
- // TODO: We can't really create a new DecodedStream until OutputStreamManager
- // is extracted. It is tricky that the implementation of DecodedStream
- // happens to allow reuse after shutdown without creating a new one.
- RefPtr<media::MediaSink> audioSink = aAudioCaptured ?
- mStreamSink : CreateAudioSink();
+ RefPtr<media::MediaSink> audioSink = aAudioCaptured
+ ? new DecodedStream(mTaskQueue, mAudioQueue, mVideoQueue,
+ mOutputStreamManager, mSameOriginMedia.Ref())
+ : CreateAudioSink();
RefPtr<media::MediaSink> mediaSink =
new VideoSink(mTaskQueue, audioSink, mVideoQueue,
mVideoFrameContainer, *mFrameStats,
sVideoQueueSendToCompositorSize);
return mediaSink.forget();
}
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -1182,23 +1182,16 @@ private:
// operation soon.
Watchable<bool> mSentFirstFrameLoadedEvent;
bool mSentPlaybackEndedEvent;
// Data about MediaStreams that are being fed by the decoder.
const RefPtr<OutputStreamManager> mOutputStreamManager;
- // The SourceMediaStream we are using to feed the mOutputStreams. This stream
- // is never exposed outside the decoder.
- // Only written on the main thread while holding the monitor. Therefore it
- // can be read on any thread while holding the monitor, or on the main thread
- // without holding the monitor.
- RefPtr<DecodedStream> mStreamSink;
-
// Media data resource from the decoder.
RefPtr<MediaResource> mResource;
// Track the complete & error for audio/video separately
MozPromiseRequestHolder<GenericPromise> mMediaSinkAudioPromise;
MozPromiseRequestHolder<GenericPromise> mMediaSinkVideoPromise;
MediaEventListener mAudioQueueListener;