Chromium Code Reviews| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 149 (level_idc >= 30 && level_idc <= 32) || | 149 (level_idc >= 30 && level_idc <= 32) || |
| 150 (level_idc >= 40 && level_idc <= 42) || | 150 (level_idc >= 40 && level_idc <= 42) || |
| 151 (level_idc >= 50 && level_idc <= 51)); | 151 (level_idc >= 50 && level_idc <= 51)); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Handle parsing of vp9 codec IDs. | 154 // Handle parsing of vp9 codec IDs. |
| 155 static bool ParseVp9CodecID(const std::string& mime_type_lower_case, | 155 static bool ParseVp9CodecID(const std::string& mime_type_lower_case, |
| 156 const std::string& codec_id, | 156 const std::string& codec_id, |
| 157 VideoCodecProfile* profile) { | 157 VideoCodecProfile* profile) { |
| 158 if (mime_type_lower_case == "video/webm") { | 158 if (mime_type_lower_case == "video/webm") { |
| 159 if (codec_id == "vp9" || codec_id == "vp9.0") { | 159 if (codec_id == "vp9" || codec_id == "vp9.0") { |
|
ddorwin
2016/10/04 00:43:13
This CL does not do what the description says. "vp
| |
| 160 // Profile is not included in the codec string. Assuming profile 0 to be | 160 // Profile is not included in the codec string. Assuming profile 0 to be |
| 161 // backward compatible. | 161 // backward compatible. |
| 162 *profile = VP9PROFILE_PROFILE0; | 162 *profile = VP9PROFILE_PROFILE0; |
| 163 return true; | 163 return true; |
| 164 } | 164 } |
| 165 // TODO(kqyang): Should we support new codec string in WebM? | 165 // TODO(kqyang): Should we support new codec string in WebM? |
| 166 return false; | 166 return false; |
| 167 } else if (mime_type_lower_case == "audio/webm") { | 167 } else if (mime_type_lower_case == "audio/webm") { |
| 168 return false; | 168 return false; |
| 169 } | 169 } |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 711 } | 711 } |
| 712 | 712 |
| 713 if (ParseVp9CodecID(mime_type_lower_case, codec_id, out_profile)) { | 713 if (ParseVp9CodecID(mime_type_lower_case, codec_id, out_profile)) { |
| 714 *codec = MimeUtil::VP9; | 714 *codec = MimeUtil::VP9; |
| 715 *out_level = 1; | 715 *out_level = 1; |
| 716 switch (*out_profile) { | 716 switch (*out_profile) { |
| 717 case VP9PROFILE_PROFILE0: | 717 case VP9PROFILE_PROFILE0: |
| 718 // Profile 0 should always be supported if VP9 is supported. | 718 // Profile 0 should always be supported if VP9 is supported. |
| 719 *is_ambiguous = false; | 719 *is_ambiguous = false; |
| 720 break; | 720 break; |
| 721 #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_ANDROID) | |
|
ddorwin
2016/10/04 00:43:13
Will we not fall back to libvpx on Android if the
ddorwin
2016/10/04 00:43:13
You might mention that this is because libvpx supp
| |
| 722 // Profile 1 & 2 are always supported on X86, at least for | |
|
ddorwin
2016/10/04 00:43:13
Please update the browser tests.
| |
| 723 // unencrypted videos. | |
| 724 case VP9PROFILE_PROFILE1: | |
|
ddorwin
2016/10/04 00:43:13
The description does not cover this.
| |
| 725 case VP9PROFILE_PROFILE2: | |
| 726 if (is_encrypted) | |
| 727 *is_ambiguous = true; | |
| 728 #endif | |
|
ddorwin
2016/10/04 00:43:13
break;
| |
| 721 default: | 729 default: |
| 722 // We don't know if the underlying platform supports these profiles. | 730 // We don't know if the underlying platform supports these profiles. |
| 723 // Need to add platform level querying to get supported profiles | 731 // Need to add platform level querying to get supported profiles |
| 724 // (crbug/604566). | 732 // (crbug/604566). |
| 725 *is_ambiguous = true; | 733 *is_ambiguous = true; |
| 726 } | 734 } |
| 727 return true; | 735 return true; |
| 728 } | 736 } |
| 729 | 737 |
| 730 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) | 738 #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 799 const std::string& mime_type_lower_case, | 807 const std::string& mime_type_lower_case, |
| 800 bool is_encrypted) const { | 808 bool is_encrypted) const { |
| 801 Codec default_codec = Codec::INVALID_CODEC; | 809 Codec default_codec = Codec::INVALID_CODEC; |
| 802 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) | 810 if (!GetDefaultCodecLowerCase(mime_type_lower_case, &default_codec)) |
| 803 return false; | 811 return false; |
| 804 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); | 812 return IsCodecSupported(default_codec, mime_type_lower_case, is_encrypted); |
| 805 } | 813 } |
| 806 | 814 |
| 807 } // namespace internal | 815 } // namespace internal |
| 808 } // namespace media | 816 } // namespace media |
| OLD | NEW |