diff options
author | vigneshv <vigneshv@chromium.org> | 2015-02-11 16:36:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-12 00:36:50 +0000 |
commit | 43cc12191a2b451e73b01566c14a1c1811afc22b (patch) | |
tree | 2a14d89c73429152bb29a12bec072aeea31cc542 /net | |
parent | 24dc5eece51abf42b79c885573abc782c413945f (diff) | |
download | chromium_src-43cc12191a2b451e73b01566c14a1c1811afc22b.zip chromium_src-43cc12191a2b451e73b01566c14a1c1811afc22b.tar.gz chromium_src-43cc12191a2b451e73b01566c14a1c1811afc22b.tar.bz2 |
net: Update mime_util to disable Ogg Opus on Android.
Opus Codec is supported in Android L+ only on Matroska/WebM
container (and not in Ogg) as of this writing. This CL disables
Opus in Ogg for Android so that canPlayType does not return
"probably".
BUG=456967
Review URL: https://codereview.chromium.org/915493002
Cr-Commit-Position: refs/heads/master@{#315886}
Diffstat (limited to 'net')
-rw-r--r-- | net/base/mime_util.cc | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/net/base/mime_util.cc b/net/base/mime_util.cc index e03cb4c..70b053c 100644 --- a/net/base/mime_util.cc +++ b/net/base/mime_util.cc @@ -527,23 +527,29 @@ static const char kMP4VideoCodecsExpression[] = "mp4a.40.05,mp4a.40.29"; static const MediaFormatStrict format_codec_mappings[] = { - { "video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0" }, - { "audio/webm", "opus,vorbis" }, - { "audio/wav", "1" }, - { "audio/x-wav", "1" }, - { "video/ogg", "opus,theora,vorbis" }, - { "audio/ogg", "opus,vorbis" }, - { "application/ogg", "opus,theora,vorbis" }, - { "audio/mpeg", "mp3" }, - { "audio/mp3", "" }, - { "audio/x-mp3", "" }, - { "audio/mp4", kMP4AudioCodecsExpression }, - { "audio/x-m4a", kMP4AudioCodecsExpression }, - { "video/mp4", kMP4VideoCodecsExpression }, - { "video/x-m4v", kMP4VideoCodecsExpression }, - { "application/x-mpegurl", kMP4VideoCodecsExpression }, - { "application/vnd.apple.mpegurl", kMP4VideoCodecsExpression } -}; + {"video/webm", "opus,vorbis,vp8,vp8.0,vp9,vp9.0"}, + {"audio/webm", "opus,vorbis"}, + {"audio/wav", "1"}, + {"audio/x-wav", "1"}, +// Android does not support Opus in Ogg container. +#if defined(OS_ANDROID) + {"video/ogg", "theora,vorbis"}, + {"audio/ogg", "vorbis"}, + {"application/ogg", "theora,vorbis"}, +#else + {"video/ogg", "opus,theora,vorbis"}, + {"audio/ogg", "opus,vorbis"}, + {"application/ogg", "opus,theora,vorbis"}, +#endif + {"audio/mpeg", "mp3"}, + {"audio/mp3", ""}, + {"audio/x-mp3", ""}, + {"audio/mp4", kMP4AudioCodecsExpression}, + {"audio/x-m4a", kMP4AudioCodecsExpression}, + {"video/mp4", kMP4VideoCodecsExpression}, + {"video/x-m4v", kMP4VideoCodecsExpression}, + {"application/x-mpegurl", kMP4VideoCodecsExpression}, + {"application/vnd.apple.mpegurl", kMP4VideoCodecsExpression}}; struct CodecIDMappings { const char* const codec_id; |