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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 default: | 703 default: |
704 ambiguous_platform_support = true; | 704 ambiguous_platform_support = true; |
705 } | 705 } |
706 } else if (codec == MimeUtil::VP9 && video_profile != VP9PROFILE_PROFILE0) { | 706 } else if (codec == MimeUtil::VP9 && video_profile != VP9PROFILE_PROFILE0) { |
707 // We don't know if the underlying platform supports these profiles. Need | 707 // We don't know if the underlying platform supports these profiles. Need |
708 // to add platform level querying to get supported profiles. | 708 // to add platform level querying to get supported profiles. |
709 // https://crbug.com/604566 | 709 // https://crbug.com/604566 |
710 ambiguous_platform_support = true; | 710 ambiguous_platform_support = true; |
711 } | 711 } |
712 | 712 |
713 if (GetMediaClient() && video_codec != kUnknownVideoCodec && | 713 if (video_codec != kUnknownVideoCodec) { |
714 !GetMediaClient()->IsSupportedVideoConfig( | 714 VideoConfig video_config = {video_codec, video_profile, video_level, |
715 {video_codec, video_profile, video_level, color_space})) { | 715 color_space}; |
716 return IsNotSupported; | 716 |
| 717 // If MediaClient is provided use it to check for decoder support. |
| 718 MediaClient* media_client = GetMediaClient(); |
| 719 if (media_client && !media_client->IsSupportedVideoConfig(video_config)) |
| 720 return IsNotSupported; |
| 721 |
| 722 // When no MediaClient is provided, assume default decoders are available |
| 723 // as described by media::IsSupportedVideoConfig(). |
| 724 if (!media_client && !IsSupportedVideoConfig(video_config)) |
| 725 return IsNotSupported; |
717 } | 726 } |
718 | 727 |
719 #if defined(OS_ANDROID) | 728 #if defined(OS_ANDROID) |
720 // TODO(chcunningham): Delete this. Android platform support should be | 729 // TODO(chcunningham): Delete this. Android platform support should be |
721 // handled by (android specific) MediaClient. | 730 // handled by (android specific) media::IsSupportedVideoConfig() above. |
722 if (!IsCodecSupportedOnAndroid(codec, mime_type_lower_case, is_encrypted, | 731 if (!IsCodecSupportedOnAndroid(codec, mime_type_lower_case, is_encrypted, |
723 platform_info_)) { | 732 platform_info_)) { |
724 return IsNotSupported; | 733 return IsNotSupported; |
725 } | 734 } |
726 #endif | 735 #endif |
727 | 736 |
728 return ambiguous_platform_support ? MayBeSupported : IsSupported; | 737 return ambiguous_platform_support ? MayBeSupported : IsSupported; |
729 } | 738 } |
730 | 739 |
731 bool MimeUtil::IsCodecProprietary(Codec codec) const { | 740 bool MimeUtil::IsCodecProprietary(Codec codec) const { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, | 787 SupportsType MimeUtil::IsDefaultCodecSupported(const std::string& mime_type, |
779 bool is_encrypted) const { | 788 bool is_encrypted) const { |
780 Codec default_codec = Codec::INVALID_CODEC; | 789 Codec default_codec = Codec::INVALID_CODEC; |
781 if (!GetDefaultCodec(mime_type, &default_codec)) | 790 if (!GetDefaultCodec(mime_type, &default_codec)) |
782 return IsNotSupported; | 791 return IsNotSupported; |
783 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); | 792 return IsSimpleCodecSupported(mime_type, default_codec, is_encrypted); |
784 } | 793 } |
785 | 794 |
786 } // namespace internal | 795 } // namespace internal |
787 } // namespace media | 796 } // namespace media |
OLD | NEW |