Chromium Code Reviews| Index: media/base/mime_util_internal.cc |
| diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc |
| index b2904e8764d39bbc885ffed536481feb6cd3b7da..f7883e0d95044318f12c5da197970086a20b5fb6 100644 |
| --- a/media/base/mime_util_internal.cc |
| +++ b/media/base/mime_util_internal.cc |
| @@ -281,7 +281,7 @@ SupportsType MimeUtil::AreSupportedCodecs( |
| for (size_t i = 0; i < codecs.size(); ++i) { |
| bool is_ambiguous = true; |
| Codec codec = INVALID_CODEC; |
| - if (!StringToCodec(codecs[i], &codec, &is_ambiguous)) |
| + if (!StringToCodec(codecs[i], &codec, &is_ambiguous, is_encrypted)) |
| return IsNotSupported; |
| if (!IsCodecSupported(codec, mime_type_lower_case, is_encrypted) || |
| @@ -322,7 +322,7 @@ void MimeUtil::InitializeMimeTypeMaps() { |
| for (size_t j = 0; j < mime_type_codecs.size(); ++j) { |
| Codec codec = INVALID_CODEC; |
| bool is_ambiguous = true; |
| - CHECK(StringToCodec(mime_type_codecs[j], &codec, &is_ambiguous)); |
| + CHECK(StringToCodec(mime_type_codecs[j], &codec, &is_ambiguous, false)); |
| DCHECK(!is_ambiguous); |
| codecs.insert(codec); |
| } |
| @@ -531,7 +531,8 @@ bool MimeUtil::IsCodecSupportedOnPlatform( |
| bool MimeUtil::StringToCodec(const std::string& codec_id, |
| Codec* codec, |
| - bool* is_ambiguous) const { |
| + bool* is_ambiguous, |
| + bool is_encrypted) const { |
| StringToCodecMappings::const_iterator itr = |
| string_to_codec_map_.find(codec_id); |
| if (itr != string_to_codec_map_.end()) { |
| @@ -554,10 +555,28 @@ bool MimeUtil::StringToCodec(const std::string& codec_id, |
| uint8_t level_idc = 0; |
| if (ParseAVCCodecId(codec_id, &profile, &level_idc)) { |
| *codec = MimeUtil::H264; |
| - *is_ambiguous = |
| - (profile != H264PROFILE_BASELINE && profile != H264PROFILE_MAIN && |
| - profile != H264PROFILE_HIGH) || |
| - !IsValidH264Level(level_idc); |
| + switch (profile) { |
| +// HIGH10PROFILE is supported through fallback to the ffmpeg decoder. |
|
ddorwin
2016/03/31 22:31:12
nit: , which
hubbe
2016/04/01 00:20:59
Done.
|
| +// Which is not available on Android, chromium builds or if |
|
ddorwin
2016/03/31 22:31:12
Chromium is irrelevant to this (that's handled els
hubbe
2016/04/01 00:20:58
Done.
|
| +// FFMPEG has been disabled. |
|
ddorwin
2016/03/31 22:31:12
nit suggestion: s/has been disabled/is not used/.
hubbe
2016/04/01 00:20:59
Done.
|
| +#if !defined(MEDIA_DISABLE_FFMPEG) && !defined(OS_ANDROID) |
|
ddorwin
2016/03/31 22:31:12
:) +dalecurtis to confirm this logic.
We should p
DaleCurtis
2016/03/31 22:58:44
this is correct. android doesn't have ff_h264.
hubbe
2016/04/01 00:20:59
Acknowledged.
hubbe
2016/04/01 00:20:59
Acknowledged.
|
| + case H264PROFILE_HIGH10PROFILE: |
|
ddorwin
2016/03/31 22:31:12
It might be nicer to always have this case and put
hubbe
2016/04/01 00:20:58
Tried it, but I didn't like how it turned out.
|
| + if (is_encrypted) { |
| + // Currently we do not support EME on 10-bit videos. |
|
ddorwin
2016/03/31 22:31:12
More accurately, especially since we don't return
hubbe
2016/04/01 00:20:59
Done.
|
| + *is_ambiguous = true; |
| + break; |
| + } |
|
ddorwin
2016/03/31 22:31:12
Add an explicit comment to "fall through" so it's
hubbe
2016/04/01 00:20:59
Done.
|
| +#endif |
| + |
| + case H264PROFILE_BASELINE: |
| + case H264PROFILE_MAIN: |
| + case H264PROFILE_HIGH: |
| + |
| + *is_ambiguous = !IsValidH264Level(level_idc); |
| + break; |
| + default: |
| + *is_ambiguous = true; |
| + } |
| return true; |
| } |