Backed out 3 changesets (bug 1892516) for causing multiple failures @ toolkit/components/glean/api/src/private/boolean.rs CLOSED TREE

Backed out changeset 842a809422f9 (bug 1892516)
Backed out changeset 5155a959fe13 (bug 1892516)
Backed out changeset d1cebb819ab9 (bug 1892516)
This commit is contained in:
Sandor Molnar 2024-04-25 21:30:10 +03:00
Родитель dbd07bdc6a
Коммит 6d01c0b28a
8 изменённых файлов: 60 добавлений и 95 удалений

Просмотреть файл

@ -10,14 +10,10 @@
#include "ImageContainer.h"
#include "MediaContainerType.h"
#include "MediaResource.h"
#include "PDMFactory.h"
#include "TimeUnits.h"
#include "mozilla/Base64.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/gfx/gfxVars.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/SchedulerGroup.h"
#include "mozilla/ScopeExit.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/StaticPrefs_accessibility.h"
#include "mozilla/StaticPrefs_media.h"
@ -32,10 +28,6 @@
#include "nsServiceManagerUtils.h"
#include "nsThreadUtils.h"
#ifdef XP_WIN
# include "WMFDecoderModule.h"
#endif
namespace mozilla {
using gfx::ColorRange;
@ -1255,40 +1247,4 @@ void DetermineResolutionForTelemetry(const MediaInfo& aInfo,
aResolutionOut.AppendASCII(resolution);
}
void ReportHardwareMediaCodecSupportProbe() {
// We only need to report the result once.
static bool sReported = false;
if (sReported) {
return;
}
// Only report telemetry when hardware decoding is available.
if (!gfx::gfxVars::IsInitialized() ||
!gfx::gfxVars::CanUseHardwareVideoDecoding()) {
return;
}
sReported = true;
#if defined(XP_WIN)
// We will disable HVEC later after reporting Telemetry if the pref is off.
auto scopeExit = MakeScopeExit([]() {
if (StaticPrefs::media_wmf_hevc_enabled() != 1) {
WMFDecoderModule::DisableForceEnableHEVC();
}
});
WMFDecoderModule::Init(WMFDecoderModule::Config::ForceEnableHEVC);
#endif
const auto support = PDMFactory::Supported(true /* force refresh */);
glean::media_playback::device_hardware_decoder_support.Get("h264"_ns).Set(
support.contains(mozilla::media::MediaCodecsSupport::H264HardwareDecode));
glean::media_playback::device_hardware_decoder_support.Get("vp8"_ns).Set(
support.contains(mozilla::media::MediaCodecsSupport::VP8HardwareDecode));
glean::media_playback::device_hardware_decoder_support.Get("vp9"_ns).Set(
support.contains(mozilla::media::MediaCodecsSupport::VP9HardwareDecode));
glean::media_playback::device_hardware_decoder_support.Get("av1"_ns).Set(
support.contains(mozilla::media::MediaCodecsSupport::AV1HardwareDecode));
glean::media_playback::device_hardware_decoder_support.Get("hevc"_ns).Set(
support.contains(mozilla::media::MediaCodecsSupport::HEVCHardwareDecode));
}
} // end namespace mozilla

Просмотреть файл

@ -553,10 +553,6 @@ bool IsWaveMimetype(const nsACString& aMimeType);
void DetermineResolutionForTelemetry(const MediaInfo& aInfo,
nsCString& aResolutionOut);
// Used in the GPU and RDD process for reporting Glean result on different
// platforms.
void ReportHardwareMediaCodecSupportProbe();
} // end namespace mozilla
#endif

Просмотреть файл

@ -52,10 +52,6 @@
# include "mozilla/SandboxTestingChild.h"
#endif
#if defined(XP_MACOSX) || defined(XP_LINUX)
# include "VideoUtils.h"
#endif
namespace mozilla {
using namespace ipc;
@ -136,10 +132,6 @@ mozilla::ipc::IPCResult RDDParent::RecvInit(
auto supported = PDMFactory::Supported();
Unused << SendUpdateMediaCodecsSupported(supported);
#if defined(XP_MACOSX) || defined(XP_LINUX)
// We report probe on GPU process on Windows and Android.
ReportHardwareMediaCodecSupportProbe();
#endif
#if defined(MOZ_SANDBOX)
# if defined(XP_MACOSX)
@ -176,10 +168,6 @@ IPCResult RDDParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) {
WMFDecoderModule::Init();
Unused << RDDParent::GetSingleton()->SendUpdateMediaCodecsSupported(
PDMFactory::Supported(true /* force refresh */));
# if defined(XP_MACOSX) || defined(XP_LINUX)
// We report probe on GPU process on Windows and Android.
ReportHardwareMediaCodecSupportProbe();
# endif
}
});
#endif

Просмотреть файл

@ -166,27 +166,3 @@ media.playback:
description: True if the first frame is decoded by a hardware decoder.
type: boolean
expires: never
device_hardware_decoder_support:
type: labeled_boolean
description:
The results of hardware decoder support for different video codecs. True
means that codec can be decoded by hardware on user's device.
metadata:
tags:
- 'Core :: Audio/Video: Playback'
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1892516
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1892516#c4
data_sensitivity:
- technical
notification_emails:
- media-alerts@mozilla.com
expires: never
labels:
- h264
- vp8
- vp9
- av1
- hevc
telemetry_mirror: MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT

