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

Unified Diff: media/filters/ffmpeg_demuxer.cc

Issue 2846693002: Add UMA metrics for VideoCodec.MP4 and VideoCodec.WebM (Closed)
Patch Set: Address comment #1 Created 3 years, 8 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 | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer.cc
diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
index 081bcbf1a452be23ee45adb6a080e11bd5b55c77..fb5b77a7326fb7a502645d2e56cff0b5d143519d 100644
--- a/media/filters/ffmpeg_demuxer.cc
+++ b/media/filters/ffmpeg_demuxer.cc
@@ -160,7 +160,10 @@ 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,
+// |format_names| is a comma separated list of short names for the media file
+// format, e.g. "matroska,webm", "mov,mp4,3gp,3g2,mj2".
+static void RecordVideoCodecStats(const char* format_names,
+ const VideoDecoderConfig& video_config,
AVColorRange color_range,
MediaLog* media_log) {
media_log->RecordRapporWithSecurityOrigin("Media.OriginUrl.SRC.VideoCodec." +
@@ -168,6 +171,13 @@ static void RecordVideoCodecStats(const VideoDecoderConfig& video_config,
UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec", video_config.codec(),
kVideoCodecMax + 1);
+ if (strstr(format_names, "mp4")) {
DaleCurtis 2017/04/27 19:05:28 ffmpeg_glue has copies of these names too. I think
kqyang 2017/04/27 21:07:59 How about make container[1] a member variable of f
DaleCurtis 2017/04/27 21:10:43 Good suggestion, sgtm.
+ UMA_HISTOGRAM_ENUMERATION("Media.VideoCodec.MP4", video_config.codec(),
+ kVideoCodecMax + 1);
+ } else if (strstr(format_names, "webm")) {
+ 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 +1395,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);
« no previous file with comments | « no previous file | media/filters/stream_parser_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698