Bug 1393399 P3 - keep the MediaDecoderOwner's identification in MFR; r=gerald

When GPU process crashes, the MediaDecoder, MDSM, and MFR are all destroyed.
So, we use MediaDecoderOwner to identify which video we're dealing with.

MozReview-Commit-ID: 1cv08M7Cpcf

--HG--
extra : rebase_source : 62f7be874d97a58eb4c1d7a98b4e9fe83a9313d3
This commit is contained in:
Kaku Kuo 2017-08-31 17:31:51 +08:00
parent 15e39cee1b
commit e738871d59
5 changed files with 11 additions and 0 deletions

View File

@ -201,6 +201,7 @@ MediaDecoderStateMachine* ChannelMediaDecoder::CreateStateMachine()
init.mCrashHelper = GetOwner()->CreateGMPCrashHelper();
init.mFrameStats = mFrameStats;
init.mResource = mResource;
init.mMediaDecoderOwnerID = mOwner;
mReader = DecoderTraits::CreateReader(ContainerType(), init);
return new MediaDecoderStateMachine(this, mReader);
}

View File

@ -1114,6 +1114,7 @@ MediaFormatReader::MediaFormatReader(MediaFormatReaderInit& aInit,
TimeIntervals(),
"MediaFormatReader::mBuffered (Canonical)")
, mFrameStats(aInit.mFrameStats)
, mMediaDecoderOwnerID(aInit.mMediaDecoderOwnerID)
{
MOZ_ASSERT(aDemuxer);
MOZ_COUNT_CTOR(MediaFormatReader);

View File

@ -73,6 +73,8 @@ struct MetadataHolder
UniquePtr<MetadataTags> mTags;
};
typedef void* MediaDecoderOwnerID;
struct MOZ_STACK_CLASS MediaFormatReaderInit
{
MediaResource* mResource = nullptr;
@ -80,6 +82,8 @@ struct MOZ_STACK_CLASS MediaFormatReaderInit
FrameStatistics* mFrameStats = nullptr;
already_AddRefed<layers::KnowsCompositor> mKnowsCompositor;
already_AddRefed<GMPCrashHelper> mCrashHelper;
// Used in bug 1393399 for temporary telemetry.
MediaDecoderOwnerID mMediaDecoderOwnerID = nullptr;
};
class MediaFormatReader final
@ -762,6 +766,9 @@ private:
MediaEventProducer<MediaResult> mOnDecodeWarning;
RefPtr<FrameStatistics> mFrameStats;
// Used in bug 1393399 for telemetry.
const MediaDecoderOwnerID mMediaDecoderOwnerID;
};
} // namespace mozilla

View File

@ -93,6 +93,7 @@ HLSDecoder::CreateStateMachine()
init.mKnowsCompositor = GetCompositor();
init.mCrashHelper = GetOwner()->CreateGMPCrashHelper();
init.mFrameStats = mFrameStats;
init.mMediaDecoderOwnerID = mOwner;
mReader =
new MediaFormatReader(init, new HLSDemuxer(mHLSResourceWrapper->GetPlayerId()));

View File

@ -42,6 +42,7 @@ MediaSourceDecoder::CreateStateMachine()
init.mKnowsCompositor = GetCompositor();
init.mCrashHelper = GetOwner()->CreateGMPCrashHelper();
init.mFrameStats = mFrameStats;
init.mMediaDecoderOwnerID = mOwner;
mReader = new MediaFormatReader(init, mDemuxer);
return new MediaDecoderStateMachine(this, mReader);
}