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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
594 // MediaPlayer does not support Opus in ogg containers. | 594 // MediaPlayer does not support Opus in ogg containers. |
595 if (base::EndsWith(mime_type_lower_case, "ogg", | 595 if (base::EndsWith(mime_type_lower_case, "ogg", |
596 base::CompareCase::SENSITIVE)) { | 596 base::CompareCase::SENSITIVE)) { |
597 return false; | 597 return false; |
598 } | 598 } |
599 | 599 |
600 DCHECK(!is_encrypted || platform_info.has_platform_decoders); | 600 DCHECK(!is_encrypted || platform_info.has_platform_decoders); |
601 return true; | 601 return true; |
602 | 602 |
603 case H264: | 603 case H264: |
604 // The unified pipeline requires platform support for h264. | 604 // When content is not encrypted we fall back to MediaPlayer, thus we |
605 if (platform_info.is_unified_media_pipeline_enabled) | 605 // always support H264. For EME we need MediaCodec. |
606 return platform_info.has_platform_decoders; | 606 return !is_encrypted || platform_info.has_platform_decoders; |
607 | |
608 // When MediaPlayer or MediaCodec is used, h264 is always supported. | |
609 DCHECK(!is_encrypted || platform_info.has_platform_decoders); | |
610 return true; | |
611 | 607 |
612 case HEVC: | 608 case HEVC: |
613 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 609 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
614 if (platform_info.is_unified_media_pipeline_enabled && | 610 if (platform_info.is_unified_media_pipeline_enabled && |
615 !platform_info.has_platform_decoders) { | 611 !platform_info.has_platform_decoders) { |
616 return false; | 612 return false; |
617 } | 613 } |
618 | 614 |
619 #if defined(OS_ANDROID) | 615 #if defined(OS_ANDROID) |
620 // HEVC/H.265 is supported in Lollipop+ (API Level 21), according to | 616 // HEVC/H.265 is supported in Lollipop+ (API Level 21), according to |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 const std::string& mime_type_lower_case, | 799 const std::string& mime_type_lower_case, |
804 bool is_encrypted) const { | 800 bool is_encrypted) const { |
805 Codec default_codec = Codec::INVALID_CODEC; | 801 Codec default_codec = Codec::INVALID_CODEC; |
806 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 802 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
807 return false; | 803 return false; |
808 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 804 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
809 } | 805 } |
810 | 806 |
811 } // namespace internal | 807 } // namespace internal |
812 } // namespace media | 808 } // namespace media |
OLD | NEW |