Index: media/base/mime_util_internal.cc |
diff --git a/media/base/mime_util_internal.cc b/media/base/mime_util_internal.cc |
index 031d548c7ced5e5e9b85f3f1d36481a2d751d4e7..419c409ad0449aa4bb25dbdecad929490d513db7 100644 |
--- a/media/base/mime_util_internal.cc |
+++ b/media/base/mime_util_internal.cc |
@@ -200,6 +200,8 @@ VideoCodec MimeUtilToVideoCodec(MimeUtil::Codec codec) { |
return kCodecVP9; |
case MimeUtil::THEORA: |
return kCodecTheora; |
+ case MimeUtil::DolbyVision: |
+ return kCodecDolbyVision; |
default: |
break; |
} |
@@ -317,6 +319,9 @@ void MimeUtil::AddSupportedMediaFormats() { |
// Only VP9 with valid codec string vp09.xx.xx.xx.xx.xx.xx.xx is supported. |
// See ParseVp9CodecID for details. |
mp4_video_codecs.insert(VP9); |
+#if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
+ mp4_video_codecs.insert(DolbyVision); |
+#endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
CodecSet mp4_codecs(mp4_audio_codecs); |
mp4_codecs.insert(mp4_video_codecs.begin(), mp4_video_codecs.end()); |
#endif // defined(USE_PROPRIETARY_CODECS) |
@@ -582,6 +587,19 @@ bool MimeUtil::IsCodecSupportedOnPlatform( |
// MediaPlayer only supports VP9 in WebM. |
return mime_type_lower_case == "video/webm"; |
} |
wolenetz
2017/01/25 23:42:41
code formatting seems inconsistent here.
The VP9 c
erickung1
2017/02/03 18:18:31
Done.
|
+ |
+ return false; |
wolenetz
2017/01/25 23:42:40
l.588 returns already. this line should never be r
erickung1
2017/02/03 18:18:31
Done.
|
+ |
+ case DolbyVision: |
+#if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) && !defined(OS_ANDROID) |
+ if (platform_info.is_unified_media_pipeline_enabled && |
+ !platform_info.has_platform_decoders) { |
+ return false; |
+ } |
+ return true; |
+#else |
+ return false; |
+#endif // BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) && !defined(OS_ANDROID) |
} |
return false; |
@@ -663,6 +681,14 @@ bool MimeUtil::StringToCodec(const std::string& mime_type_lower_case, |
} |
#endif |
+#if BUILDFLAG(ENABLE_DOLBY_VISION_DEMUXING) |
+ if (ParseDolbyVisionCodecId(codec_id, out_profile, out_level)) { |
+ *codec = MimeUtil::DolbyVision; |
+ *is_ambiguous = false; |
+ return true; |
+ } |
+#endif |
+ |
DVLOG(4) << __func__ << ": Unrecognized codec id " << codec_id; |
return false; |
} |
@@ -692,6 +718,7 @@ bool MimeUtil::IsCodecProprietary(Codec codec) const { |
case MPEG4_AAC: |
case H264: |
case HEVC: |
+ case DolbyVision: |
return true; |
case PCM: |