| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "media/base/mime_util_internal.h" | 5 #include "media/base/mime_util_internal.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 // (crbug.com/564960). | 70 // (crbug.com/564960). |
| 71 {"ac-3", MimeUtil::AC3}, | 71 {"ac-3", MimeUtil::AC3}, |
| 72 {"mp4a.a5", MimeUtil::AC3}, | 72 {"mp4a.a5", MimeUtil::AC3}, |
| 73 {"mp4a.A5", MimeUtil::AC3}, | 73 {"mp4a.A5", MimeUtil::AC3}, |
| 74 {"ec-3", MimeUtil::EAC3}, | 74 {"ec-3", MimeUtil::EAC3}, |
| 75 {"mp4a.a6", MimeUtil::EAC3}, | 75 {"mp4a.a6", MimeUtil::EAC3}, |
| 76 {"mp4a.A6", MimeUtil::EAC3}, | 76 {"mp4a.A6", MimeUtil::EAC3}, |
| 77 #endif | 77 #endif |
| 78 {"vorbis", MimeUtil::VORBIS}, | 78 {"vorbis", MimeUtil::VORBIS}, |
| 79 {"opus", MimeUtil::OPUS}, | 79 {"opus", MimeUtil::OPUS}, |
| 80 {"flac", MimeUtil::FLAC}, |
| 80 {"vp8", MimeUtil::VP8}, | 81 {"vp8", MimeUtil::VP8}, |
| 81 {"vp8.0", MimeUtil::VP8}, | 82 {"vp8.0", MimeUtil::VP8}, |
| 82 {"theora", MimeUtil::THEORA}}; | 83 {"theora", MimeUtil::THEORA}}; |
| 83 | 84 |
| 84 // List of codec IDs that are ambiguous and don't provide | 85 // List of codec IDs that are ambiguous and don't provide |
| 85 // enough information to determine the codec and profile. | 86 // enough information to determine the codec and profile. |
| 86 // The codec in these entries indicate the codec and profile | 87 // The codec in these entries indicate the codec and profile |
| 87 // we assume the user is trying to indicate. | 88 // we assume the user is trying to indicate. |
| 88 static const CodecIDMappings kAmbiguousCodecStringMap[] = { | 89 static const CodecIDMappings kAmbiguousCodecStringMap[] = { |
| 89 {"mp4a.40", MimeUtil::MPEG4_AAC}, | 90 {"mp4a.40", MimeUtil::MPEG4_AAC}, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Each call to AddContainerWithCodecs() contains a media type | 217 // Each call to AddContainerWithCodecs() contains a media type |
| 217 // (https://en.wikipedia.org/wiki/Media_type) and corresponding media codec(s) | 218 // (https://en.wikipedia.org/wiki/Media_type) and corresponding media codec(s) |
| 218 // supported by these types/containers. | 219 // supported by these types/containers. |
| 219 // TODO(ddorwin): Replace insert() calls with initializer_list when allowed. | 220 // TODO(ddorwin): Replace insert() calls with initializer_list when allowed. |
| 220 void MimeUtil::AddSupportedMediaFormats() { | 221 void MimeUtil::AddSupportedMediaFormats() { |
| 221 CodecSet implicit_codec; | 222 CodecSet implicit_codec; |
| 222 CodecSet wav_codecs; | 223 CodecSet wav_codecs; |
| 223 wav_codecs.insert(PCM); | 224 wav_codecs.insert(PCM); |
| 224 | 225 |
| 225 CodecSet ogg_audio_codecs; | 226 CodecSet ogg_audio_codecs; |
| 227 ogg_audio_codecs.insert(FLAC); |
| 226 ogg_audio_codecs.insert(OPUS); | 228 ogg_audio_codecs.insert(OPUS); |
| 227 ogg_audio_codecs.insert(VORBIS); | 229 ogg_audio_codecs.insert(VORBIS); |
| 228 CodecSet ogg_video_codecs; | 230 CodecSet ogg_video_codecs; |
| 229 #if !defined(OS_ANDROID) | 231 #if !defined(OS_ANDROID) |
| 230 ogg_video_codecs.insert(THEORA); | 232 ogg_video_codecs.insert(THEORA); |
| 231 #endif // !defined(OS_ANDROID) | 233 #endif // !defined(OS_ANDROID) |
| 232 CodecSet ogg_codecs(ogg_audio_codecs); | 234 CodecSet ogg_codecs(ogg_audio_codecs); |
| 233 ogg_codecs.insert(ogg_video_codecs.begin(), ogg_video_codecs.end()); | 235 ogg_codecs.insert(ogg_video_codecs.begin(), ogg_video_codecs.end()); |
| 234 | 236 |
| 235 CodecSet webm_audio_codecs; | 237 CodecSet webm_audio_codecs; |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 686 const std::string& mime_type_lower_case, | 688 const std::string& mime_type_lower_case, |
| 687 bool is_encrypted) const { | 689 bool is_encrypted) const { |
| 688 Codec default_codec = Codec::INVALID_CODEC; | 690 Codec default_codec = Codec::INVALID_CODEC; |
| 689 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 691 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
| 690 return false; | 692 return false; |
| 691 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 693 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
| 692 } | 694 } |
| 693 | 695 |
| 694 } // namespace internal | 696 } // namespace internal |
| 695 } // namespace media | 697 } // namespace media |
| OLD | NEW |