| 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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 | 546 |
| 547 // NOTE: We do not account for Media Source Extensions (MSE) within these | 547 // NOTE: We do not account for Media Source Extensions (MSE) within these |
| 548 // checks since it has its own isTypeSupported() which will handle platform | 548 // checks since it has its own isTypeSupported() which will handle platform |
| 549 // specific codec rejections. See http://crbug.com/587303. | 549 // specific codec rejections. See http://crbug.com/587303. |
| 550 | 550 |
| 551 switch (codec) { | 551 switch (codec) { |
| 552 // ---------------------------------------------------------------------- | 552 // ---------------------------------------------------------------------- |
| 553 // The following codecs are never supported. | 553 // The following codecs are never supported. |
| 554 // ---------------------------------------------------------------------- | 554 // ---------------------------------------------------------------------- |
| 555 case INVALID_CODEC: | 555 case INVALID_CODEC: |
| 556 case AC3: | |
| 557 case EAC3: | |
| 558 case THEORA: | 556 case THEORA: |
| 559 return false; | 557 return false; |
| 560 | 558 |
| 561 // ---------------------------------------------------------------------- | 559 // ---------------------------------------------------------------------- |
| 562 // The remaining codecs may be supported depending on platform abilities. | 560 // The remaining codecs may be supported depending on platform abilities. |
| 563 // ---------------------------------------------------------------------- | 561 // ---------------------------------------------------------------------- |
| 564 | 562 |
| 565 case PCM: | 563 case PCM: |
| 566 case MP3: | 564 case MP3: |
| 567 case MPEG4_AAC: | 565 case MPEG4_AAC: |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 if (!platform_info.has_platform_vp9_decoder) | 646 if (!platform_info.has_platform_vp9_decoder) |
| 649 return false; | 647 return false; |
| 650 | 648 |
| 651 // Encrypted content is demuxed so the container is irrelevant. | 649 // Encrypted content is demuxed so the container is irrelevant. |
| 652 if (is_encrypted) | 650 if (is_encrypted) |
| 653 return true; | 651 return true; |
| 654 | 652 |
| 655 // MediaPlayer only supports VP9 in WebM. | 653 // MediaPlayer only supports VP9 in WebM. |
| 656 return mime_type_lower_case == "video/webm"; | 654 return mime_type_lower_case == "video/webm"; |
| 657 } | 655 } |
| 656 |
| 657 case AC3: |
| 658 case EAC3: |
| 659 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 660 return true; |
| 661 #else |
| 662 return false; |
| 663 #endif |
| 658 } | 664 } |
| 659 | 665 |
| 660 return false; | 666 return false; |
| 661 } | 667 } |
| 662 | 668 |
| 663 bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, | 669 bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, |
| 664 const std::string& codec_id, | 670 const std::string& codec_id, |
| 665 Codec* codec, | 671 Codec* codec, |
| 666 bool* is_ambiguous, | 672 bool* is_ambiguous, |
| 667 VideoCodecProfile* out_profile, | 673 VideoCodecProfile* out_profile, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 const std::string& mime_type_lower_case, | 805 const std::string& mime_type_lower_case, |
| 800 bool is_encrypted) const { | 806 bool is_encrypted) const { |
| 801 Codec default_codec = Codec::INVALID_CODEC; | 807 Codec default_codec = Codec::INVALID_CODEC; |
| 802 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 808 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
| 803 return false; | 809 return false; |
| 804 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 810 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
| 805 } | 811 } |
| 806 | 812 |
| 807 } // namespace internal | 813 } // namespace internal |
| 808 } // namespace media | 814 } // namespace media |
| OLD | NEW |