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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 | 472 |
473 // NOTE: We do not account for Media Source Extensions (MSE) within these | 473 // NOTE: We do not account for Media Source Extensions (MSE) within these |
474 // checks since it has its own isTypeSupported() which will handle platform | 474 // checks since it has its own isTypeSupported() which will handle platform |
475 // specific codec rejections. See http://crbug.com/587303. | 475 // specific codec rejections. See http://crbug.com/587303. |
476 | 476 |
477 switch (codec) { | 477 switch (codec) { |
478 // ---------------------------------------------------------------------- | 478 // ---------------------------------------------------------------------- |
479 // The following codecs are never supported. | 479 // The following codecs are never supported. |
480 // ---------------------------------------------------------------------- | 480 // ---------------------------------------------------------------------- |
481 case INVALID_CODEC: | 481 case INVALID_CODEC: |
482 case AC3: | |
483 case EAC3: | |
484 case THEORA: | 482 case THEORA: |
485 return false; | 483 return false; |
486 | 484 |
487 // ---------------------------------------------------------------------- | 485 // ---------------------------------------------------------------------- |
488 // The remaining codecs may be supported depending on platform abilities. | 486 // The remaining codecs may be supported depending on platform abilities. |
489 // ---------------------------------------------------------------------- | 487 // ---------------------------------------------------------------------- |
490 | 488 |
491 case PCM: | 489 case PCM: |
492 case MP3: | 490 case MP3: |
493 case MPEG4_AAC: | 491 case MPEG4_AAC: |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 if (!platform_info.has_platform_vp9_decoder) | 573 if (!platform_info.has_platform_vp9_decoder) |
576 return false; | 574 return false; |
577 | 575 |
578 // Encrypted content is demuxed so the container is irrelevant. | 576 // Encrypted content is demuxed so the container is irrelevant. |
579 if (is_encrypted) | 577 if (is_encrypted) |
580 return true; | 578 return true; |
581 | 579 |
582 // MediaPlayer only supports VP9 in WebM. | 580 // MediaPlayer only supports VP9 in WebM. |
583 return mime_type_lower_case == "video/webm"; | 581 return mime_type_lower_case == "video/webm"; |
584 } | 582 } |
| 583 |
| 584 case AC3: |
| 585 case EAC3: |
| 586 #if BUILDFLAG(ENABLE_AC3_EAC3_AUDIO_DEMUXING) |
| 587 return true; |
| 588 #else |
| 589 return false; |
| 590 #endif |
585 } | 591 } |
586 | 592 |
587 return false; | 593 return false; |
588 } | 594 } |
589 | 595 |
590 bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, | 596 bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, |
591 const std::string& codec_id, | 597 const std::string& codec_id, |
592 Codec* codec, | 598 Codec* codec, |
593 bool* is_ambiguous, | 599 bool* is_ambiguous, |
594 VideoCodecProfile* out_profile, | 600 VideoCodecProfile* out_profile, |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 const std::string& mime_type_lower_case, | 739 const std::string& mime_type_lower_case, |
734 bool is_encrypted) const { | 740 bool is_encrypted) const { |
735 Codec default_codec = Codec::INVALID_CODEC; | 741 Codec default_codec = Codec::INVALID_CODEC; |
736 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 742 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
737 return false; | 743 return false; |
738 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 744 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
739 } | 745 } |
740 | 746 |
741 } // namespace internal | 747 } // namespace internal |
742 } // namespace media | 748 } // namespace media |
OLD | NEW |