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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 "opus", |
312 "vp8", | 312 "vp8", |
313 "vp9", | |
scherkus (not reviewing)
2012/12/14 21:32:41
technically this should only be here when enabled
Tom Finegan
2012/12/15 06:13:30
Removed changes in this file per offline discussio
| |
313 "1" // WAVE_FORMAT_PCM. | 314 "1" // WAVE_FORMAT_PCM. |
314 }; | 315 }; |
315 | 316 |
316 // List of proprietary codecs only supported by Google Chrome. | 317 // List of proprietary codecs only supported by Google Chrome. |
317 static const char* const proprietary_media_codecs[] = { | 318 static const char* const proprietary_media_codecs[] = { |
318 "avc1", | 319 "avc1", |
319 "mp4a" | 320 "mp4a" |
320 }; | 321 }; |
321 | 322 |
322 // Note: does not include javascript types list (see supported_javascript_types) | 323 // Note: does not include javascript types list (see supported_javascript_types) |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
415 "application/atom+xml", | 416 "application/atom+xml", |
416 "image/svg+xml" | 417 "image/svg+xml" |
417 }; | 418 }; |
418 | 419 |
419 struct MediaFormatStrict { | 420 struct MediaFormatStrict { |
420 const char* mime_type; | 421 const char* mime_type; |
421 const char* codecs_list; | 422 const char* codecs_list; |
422 }; | 423 }; |
423 | 424 |
424 static const MediaFormatStrict format_codec_mappings[] = { | 425 static const MediaFormatStrict format_codec_mappings[] = { |
425 { "video/webm", "vorbis,opus,vp8,vp8.0" }, | 426 { "video/webm", "vorbis,opus,vp8,vp8.0,vp9,vp9.0" }, |
scherkus (not reviewing)
2012/12/14 21:32:41
ditto
Tom Finegan
2012/12/15 06:13:30
Removed changes in this file per offline discussio
| |
426 { "audio/webm", "vorbis,opus" }, | 427 { "audio/webm", "vorbis,opus" }, |
427 { "audio/wav", "1" } | 428 { "audio/wav", "1" } |
428 }; | 429 }; |
429 | 430 |
430 MimeUtil::MimeUtil() { | 431 MimeUtil::MimeUtil() { |
431 InitializeMimeTypeMaps(); | 432 InitializeMimeTypeMaps(); |
432 } | 433 } |
433 | 434 |
434 // static | 435 // static |
435 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, | 436 bool MimeUtil::AreSupportedCodecs(const MimeMappings& supported_codecs, |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
997 return CERTIFICATE_MIME_TYPE_UNKNOWN; | 998 return CERTIFICATE_MIME_TYPE_UNKNOWN; |
998 } | 999 } |
999 | 1000 |
1000 bool IsSupportedCertificateMimeType(const std::string& mime_type) { | 1001 bool IsSupportedCertificateMimeType(const std::string& mime_type) { |
1001 CertificateMimeType file_type = | 1002 CertificateMimeType file_type = |
1002 GetCertificateMimeTypeForMimeType(mime_type); | 1003 GetCertificateMimeTypeForMimeType(mime_type); |
1003 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN; | 1004 return file_type != CERTIFICATE_MIME_TYPE_UNKNOWN; |
1004 } | 1005 } |
1005 | 1006 |
1006 } // namespace net | 1007 } // namespace net |
OLD | NEW |