Bug 1690372 - part2 : add Telemetry probe for WMF usage. r=bryce

Depends on D103836

Differential Revision: https://phabricator.services.mozilla.com/D103837
This commit is contained in:
alwu 2021-02-16 23:53:45 +00:00
parent 8cdda9e6f3
commit 6f21141c39
3 changed files with 31 additions and 0 deletions

View File

@ -178,6 +178,8 @@ nsresult WMFDecoderModule::Startup() {
already_AddRefed<MediaDataDecoder> WMFDecoderModule::CreateVideoDecoder(
const CreateDecoderParams& aParams) {
ReportUsageForTelemetry();
// In GPU process, only support decoding if an accelerated compositor is
// known.
if (XRE_IsGPUProcess() &&
@ -214,6 +216,8 @@ already_AddRefed<MediaDataDecoder> WMFDecoderModule::CreateVideoDecoder(
already_AddRefed<MediaDataDecoder> WMFDecoderModule::CreateAudioDecoder(
const CreateDecoderParams& aParams) {
ReportUsageForTelemetry();
if (XRE_IsGPUProcess()) {
// Only allow video in the GPU process.
return nullptr;
@ -288,6 +292,8 @@ bool WMFDecoderModule::SupportsMimeType(
bool WMFDecoderModule::Supports(const SupportDecoderParams& aParams,
DecoderDoctorDiagnostics* aDiagnostics) const {
ReportUsageForTelemetry();
// In GPU process, only support decoding if video. This only gives a hint of
// what the GPU decoder *may* support. The actual check will occur in
// CreateVideoDecoder.
@ -341,6 +347,12 @@ bool WMFDecoderModule::Supports(const SupportDecoderParams& aParams,
return false;
}
void WMFDecoderModule::ReportUsageForTelemetry() const {
if (XRE_IsParentProcess() || XRE_IsContentProcess()) {
Telemetry::ScalarSet(Telemetry::ScalarID::MEDIA_WMF_PROCESS_USAGE, true);
}
}
} // namespace mozilla
#undef WFM_DECODER_MODULE_STATUS_MARKER

View File

@ -50,6 +50,8 @@ class WMFDecoderModule : public PlatformDecoderModule {
WMFDecoderModule() = default;
virtual ~WMFDecoderModule();
void ReportUsageForTelemetry() const;
bool mWMFInitialized = false;
};

View File

@ -2242,6 +2242,23 @@ media:
record_in_processes:
- 'content'
wmf_process_usage:
bug_numbers:
- 1690372
description: >
Record whether the WMF decoder module is used in content or chrome process.
expires: "93"
kind: boolean
notification_emails:
- alwu@mozilla.com
- bvandyk@mozilla.com
release_channel_collection: opt-out
products:
- 'firefox'
record_in_processes:
- 'main'
- 'content'
# The following section contains content process base counters.
dom.contentprocess:
buildID_mismatch: