summaryrefslogtreecommitdiffstats
path: root/dom/media/MediaDecoder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/media/MediaDecoder.cpp')
-rw-r--r--dom/media/MediaDecoder.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index c7fdcb6844..23c30eed2a 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -140,9 +140,7 @@ void MediaDecoder::InitStatics() {
# if defined(MOZ_FFMPEG)
Preferences::Lock("media.utility-ffmpeg.enabled");
# endif // defined(MOZ_FFMPEG)
-# if defined(MOZ_FFVPX)
Preferences::Lock("media.utility-ffvpx.enabled");
-# endif // defined(MOZ_FFVPX)
# if defined(MOZ_WMF)
Preferences::Lock("media.utility-wmf.enabled");
# endif // defined(MOZ_WMF)
@@ -194,6 +192,12 @@ void MediaDecoder::SetOutputCaptureState(OutputCaptureState aState,
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(mDecoderStateMachine, "Must be called after Load().");
MOZ_ASSERT_IF(aState == OutputCaptureState::Capture, aDummyTrack);
+
+ if (mOutputCaptureState.Ref() != aState) {
+ LOG("Capture state change from %s to %s",
+ OutputCaptureStateToStr(mOutputCaptureState.Ref()),
+ OutputCaptureStateToStr(aState));
+ }
mOutputCaptureState = aState;
if (mOutputDummyTrack.Ref().get() != aDummyTrack) {
mOutputDummyTrack = nsMainThreadPtrHandle<SharedDummyTrack>(
@@ -450,6 +454,7 @@ void MediaDecoder::OnPlaybackErrorEvent(const MediaResult& aError) {
}
LOG("Need to create a new %s state machine",
needExternalEngine ? "external engine" : "normal");
+ mStateMachineRecreated = true;
nsresult rv = CreateAndInitStateMachine(
false /* live stream */,
@@ -611,6 +616,7 @@ nsresult MediaDecoder::CreateAndInitStateMachine(bool aIsLiveStream,
NS_ENSURE_TRUE(GetStateMachine(), NS_ERROR_FAILURE);
GetStateMachine()->DispatchIsLiveStream(aIsLiveStream);
+ mMDSMCreationTime = Some(TimeStamp::Now());
nsresult rv = mDecoderStateMachine->Init(this);
NS_ENSURE_SUCCESS(rv, rv);
@@ -885,6 +891,14 @@ void MediaDecoder::FirstFrameLoaded(
ChangeState(mNextState);
}
+ // We only care about video first frame.
+ if (mInfo->HasVideo() && mMDSMCreationTime) {
+ mTelemetryProbesReporter->OntFirstFrameLoaded(
+ TimeStamp::Now() - *mMDSMCreationTime, IsMSE(),
+ mDecoderStateMachine->IsExternalEngineStateMachine());
+ mMDSMCreationTime.reset();
+ }
+
// GetOwner()->FirstFrameLoaded() might call us back. Put it at the bottom of
// this function to avoid unexpected shutdown from reentrant calls.
if (aEventVisibility != MediaDecoderEventVisibility::Suppressed) {