Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(768)

Unified Diff: content/browser/media/media_internals.cc

Issue 847223002: Add a histogram for video decoder fallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Report from media internals instead. Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/media_internals.cc
diff --git a/content/browser/media/media_internals.cc b/content/browser/media/media_internals.cc
index d57e57db9ba1dcadc5a33b48189a010c92abace1..e2a5ede68bbdd7fe2d38ccf0cdecd0dde7f32392 100644
--- a/content/browser/media/media_internals.cc
+++ b/content/browser/media/media_internals.cc
@@ -200,6 +200,7 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver {
bool has_audio;
bool has_video;
bool video_dds;
+ bool video_decoder_changed;
std::string audio_codec_name;
std::string video_codec_name;
std::string video_decoder;
@@ -207,7 +208,8 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver {
: last_pipeline_status(media::PIPELINE_OK),
has_audio(false),
has_video(false),
- video_dds(false) {}
+ video_dds(false),
+ video_decoder_changed(false) {}
};
// Helper function to report PipelineStatus associated with a player to UMA.
@@ -260,10 +262,6 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
PlayerInfoMap& player_info = renderer_info_[render_process_id];
switch (event.type) {
- case media::MediaLogEvent::WEBMEDIAPLAYER_CREATED: {
- // Nothing to do here
- break;
- }
case media::MediaLogEvent::PIPELINE_ERROR: {
int status;
event.params.GetInteger("pipeline_error", &status);
@@ -289,8 +287,13 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
&player_info[event.id].video_codec_name);
}
if (event.params.HasKey("video_decoder")) {
+ std::string previous_video_decoder(player_info[event.id].video_decoder);
event.params.GetString("video_decoder",
&player_info[event.id].video_decoder);
+ if (!previous_video_decoder.empty() &&
+ previous_video_decoder != player_info[event.id].video_decoder) {
+ player_info[event.id].video_decoder_changed = true;
+ }
}
if (event.params.HasKey("video_dds")) {
event.params.GetBoolean("video_dds", &player_info[event.id].video_dds);
@@ -356,6 +359,12 @@ void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus(
player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1);
}
+ // Report whether video decoder fallback happened, but only if a video decoder
+ // was reported.
+ if (!player_info.video_decoder.empty()) {
+ UMA_HISTOGRAM_BOOLEAN("Media.VideoDecoderFallback",
+ player_info.video_decoder_changed);
+ }
}
void MediaInternals::MediaInternalsUMAHandler::LogAndClearPlayersInRenderer(
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698