Chromium Code Reviews| Index: chromecast/common/media/cast_media_client.cc |
| diff --git a/chromecast/common/media/cast_media_client.cc b/chromecast/common/media/cast_media_client.cc |
| index f291babb7057be9ba0a02b61e105c8194bd84ac1..4a0b696e8d5f11d9c77a1e1ce3e1942d6d5053fc 100644 |
| --- a/chromecast/common/media/cast_media_client.cc |
| +++ b/chromecast/common/media/cast_media_client.cc |
| @@ -4,6 +4,7 @@ |
| #include "chromecast/common/media/cast_media_client.h" |
| +#include "chromecast/media/base/media_caps.h" |
| #include "chromecast/media/base/media_codec_support.h" |
| #include "chromecast/media/base/supported_codec_profile_levels_memo.h" |
| #include "chromecast/public/media/media_capabilities_shlib.h" |
| @@ -71,5 +72,30 @@ bool CastMediaClient::IsSupportedVideoConfig( |
| #endif |
| } |
| +bool CastMediaClient::IsSupportedAudioConfig( |
| + const ::media::AudioConfig& config) { |
| +#if defined(OS_ANDROID) |
| + // TODO(sanfin): Implement this for Android. |
|
gfhuang
2017/03/29 20:54:59
Open a bug to sanfin@ so that this doesn't fall th
servolk
2017/03/29 21:51:52
Done (b/36734043).
I think it's pretty obvious in
|
| + return true; |
| +#else |
| + AudioCodec codec = ToCastAudioCodec(config.codec); |
| + // Cast platform implements software decoding of Opus and FLAC, so only PCM |
| + // support is necessary in order to support Opus and FLAC. |
| + if (codec == kCodecOpus || codec == kCodecFLAC) |
| + codec = kCodecPCM; |
| + |
| + // If HDMI sink supports AC3/EAC3 codecs then we don't need the vendor backend |
| + // to support these codec directly. |
| + if (codec == kCodecEAC3 && MediaCapabilities::HdmiSinkSupportsEAC3()) |
|
gfhuang
2017/03/29 20:54:58
is this defaults to true for non-HDMI TV device?
servolk
2017/03/29 21:51:52
No, this is solely for HDMI devices. TVs that supp
gfhuang
2017/03/29 21:57:28
I see. then please double-check
MediaCapabilities:
|
| + return true; |
| + if (codec == kCodecAC3 && MediaCapabilities::HdmiSinkSupportsAC3()) |
| + return true; |
| + |
| + AudioConfig cast_audio_config; |
| + cast_audio_config.codec = codec; |
| + return MediaCapabilitiesShlib::IsSupportedAudioConfig(cast_audio_config); |
| +#endif |
| +} |
| + |
| } // namespace media |
| } // namespace chromecast |