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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 // NOTE: We do not account for Media Source Extensions (MSE) within these | 478 // NOTE: We do not account for Media Source Extensions (MSE) within these |
479 // checks since it has its own isTypeSupported() which will handle platform | 479 // checks since it has its own isTypeSupported() which will handle platform |
480 // specific codec rejections. See http://crbug.com/587303. | 480 // specific codec rejections. See http://crbug.com/587303. |
481 | 481 |
482 switch (codec) { | 482 switch (codec) { |
483 // ---------------------------------------------------------------------- | 483 // ---------------------------------------------------------------------- |
484 // The following codecs are never supported. | 484 // The following codecs are never supported. |
485 // ---------------------------------------------------------------------- | 485 // ---------------------------------------------------------------------- |
486 case INVALID_CODEC: | 486 case INVALID_CODEC: |
487 case AC3: | |
488 case EAC3: | |
489 case THEORA: | 487 case THEORA: |
490 return false; | 488 return false; |
491 | 489 |
492 // ---------------------------------------------------------------------- | 490 // ---------------------------------------------------------------------- |
493 // The remaining codecs may be supported depending on platform abilities. | 491 // The remaining codecs may be supported depending on platform abilities. |
494 // ---------------------------------------------------------------------- | 492 // ---------------------------------------------------------------------- |
495 | 493 |
496 case PCM: | 494 case PCM: |
497 case MP3: | 495 case MP3: |
498 case MPEG4_AAC: | 496 case MPEG4_AAC: |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 return true; | 581 return true; |
584 | 582 |
585 // MediaPlayer only supports VP9 in WebM. | 583 // MediaPlayer only supports VP9 in WebM. |
586 return mime_type_lower_case == "video/webm"; | 584 return mime_type_lower_case == "video/webm"; |
587 } | 585 } |
588 | 586 |
589 case DOLBY_VISION: | 587 case DOLBY_VISION: |
590 // This function is only called on Android which doesn't support Dolby | 588 // This function is only called on Android which doesn't support Dolby |
591 // Vision. | 589 // Vision. |
592 return false; | 590 return false; |
| 591 |
| 592 case AC3: |
| 593 case EAC3: |
| 594 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 595 return true; |
| 596 #else |
| 597 return false; |
| 598 #endif |
593 } | 599 } |
594 | 600 |
595 return false; | 601 return false; |
596 } | 602 } |
597 | 603 |
598 bool MimeUtil::ParseCodecString(const std::string& mime_type_lower_case, | 604 bool MimeUtil::ParseCodecString(const std::string& mime_type_lower_case, |
599 const std::string& codec_id, | 605 const std::string& codec_id, |
600 Codec* codec, | 606 Codec* codec, |
601 bool* ambiguous_codec_string, | 607 bool* ambiguous_codec_string, |
602 VideoCodecProfile* out_profile, | 608 VideoCodecProfile* out_profile, |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, | 842 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, |
837 bool is_encrypted) const { | 843 bool is_encrypted) const { |
838 Codec default_codec = Codec::INVALID_CODEC; | 844 Codec default_codec = Codec::INVALID_CODEC; |
839 if (!GetDefaultCodec(mime_type, &default_codec)) | 845 if (!GetDefaultCodec(mime_type, &default_codec)) |
840 return IsNotSupported; | 846 return IsNotSupported; |
841 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); | 847 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); |
842 } | 848 } |
843 | 849 |
844 } // namespace internal | 850 } // namespace internal |
845 } // namespace media | 851 } // namespace media |
OLD | NEW |