Skip to content

Commit

Permalink
(merge) media: Report UMA on first MediaFoundationCdm init
Browse files Browse the repository at this point in the history
Currently we are seeing failures of MediaFoundationCdm initialization.
It's unclear whether those failures are happening right on the first
initialization, or only when we create many CDM instances. Adding a UMA
to only report on the first MediaFoundationCdm initialization to try
to help answer this question.

(cherry picked from commit 82b082e)

Bug: 1309741
Change-Id: I93bf1f1f7522e7d1cff53c8b5231c855f1518ede
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3587561
Reviewed-by: Evan Liu <evliu@google.com>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#992987}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3594236
Auto-Submit: Xiaohan Wang <xhwang@chromium.org>
Commit-Queue: Evan Liu <evliu@google.com>
Cr-Commit-Position: refs/branch-heads/5005@{#45}
Cr-Branched-From: 5b4d945-refs/heads/main@{#992738}
  • Loading branch information
xhwang-chromium authored and Chromium LUCI CQ committed Apr 20, 2022
1 parent a4d887e commit dd500c1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions media/cdm/win/media_foundation_cdm_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ void MediaFoundationCdmFactory::OnCdmOriginIdObtained(
auto bound_cdm_created_cb = BindToCurrentLoop(std::move(cdm_created_cb));

HRESULT hr = cdm->Initialize();

static bool s_first_initialize_reported = false;
if (!s_first_initialize_reported) {
base::UmaHistogramSparse(uma_prefix + "FirstInitialize", hr);
s_first_initialize_reported = true;
}

if (FAILED(hr)) {
base::UmaHistogramSparse(uma_prefix + "Initialize", hr);
std::move(bound_cdm_created_cb)
Expand Down
12 changes: 12 additions & 0 deletions tools/metrics/histograms/metadata/media/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2208,6 +2208,18 @@ chromium-metrics-reviews@google.com.
</summary>
</histogram>

<histogram
name="Media.EME.MediaFoundationCdm.Widevine.HardwareSecure.FirstInitialize"
enum="Hresult" expires_after="2022-08-21">
<owner>xhwang@chromium.org</owner>
<owner>media-dev@chromium.org</owner>
<summary>
HRESULT of the first (and only the first) MediaFoundationCdm initialization
in a MeidaFoundationService process when using Widevine in hardware secure
mode. Reported on both successes and failures.
</summary>
</histogram>

<histogram
name="Media.EME.MediaFoundationCdm.Widevine.HardwareSecure.Initialize"
enum="Hresult" expires_after="2022-08-21">
Expand Down

0 comments on commit dd500c1

Please sign in to comment.