diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/media/MediaDecoder.cpp | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/MediaDecoder.cpp')
-rw-r--r-- | dom/media/MediaDecoder.cpp | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index 23c30eed2a..159c6a6121 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -893,9 +893,44 @@ void MediaDecoder::FirstFrameLoaded( // We only care about video first frame. if (mInfo->HasVideo() && mMDSMCreationTime) { - mTelemetryProbesReporter->OntFirstFrameLoaded( - TimeStamp::Now() - *mMDSMCreationTime, IsMSE(), - mDecoderStateMachine->IsExternalEngineStateMachine()); + auto info = MakeUnique<dom::MediaDecoderDebugInfo>(); + RequestDebugInfo(*info)->Then( + GetMainThreadSerialEventTarget(), __func__, + [self = RefPtr<MediaDecoder>{this}, this, now = TimeStamp::Now(), + creationTime = *mMDSMCreationTime, result = std::move(info)]( + GenericPromise::ResolveOrRejectValue&& aValue) mutable { + if (IsShutdown()) { + return; + } + if (aValue.IsReject()) { + NS_WARNING("Failed to get debug info for the first frame probe!"); + return; + } + auto firstFrameLoadedTime = (now - creationTime).ToMilliseconds(); + MOZ_ASSERT(result->mReader.mTotalReadMetadataTimeMs >= 0.0); + MOZ_ASSERT(result->mReader.mTotalWaitingForVideoDataTimeMs >= 0.0); + MOZ_ASSERT(result->mStateMachine.mTotalBufferingTimeMs >= 0.0); + + using FirstFrameLoadedFlag = + TelemetryProbesReporter::FirstFrameLoadedFlag; + TelemetryProbesReporter::FirstFrameLoadedFlagSet flags; + if (IsMSE()) { + flags += FirstFrameLoadedFlag::IsMSE; + } + if (mDecoderStateMachine->IsExternalEngineStateMachine()) { + flags += FirstFrameLoadedFlag::IsExternalEngineStateMachine; + } + if (IsHLSDecoder()) { + flags += FirstFrameLoadedFlag::IsHLS; + } + if (result->mReader.mVideoHardwareAccelerated) { + flags += FirstFrameLoadedFlag::IsHardwareDecoding; + } + mTelemetryProbesReporter->OntFirstFrameLoaded( + firstFrameLoadedTime, result->mReader.mTotalReadMetadataTimeMs, + result->mReader.mTotalWaitingForVideoDataTimeMs, + result->mStateMachine.mTotalBufferingTimeMs, flags, *mInfo); + }); mMDSMCreationTime.reset(); } |