Просмотреть файл

@ -485,9 +485,6 @@ bool WMFDecoderModule::IsHEVCSupported() {
return sForceEnableHEVC || StaticPrefs::media_wmf_hevc_enabled() == 1;
}
/* static */
void WMFDecoderModule::DisableForceEnableHEVC() { sForceEnableHEVC = false; }
} // namespace mozilla
#undef WFM_DECODER_MODULE_STATUS_MARKER

Просмотреть файл

@ -10,7 +10,6 @@
# include "PlatformDecoderModule.h"
# include "WMF.h"
# include "WMFUtils.h"
# include "mozilla/Atomics.h"
namespace mozilla {
@ -56,13 +55,11 @@ class WMFDecoderModule : public PlatformDecoderModule {
RefPtr<MFTDecoder>& aDecoder);
static bool CanCreateMFTDecoder(const WMFStreamType& aType);
static void DisableForceEnableHEVC();
private:
// This is used for GPU process only, where we can't set the preference
// directly (it can only set in the parent process) So we need a way to force
// enable the HEVC in order to report the support information via telemetry.
static inline Atomic<bool> sForceEnableHEVC{false};
static inline bool sForceEnableHEVC = false;
static bool IsHEVCSupported();

Просмотреть файл

@ -14,7 +14,6 @@
#include "GPUProcessManager.h"
#include "gfxGradientCache.h"
#include "GfxInfoBase.h"
#include "VideoUtils.h"
#include "VRGPUChild.h"
#include "VRManager.h"
#include "VRManagerParent.h"
@ -107,6 +106,63 @@ using namespace layers;
static GPUParent* sGPUParent;
static void ReportHardwareMediaCodecSupportIfNeeded() {
// We only need to report the result once.
static bool sReported = false;
if (sReported) {
return;
}
#if defined(XP_WIN)
// Only report telemetry when hardware decoding is available.
if (!gfx::gfxVars::IsInitialized() ||
!gfx::gfxVars::CanUseHardwareVideoDecoding()) {
return;
}
sReported = true;
// TODO : we can remove this after HEVC is enabled by default.
// HEVC is not enabled. We need to force to enable it in order to know
// its support as well, and it would be turn off later.
if (StaticPrefs::media_wmf_hevc_enabled() != 1) {
WMFDecoderModule::Init(WMFDecoderModule::Config::ForceEnableHEVC);
}
const auto support = PDMFactory::Supported(true /* force refresh */);
if (support.contains(
mozilla::media::MediaCodecsSupport::H264HardwareDecode)) {
Telemetry::ScalarSet(
Telemetry::ScalarID::MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT, u"h264"_ns,
true);
}
if (support.contains(mozilla::media::MediaCodecsSupport::VP8HardwareDecode)) {
Telemetry::ScalarSet(
Telemetry::ScalarID::MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT, u"vp8"_ns,
true);
}
if (support.contains(mozilla::media::MediaCodecsSupport::VP9HardwareDecode)) {
Telemetry::ScalarSet(
Telemetry::ScalarID::MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT, u"vp9"_ns,
true);
}
if (support.contains(mozilla::media::MediaCodecsSupport::AV1HardwareDecode)) {
Telemetry::ScalarSet(
Telemetry::ScalarID::MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT, u"av1"_ns,
true);
}
if (support.contains(
mozilla::media::MediaCodecsSupport::HEVCHardwareDecode)) {
Telemetry::ScalarSet(
Telemetry::ScalarID::MEDIA_DEVICE_HARDWARE_DECODING_SUPPORT, u"hevc"_ns,
true);
}
if (StaticPrefs::media_wmf_hevc_enabled() != 1) {
WMFDecoderModule::Init();
}
#endif
// TODO : in the future, when we have GPU procss on MacOS, then we can report
// HEVC usage as well.
}
GPUParent::GPUParent() : mLaunchTime(TimeStamp::Now()) { sGPUParent = this; }
GPUParent::~GPUParent() { sGPUParent = nullptr; }
@ -411,7 +467,7 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
Unused << GPUParent::GetSingleton()
->SendUpdateMediaCodecsSupported(supported);
}));
ReportHardwareMediaCodecSupportProbe();
ReportHardwareMediaCodecSupportIfNeeded();
});
MOZ_ALWAYS_SUCCEEDS(
NS_DispatchBackgroundTask(task, nsIEventTarget::DISPATCH_NORMAL));
@ -511,7 +567,7 @@ mozilla::ipc::IPCResult GPUParent::RecvUpdateVar(const GfxVarUpdate& aUpdate) {
Unused << GPUParent::GetSingleton()
->SendUpdateMediaCodecsSupported(supported);
}));
ReportHardwareMediaCodecSupportProbe();
ReportHardwareMediaCodecSupportIfNeeded();
});
MOZ_ALWAYS_SUCCEEDS(
NS_DispatchBackgroundTask(task, nsIEventTarget::DISPATCH_NORMAL));

Просмотреть файл

@ -2959,7 +2959,6 @@ media:
- 'firefox'
record_in_processes:
- 'gpu'
- 'rdd'
# The following section contains content process base counters.
dom.contentprocess: