Chromium Code Reviews| Index: media/filters/ffmpeg_demuxer.cc |
| diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc |
| index 081bcbf1a452be23ee45adb6a080e11bd5b55c77..c3d6d9a3b96984fe564ed630f937bd8357368c4c 100644 |
| --- a/media/filters/ffmpeg_demuxer.cc |
| +++ b/media/filters/ffmpeg_demuxer.cc |
| @@ -160,7 +160,8 @@ static void RecordAudioCodecStats(const AudioDecoderConfig& audio_config) { |
| } |
| // Record video decoder config UMA stats corresponding to a src= playback. |
| -static void RecordVideoCodecStats(const VideoDecoderConfig& video_config, |
| +static void RecordVideoCodecStats(const std::string& format_names, |
|
xhwang
2017/04/27 16:32:50
Can you add a comment about what "format_names" sh
kqyang
2017/04/27 18:12:53
Done.
|
| + const VideoDecoderConfig& video_config, |
| AVColorRange color_range, |
| MediaLog* media_log) { |
| media_log->RecordRapporWithSecurityOrigin("Media.OriginUrl.SRC.VideoCodec." + |
| @@ -168,6 +169,13 @@ static void RecordVideoCodecStats(const VideoDecoderConfig& video_config, |
| UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(), |
| kVideoCodecMax + 1); |
| + if (format_names.find("mp4") != std::string::npos) { |
|
xhwang
2017/04/27 16:32:50
What will happen if we have a file named mp4.webm?
kqyang
2017/04/27 18:12:53
|format_names| only contains format names :) Hopef
|
| + UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec.MP4", video_config.codec(), |
| + kVideoCodecMax + 1); |
| + } else if (format_names.find("webm") != std::string::npos) { |
| + UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec.WebM", video_config.codec(), |
| + kVideoCodecMax + 1); |
| + } |
| // Drop UNKNOWN because U_H_E() uses one bucket for all values less than 1. |
| if (video_config.profile() >= 0) { |
| @@ -1385,8 +1393,8 @@ void FFmpegDemuxer::OnFindStreamInfoDone(const PipelineStatusCB& status_cb, |
| } else if (codec_type == AVMEDIA_TYPE_VIDEO) { |
| VideoDecoderConfig video_config = streams_[i]->video_decoder_config(); |
| - RecordVideoCodecStats(video_config, stream->codecpar->color_range, |
| - media_log_); |
| + RecordVideoCodecStats(format_context->iformat->name, video_config, |
| + stream->codecpar->color_range, media_log_); |
| media_track = media_tracks->AddVideoTrack(video_config, track_id, "main", |
| track_label, track_language); |