Bug 1234424. Part 1 - share the underlying value of MDSM::mSameOriginMedia with DecodedStream. r=roc.

This commit is contained in:
JW Wang 2016-01-05 21:15:37 +08:00
parent 135725019e
commit b60a4316a7
3 changed files with 9 additions and 6 deletions

View File

@ -241,8 +241,6 @@ MediaDecoderStateMachine::MediaDecoderStateMachine(MediaDecoder* aDecoder,
mSentFirstFrameLoadedEvent(false, "MediaDecoderStateMachine::mSentFirstFrameLoadedEvent"),
mSentPlaybackEndedEvent(false),
mOutputStreamManager(new OutputStreamManager()),
mStreamSink(new DecodedStream(
mTaskQueue, mAudioQueue, mVideoQueue, mOutputStreamManager)),
mResource(aDecoder->GetResource()),
mAudioOffloading(false),
mBuffered(mTaskQueue, TimeIntervals(),
@ -339,6 +337,9 @@ 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());

View File

@ -188,11 +188,12 @@ DecodedStreamData::SetPlaying(bool aPlaying)
DecodedStream::DecodedStream(AbstractThread* aOwnerThread,
MediaQueue<MediaData>& aAudioQueue,
MediaQueue<MediaData>& aVideoQueue,
OutputStreamManager* aOutputStreamManager)
OutputStreamManager* aOutputStreamManager,
const bool& aSameOrigin)
: mOwnerThread(aOwnerThread)
, mOutputStreamManager(aOutputStreamManager)
, mPlaying(false)
, mSameOrigin(false)
, mSameOrigin(aSameOrigin)
, mAudioQueue(aAudioQueue)
, mVideoQueue(aVideoQueue)
{

View File

@ -35,7 +35,8 @@ public:
DecodedStream(AbstractThread* aOwnerThread,
MediaQueue<MediaData>& aAudioQueue,
MediaQueue<MediaData>& aVideoQueue,
OutputStreamManager* aOutputStreamManager);
OutputStreamManager* aOutputStreamManager,
const bool& aSameOrigin);
// MediaSink functions.
const PlaybackParams& GetPlaybackParams() const override;
@ -98,7 +99,7 @@ private:
RefPtr<GenericPromise> mFinishPromise;
bool mPlaying;
bool mSameOrigin;
const bool& mSameOrigin; // valid until Shutdown() is called.
PlaybackParams mParams;
Maybe<int64_t> mStartTime;