Commit c85d60e7 authored by watk's avatar watk Committed by Commit bot

Add a histogram for video decoder fallback.

BUG=447732
TEST=Manually inspect chrome:histograms.

Review URL: https://codereview.chromium.org/847223002

Cr-Commit-Position: refs/heads/master@{#311525}
parent 49418e62
...@@ -200,6 +200,7 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver { ...@@ -200,6 +200,7 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver {
bool has_audio; bool has_audio;
bool has_video; bool has_video;
bool video_dds; bool video_dds;
bool video_decoder_changed;
std::string audio_codec_name; std::string audio_codec_name;
std::string video_codec_name; std::string video_codec_name;
std::string video_decoder; std::string video_decoder;
...@@ -207,7 +208,8 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver { ...@@ -207,7 +208,8 @@ class MediaInternals::MediaInternalsUMAHandler : public NotificationObserver {
: last_pipeline_status(media::PIPELINE_OK), : last_pipeline_status(media::PIPELINE_OK),
has_audio(false), has_audio(false),
has_video(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. // Helper function to report PipelineStatus associated with a player to UMA.
...@@ -260,10 +262,6 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState( ...@@ -260,10 +262,6 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
PlayerInfoMap& player_info = renderer_info_[render_process_id]; PlayerInfoMap& player_info = renderer_info_[render_process_id];
switch (event.type) { switch (event.type) {
case media::MediaLogEvent::WEBMEDIAPLAYER_CREATED: {
// Nothing to do here
break;
}
case media::MediaLogEvent::PIPELINE_ERROR: { case media::MediaLogEvent::PIPELINE_ERROR: {
int status; int status;
event.params.GetInteger("pipeline_error", &status); event.params.GetInteger("pipeline_error", &status);
...@@ -289,8 +287,13 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState( ...@@ -289,8 +287,13 @@ void MediaInternals::MediaInternalsUMAHandler::SavePlayerState(
&player_info[event.id].video_codec_name); &player_info[event.id].video_codec_name);
} }
if (event.params.HasKey("video_decoder")) { if (event.params.HasKey("video_decoder")) {
std::string previous_video_decoder(player_info[event.id].video_decoder);
event.params.GetString("video_decoder", event.params.GetString("video_decoder",
&player_info[event.id].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")) { if (event.params.HasKey("video_dds")) {
event.params.GetBoolean("video_dds", &player_info[event.id].video_dds); event.params.GetBoolean("video_dds", &player_info[event.id].video_dds);
...@@ -356,6 +359,12 @@ void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus( ...@@ -356,6 +359,12 @@ void MediaInternals::MediaInternalsUMAHandler::ReportUMAForPipelineStatus(
player_info.last_pipeline_status, player_info.last_pipeline_status,
media::PIPELINE_STATUS_MAX + 1); 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( void MediaInternals::MediaInternalsUMAHandler::LogAndClearPlayersInRenderer(
......
...@@ -12997,6 +12997,14 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -12997,6 +12997,14 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="Media.VideoDecoderFallback" enum="BooleanDidFallBack">
<owner>watk@chromium.org</owner>
<summary>
Whether Chrome had to fall back to a secondary video decoder after the
primary decoder failed reinitialization.
</summary>
</histogram>
<histogram name="Media.VideoPixelFormat" enum="VideoPixelFormat"> <histogram name="Media.VideoPixelFormat" enum="VideoPixelFormat">
<owner>scherkus@chromium.org</owner> <owner>scherkus@chromium.org</owner>
<summary>Pixel format used in HTML5 video. Emitted on video load.</summary> <summary>Pixel format used in HTML5 video. Emitted on video load.</summary>
...@@ -42963,6 +42971,11 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -42963,6 +42971,11 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="1" label="Did evict"/> <int value="1" label="Did evict"/>
</enum> </enum>
<enum name="BooleanDidFallBack" type="int">
<int value="0" label="Did not fall back"/>
<int value="1" label="Did fall back"/>
</enum>
<enum name="BooleanDistillable" type="int"> <enum name="BooleanDistillable" type="int">
<int value="0" label="Not distillable"/> <int value="0" label="Not distillable"/>
<int value="1" label="Distillable"/> <int value="1" label="Distillable"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment