Index: media/filters/stream_parser_factory.cc |
diff --git a/media/filters/stream_parser_factory.cc b/media/filters/stream_parser_factory.cc |
index c1587699fef8d9148a94a64d17e8922a46270303..1a34f6a94975a3f94b29cead477d0c1b3c68bdc0 100644 |
--- a/media/filters/stream_parser_factory.cc |
+++ b/media/filters/stream_parser_factory.cc |
@@ -37,6 +37,7 @@ struct CodecInfo { |
HISTOGRAM_MPEG2AAC, |
HISTOGRAM_MPEG4AAC, |
HISTOGRAM_EAC3, |
+ HISTOGRAM_OPUS, |
HISTOGRAM_MAX // Must be the last entry. |
}; |
@@ -62,16 +63,20 @@ static const CodecInfo kVP9CodecInfo = { "vp9", CodecInfo::VIDEO, NULL, |
CodecInfo::HISTOGRAM_VP9 }; |
static const CodecInfo kVorbisCodecInfo = { "vorbis", CodecInfo::AUDIO, NULL, |
CodecInfo::HISTOGRAM_VORBIS }; |
+static const CodecInfo kOpusCodecInfo = { "opus", CodecInfo::AUDIO, NULL, |
+ CodecInfo::HISTOGRAM_OPUS }; |
static const CodecInfo* kVideoWebMCodecs[] = { |
&kVP8CodecInfo, |
&kVP9CodecInfo, |
&kVorbisCodecInfo, |
+ &kOpusCodecInfo, |
NULL |
}; |
static const CodecInfo* kAudioWebMCodecs[] = { |
&kVorbisCodecInfo, |
+ &kOpusCodecInfo, |
NULL |
}; |
@@ -208,6 +213,11 @@ static bool VerifyCodec( |
return false; |
} |
#endif |
+ if (codec_info->tag == CodecInfo::HISTOGRAM_OPUS) { |
+ const CommandLine* cmd_line = CommandLine::ForCurrentProcess(); |
+ if (!cmd_line->HasSwitch(switches::kEnableOpusPlayback)) |
+ return false; |
+ } |
if (audio_codecs) |
audio_codecs->push_back(codec_info->tag); |
return true; |