Bug 1366639 - Add telemetry to track max number of PChromiumCDM video frame shmems. r=francois,gerald

This will enable us to pre-allocate the correct number of shared memory buffers
that we pre-allocate for sending video frames between the CDM and Gecko. That
means we won't need to take the slow path to recover from underestimating how
many shmems we need.



MozReview-Commit-ID: Q4mX2rYMz3

--HG--
extra : rebase_source : f9573cfbf4e65013803b46c0909be2c68566e512
This commit is contained in:
Chris Pearce 2017-05-22 15:03:00 +12:00
parent 1f2bbf4599
commit e5bb59cbdf
3 changed files with 23 additions and 0 deletions

View File

@ -10,6 +10,7 @@
#include "mozilla/Unused.h"
#include "ChromiumCDMProxy.h"
#include "mozilla/dom/MediaKeyMessageEventBinding.h"
#include "mozilla/Telemetry.h"
#include "content_decryption_module.h"
#include "GMPLog.h"
#include "MediaPrefs.h"
@ -696,6 +697,10 @@ ChromiumCDMParent::EnsureSufficientShmems(size_t aVideoFrameSize)
}
mVideoShmemsActive++;
}
mMaxVideoShmemsActive =
std::max(mMaxVideoShmemsActive, mVideoShmemsActive);
return true;
}
@ -1051,6 +1056,13 @@ ChromiumCDMParent::ShutdownVideoDecoder()
}
mVideoDecoderInitialized = false;
GMP_LOG("ChromiumCDMParent::~ShutdownVideoDecoder(this=%p) "
"VIDEO_CHROMIUM_CDM_MAX_SHMEMS=%u",
this,
mMaxVideoShmemsActive);
Telemetry::Accumulate(Telemetry::HistogramID::VIDEO_CHROMIUM_CDM_MAX_SHMEMS,
mMaxVideoShmemsActive);
// The ChromiumCDMChild will purge its shmems, so if the decoder is
// reinitialized the shmems need to be re-allocated, and they may need
// to be a different size.

View File

@ -166,6 +166,8 @@ protected:
uint32_t mVideoShmemsActive = 0;
// Maximum number of shmems to use to return decoded video frames.
uint32_t mVideoShmemLimit;
// High water mark for mVideoShmemsActive, reported via telemetry.
uint32_t mMaxVideoShmemsActive = 0;
bool mIsShutdown = false;
bool mVideoDecoderInitialized = false;

View File

@ -8331,6 +8331,15 @@
"description": "Reports whether a navigator.requestMediaKeySystemAccess() was called in a secure context (i.e. on an origin served over HTTPS) or not.",
"bug_numbers": [1360438]
},
"VIDEO_CHROMIUM_CDM_MAX_SHMEMS": {
"record_in_processes": ["main", "content"],
"alert_emails": ["cpearce@mozilla.com"],
"bug_numbers": [1366639],
"expires_in_version": "60",
"kind": "enumerated",
"n_values": 50,
"description": "Counts of the maximum number of shared memory buffers used for transferring video frames between the CDM and Gecko processes during playback of DRM'd video. Reported once per CDMVideoDecoder instance, i.e., once per JavaScript SourceBuffer during playback of video using EME."
},
"VIDEO_MFT_OUTPUT_NULL_SAMPLES": {
"record_in_processes": ["main", "content"],
"alert_emails": ["cpearce@mozilla.com"],