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 c86dd6f2611925bd011961023840921416f54470..ac1623dbf5fb78408f58c865c62aca8a6faa8a10 100644 |
| --- a/media/base/mime_util_internal.cc |
| +++ b/media/base/mime_util_internal.cc |
| @@ -214,42 +214,6 @@ static bool IsValidH264Level(uint8_t level_idc) { |
| (level_idc >= 50 && level_idc <= 51)); |
| } |
| -#if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| -// ISO/IEC FDIS 14496-15 standard section E.3 describes the syntax of codec ids |
| -// reserved for HEVC. According to that spec HEVC codec id must start with |
| -// either "hev1." or "hvc1.". We don't yet support full parsing of HEVC codec |
| -// ids, but since no other codec id starts with those string we'll just treat |
| -// any string starting with "hev1." or "hvc1." as valid HEVC codec ids. |
| -// crbug.com/482761 |
| -static bool ParseHEVCCodecID(const std::string& codec_id, |
| - MimeUtil::Codec* codec, |
| - bool* is_ambiguous) { |
| - if (base::StartsWith(codec_id, "hev1.", base::CompareCase::SENSITIVE) || |
| - base::StartsWith(codec_id, "hvc1.", base::CompareCase::SENSITIVE)) { |
| - *codec = MimeUtil::HEVC_MAIN; |
| - |
| - // TODO(servolk): Full HEVC codec id parsing is not implemented yet (see |
| - // crbug.com/482761). So treat HEVC codec ids as ambiguous for now. |
| - *is_ambiguous = true; |
| - |
| - // TODO(servolk): Most HEVC codec ids are treated as ambiguous (see above), |
| - // but we need to recognize at least one valid unambiguous HEVC codec id, |
| - // which is added into kMP4VideoCodecsExpression. We need it to be |
| - // unambiguous to avoid DCHECK(!is_ambiguous) in InitializeMimeTypeMaps. We |
| - // also use these in unit tests (see |
| - // content/browser/media/media_canplaytype_browsertest.cc). |
| - // Remove this workaround after crbug.com/482761 is fixed. |
| - if (codec_id == "hev1.1.6.L93.B0" || codec_id == "hvc1.1.6.L93.B0") { |
| - *is_ambiguous = false; |
| - } |
| - |
| - return true; |
| - } |
| - |
| - return false; |
| -} |
| -#endif |
| - |
| MimeUtil::MimeUtil() : allow_proprietary_codecs_(false) { |
| #if defined(OS_ANDROID) |
| platform_info_.is_unified_media_pipeline_enabled = |
| @@ -490,7 +454,7 @@ bool MimeUtil::IsCodecSupportedOnPlatform( |
| DCHECK(!is_encrypted || platform_info.has_platform_decoders); |
| return true; |
| - case HEVC_MAIN: |
| + case HEVC: |
| #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
| if (platform_info.is_unified_media_pipeline_enabled && |
| !platform_info.has_platform_decoders) { |
| @@ -547,15 +511,17 @@ bool MimeUtil::StringToCodec(const std::string& codec_id, |
| // If |codec_id| is not in |string_to_codec_map_|, then we assume that it is |
| // either H.264 or HEVC/H.265 codec ID because currently those are the only |
| // ones that are not added to the |string_to_codec_map_| and require parsing. |
| + VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
| + uint8_t level_idc = 0; |
| #if BUILDFLAG(ENABLE_HEVC_DEMUXING) |
|
ddorwin
2016/04/02 00:09:06
I believe there was a reason this was originally a
servolk
2016/04/02 00:35:04
Yes, we used to have 'return ParseH264CodecId' at
|
| - if (ParseHEVCCodecID(codec_id, codec, is_ambiguous)) { |
| + if (ParseHEVCCodecId(codec_id, &profile, &level_idc)) { |
| + *is_ambiguous = false; |
|
ddorwin
2016/04/02 00:09:06
This assumes that only supported profiles are retu
servolk
2016/04/02 00:35:04
Well, HEVC codec ids contain enough information to
ddorwin
2016/04/02 00:56:09
See above. Ambiguous no longer makes sense, BUT we
ddorwin
2016/04/06 01:43:56
That bug is now fixed, so you don't need to worry
servolk
2016/04/07 00:59:40
Done.
|
| + *codec = MimeUtil::HEVC; |
| return true; |
| } |
| #endif |
| - VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
| - uint8_t level_idc = 0; |
| if (ParseAVCCodecId(codec_id, &profile, &level_idc)) { |
| *codec = MimeUtil::H264; |
| *is_ambiguous = |
| @@ -593,7 +559,7 @@ bool MimeUtil::IsCodecProprietary(Codec codec) const { |
| case MPEG2_AAC: |
| case MPEG4_AAC: |
| case H264: |
| - case HEVC_MAIN: |
| + case HEVC: |
| return true; |
| case PCM: |