OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chromecast/common/media/cast_media_client.h" | 5 #include "chromecast/common/media/cast_media_client.h" |
6 | 6 |
| 7 #include "chromecast/media/base/media_caps.h" |
7 #include "chromecast/media/base/media_codec_support.h" | 8 #include "chromecast/media/base/media_codec_support.h" |
8 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" | 9 #include "chromecast/media/base/supported_codec_profile_levels_memo.h" |
9 #include "chromecast/public/media/media_capabilities_shlib.h" | 10 #include "chromecast/public/media/media_capabilities_shlib.h" |
10 | 11 |
11 // TODO(servolk): Is there a better way to override just IsSupportedVideoConfig | 12 // TODO(servolk): Is there a better way to override just IsSupportedVideoConfig |
12 // without duplicating content::RenderMediaClient implementation? | 13 // without duplicating content::RenderMediaClient implementation? |
13 // For now use this to allow access to the ::media::GetMediaClient. | 14 // For now use this to allow access to the ::media::GetMediaClient. |
14 namespace media { | 15 namespace media { |
15 MEDIA_EXPORT MediaClient* GetMediaClient(); | 16 MEDIA_EXPORT MediaClient* GetMediaClient(); |
16 } | 17 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return supported_profiles_->IsSupportedVideoConfig( | 65 return supported_profiles_->IsSupportedVideoConfig( |
65 ToCastVideoCodec(config.codec, config.profile), | 66 ToCastVideoCodec(config.codec, config.profile), |
66 ToCastVideoProfile(config.profile), config.level); | 67 ToCastVideoProfile(config.profile), config.level); |
67 #else | 68 #else |
68 return MediaCapabilitiesShlib::IsSupportedVideoConfig( | 69 return MediaCapabilitiesShlib::IsSupportedVideoConfig( |
69 ToCastVideoCodec(config.codec, config.profile), | 70 ToCastVideoCodec(config.codec, config.profile), |
70 ToCastVideoProfile(config.profile), config.level); | 71 ToCastVideoProfile(config.profile), config.level); |
71 #endif | 72 #endif |
72 } | 73 } |
73 | 74 |
| 75 bool CastMediaClient::IsSupportedAudioConfig( |
| 76 const ::media::AudioConfig& config) { |
| 77 #if defined(OS_ANDROID) |
| 78 // TODO(sanfin): Implement this for Android. |
| 79 return true; |
| 80 #else |
| 81 AudioCodec codec = ToCastAudioCodec(config.codec); |
| 82 // Cast platform implements software decoding of Opus and FLAC, so only PCM |
| 83 // support is necessary in order to support Opus and FLAC. |
| 84 if (codec == kCodecOpus || codec == kCodecFLAC) |
| 85 codec = kCodecPCM; |
| 86 |
| 87 // If HDMI sink supports AC3/EAC3 codecs then we don't need the vendor backend |
| 88 // to support these codec directly. |
| 89 if (codec == kCodecEAC3 && MediaCapabilities::HdmiSinkSupportsEAC3()) |
| 90 return true; |
| 91 if (codec == kCodecAC3 && MediaCapabilities::HdmiSinkSupportsAC3()) |
| 92 return true; |
| 93 |
| 94 AudioConfig cast_audio_config; |
| 95 cast_audio_config.codec = codec; |
| 96 return MediaCapabilitiesShlib::IsSupportedAudioConfig(cast_audio_config); |
| 97 #endif |
| 98 } |
| 99 |
74 } // namespace media | 100 } // namespace media |
75 } // namespace chromecast | 101 } // namespace chromecast |
OLD | NEW |