OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <algorithm> | 5 #include <algorithm> |
6 #include <iterator> | 6 #include <iterator> |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "net/base/mime_util.h" | 10 #include "net/base/mime_util.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
301 // Refer to http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support | 301 // Refer to http://wiki.whatwg.org/wiki/Video_type_parameters#Browser_Support |
302 // for more information. | 302 // for more information. |
303 // | 303 // |
304 // The codecs for WAV are integers as defined in Appendix A of RFC2361: | 304 // The codecs for WAV are integers as defined in Appendix A of RFC2361: |
305 // http://tools.ietf.org/html/rfc2361 | 305 // http://tools.ietf.org/html/rfc2361 |
306 static const char* const common_media_codecs[] = { | 306 static const char* const common_media_codecs[] = { |
307 #if defined(ENABLE_MEDIA_CODEC_THEORA) | 307 #if defined(ENABLE_MEDIA_CODEC_THEORA) |
308 "theora", | 308 "theora", |
309 #endif | 309 #endif |
310 "vorbis", | 310 "vorbis", |
311 "opus", | |
311 "vp8", | 312 "vp8", |
312 "1" // WAVE_FORMAT_PCM. | 313 "1" // WAVE_FORMAT_PCM. |
313 }; | 314 }; |
314 | 315 |
315 // List of proprietary codecs only supported by Google Chrome. | 316 // List of proprietary codecs only supported by Google Chrome. |
316 static const char* const proprietary_media_codecs[] = { | 317 static const char* const proprietary_media_codecs[] = { |
317 "avc1", | 318 "avc1", |
318 "mp4a" | 319 "mp4a" |
319 }; | 320 }; |
320 | 321 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 "application/atom+xml", | 415 "application/atom+xml", |
415 "image/svg+xml" | 416 "image/svg+xml" |
416 }; | 417 }; |
417 | 418 |
418 struct MediaFormatStrict { | 419 struct MediaFormatStrict { |
419 const char* mime_type; | 420 const char* mime_type; |
420 const char* codecs_list; | 421 const char* codecs_list; |
421 }; | 422 }; |
422 | 423 |
423 static const MediaFormatStrict format_codec_mappings[] = { | 424 static const MediaFormatStrict format_codec_mappings[] = { |
424 { "video/webm", "vorbis,vp8,vp8.0" }, | 425 { "video/webm", "vorbis,opus,vp8,vp8.0" }, |
425 { "audio/webm", "vorbis" }, | 426 { "audio/webm", "vorbis,opus" }, |
426 { "audio/wav", "1" } | 427 { "audio/wav", "1" } |
427 }; | 428 }; |
428 | 429 |
429 MimeUtil::MimeUtil() { | 430 MimeUtil::MimeUtil() { |
430 InitializeMimeTypeMaps(); | 431 InitializeMimeTypeMaps(); |
431 } | 432 } |
432 | 433 |
433 // static | 434 // static |
434 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, | 435 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, |
435 const std::vector<std::string>& codecs) { | 436 const std::vector<std::string>& codecs) { |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
805 "audio/aiff", | 806 "audio/aiff", |
806 "audio/amr", | 807 "audio/amr", |
807 "audio/basic", | 808 "audio/basic", |
808 "audio/midi", | 809 "audio/midi", |
809 "audio/mp3", | 810 "audio/mp3", |
810 "audio/mp4", | 811 "audio/mp4", |
811 "audio/mpeg", | 812 "audio/mpeg", |
812 "audio/mpeg3", | 813 "audio/mpeg3", |
813 "audio/ogg", | 814 "audio/ogg", |
814 "audio/vorbis", | 815 "audio/vorbis", |
816 "audio/opus", | |
xhwang
2012/12/14 08:41:48
it seems there are ordered, fix the order?
Tom Finegan
2012/12/14 20:21:34
Done.
| |
815 "audio/wav", | 817 "audio/wav", |
816 "audio/webm", | 818 "audio/webm", |
817 "audio/x-m4a", | 819 "audio/x-m4a", |
818 "audio/x-ms-wma", | 820 "audio/x-ms-wma", |
819 "audio/vnd.rn-realaudio", | 821 "audio/vnd.rn-realaudio", |
820 "audio/vnd.wave" | 822 "audio/vnd.wave" |
821 }; | 823 }; |
822 static const char* const kStandardVideoTypes[] = { | 824 static const char* const kStandardVideoTypes[] = { |
823 "video/avi", | 825 "video/avi", |
824 "video/divx", | 826 "video/divx", |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
995 return CERTIFICATE_MIME_TYPE_UNKNOWN; | 997 return CERTIFICATE_MIME_TYPE_UNKNOWN; |
996 } | 998 } |
997 | 999 |
998 bool IsSupportedCertificateMimeType(const std::string& mime_type) { | 1000 bool IsSupportedCertificateMimeType(const std::string& mime_type) { |
999 CertificateMimeType file_type = | 1001 CertificateMimeType file_type = |
1000 GetCertificateMimeTypeForMimeType(mime_type); | 1002 GetCertificateMimeTypeForMimeType(mime_type); |
1001 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN; | 1003 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN; |
1002 } | 1004 } |
1003 | 1005 |
1004 } // namespace net | 1006 } // namespace net |
OLD | NEW |