From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- dom/media/utils/TelemetryProbesReporter.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'dom/media/utils/TelemetryProbesReporter.cpp') diff --git a/dom/media/utils/TelemetryProbesReporter.cpp b/dom/media/utils/TelemetryProbesReporter.cpp index 377cee9abc..e702ae14c5 100644 --- a/dom/media/utils/TelemetryProbesReporter.cpp +++ b/dom/media/utils/TelemetryProbesReporter.cpp @@ -7,6 +7,7 @@ #include #include "FrameStatistics.h" +#include "MediaCodecsSupport.h" #include "VideoUtils.h" #include "mozilla/EMEUtils.h" #include "mozilla/Logging.h" @@ -791,5 +792,32 @@ double TelemetryProbesReporter::GetAudiblePlayTimeInSeconds() const { return GetTotalAudioPlayTimeInSeconds() - GetInaudiblePlayTimeInSeconds(); } +/* static */ +void TelemetryProbesReporter::ReportDeviceMediaCodecSupported( + const media::MediaCodecsSupported& aSupported) { + static bool sReported = false; + if (sReported) { + return; + } + MOZ_ASSERT(ContainHardwareCodecsSupported(aSupported)); + sReported = true; + + glean::media_playback::device_hardware_decoder_support.Get("h264"_ns).Set( + aSupported.contains( + mozilla::media::MediaCodecsSupport::H264HardwareDecode)); + glean::media_playback::device_hardware_decoder_support.Get("vp8"_ns).Set( + aSupported.contains( + mozilla::media::MediaCodecsSupport::VP8HardwareDecode)); + glean::media_playback::device_hardware_decoder_support.Get("vp9"_ns).Set( + aSupported.contains( + mozilla::media::MediaCodecsSupport::VP9HardwareDecode)); + glean::media_playback::device_hardware_decoder_support.Get("av1"_ns).Set( + aSupported.contains( + mozilla::media::MediaCodecsSupport::AV1HardwareDecode)); + glean::media_playback::device_hardware_decoder_support.Get("hevc"_ns).Set( + aSupported.contains( + mozilla::media::MediaCodecsSupport::HEVCHardwareDecode)); +} + #undef LOG } // namespace mozilla -- cgit v1.2.3