Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(892)

Unified Diff: chromecast/media/base/media_codec_support.cc

Issue 2640113004: Introduce Dolby Vision video codec and Demuxer support (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/media/base/media_codec_support.cc
diff --git a/chromecast/media/base/media_codec_support.cc b/chromecast/media/base/media_codec_support.cc
index 8a5965956ac8fc1c8bd43a7dd06c7fec37c28415..cf6e6d62d6d2c99afc29fdbbf284850ce4cdbe06 100644
--- a/chromecast/media/base/media_codec_support.cc
+++ b/chromecast/media/base/media_codec_support.cc
@@ -35,6 +35,12 @@ bool IsCodecSupported(const std::string& codec) {
if (codec == "ec-3" || codec == "mp4a.a6" || codec == "mp4a.A6") {
return MediaCapabilities::HdmiSinkSupportsEAC3();
}
+ // Shared library should return kDefault if the platform depends on sink
wolenetz 2017/01/24 21:52:23 Is kDefault a bool? Or am I confused by this comme
erickung1 2017/02/03 18:18:30 Done.
+ // device capability to stream Dolby Vision.
+ if (base::StartsWith(codec, "dvav.", base::CompareCase::SENSITIVE) ||
+ base::StartsWith(codec, "dvhe.", base::CompareCase::SENSITIVE)) {
+ return MediaCapabilities::HdmiSinkSupportsDolbyVision();
+ }
// This function is invoked from MimeUtil::AreSupportedCodecs to check if a
// given codec id is supported by Chromecast or not. So by default we should
@@ -52,7 +58,8 @@ bool IsCodecSupported(const std::string& codec) {
// Converts ::media::VideoCodec to chromecast::media::VideoCodec. Any unknown or
wolenetz 2017/01/24 21:52:24 comments like this belong in .h instead of .cc Als
erickung1 2017/02/03 18:18:30 Done.
// unsupported codec will be converted to chromecast::media::kCodecUnknown.
-VideoCodec ToCastVideoCodec(const ::media::VideoCodec video_codec) {
+VideoCodec ToCastVideoCodec(const ::media::VideoCodec video_codec,
+ const ::media::VideoCodecProfile codec_profile) {
switch (video_codec) {
case ::media::kCodecH264:
return kCodecH264;
@@ -62,6 +69,15 @@ VideoCodec ToCastVideoCodec(const ::media::VideoCodec video_codec) {
return kCodecVP9;
case ::media::kCodecHEVC:
return kCodecHEVC;
+ case ::media::kCodecDolbyVision:
+ if (codec_profile == ::media::DOLBYVISION_PROFILE0)
wolenetz 2017/01/24 21:52:24 I'm unfamiliar with DV profiles, but compared to p
erickung1 2017/02/03 18:18:30 Yes, for the latest DV spec from Dolby, profile 1
+ return kCodecDolbyVisionH264;
+ else if (codec_profile == ::media::DOLBYVISION_PROFILE4 ||
wolenetz 2017/01/24 21:52:24 Ditto: is omission of check for DV profiles 3 and
erickung1 2017/02/03 18:18:31 ditto, the profile 3 and 6 will deprecated.
+ codec_profile == ::media::DOLBYVISION_PROFILE5 ||
+ codec_profile == ::media::DOLBYVISION_PROFILE7)
halliwell 2017/01/20 02:05:04 nit, prefer braces { } for multi-line conditions
wolenetz 2017/01/24 21:52:23 Chromium definitely needs { } here.
erickung1 2017/02/03 18:18:31 Done.
+ return kCodecDolbyVisionHEVC;
+ LOG(ERROR) << "Unsupported video codec profile " << codec_profile;
+ break;
default:
LOG(ERROR) << "Unsupported video codec " << video_codec;
}
@@ -110,6 +126,14 @@ VideoProfile ToCastVideoProfile(
return kVP9Profile2;
case ::media::VP9PROFILE_PROFILE3:
return kVP9Profile3;
+ case ::media::DOLBYVISION_PROFILE0:
wolenetz 2017/01/24 21:52:24 (Ditto of above query about intentionality of omis
erickung1 2017/02/03 18:18:30 as mentioned above, profile 1 2 3 and 6 are deprec
+ return kDolbyVisionCompatible_EL_MD;
+ case ::media::DOLBYVISION_PROFILE4:
+ return kDolbyVisionCompatible_EL_MD;
+ case ::media::DOLBYVISION_PROFILE5:
+ return kDolbyVisionNonCompatible_BL_MD;
+ case ::media::DOLBYVISION_PROFILE7:
+ return kDolbyVisionNonCompatible_BL_EL_MD;
default:
LOG(INFO) << "Unsupported video codec profile " << codec_profile;
}

Powered by Google App Engine
This is Rietveld 408576698