| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer/cast_content_renderer_client.h" | 5 #include "chromecast/renderer/cast_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 std::vector<std::unique_ptr<::media::KeySystemProperties>>* | 111 std::vector<std::unique_ptr<::media::KeySystemProperties>>* |
| 112 key_systems_properties) { | 112 key_systems_properties) { |
| 113 media::AddChromecastKeySystems(key_systems_properties, | 113 media::AddChromecastKeySystems(key_systems_properties, |
| 114 false /* enable_persistent_license_support */, | 114 false /* enable_persistent_license_support */, |
| 115 false /* force_software_crypto */); | 115 false /* force_software_crypto */); |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool CastContentRendererClient::IsSupportedAudioConfig( | 118 bool CastContentRendererClient::IsSupportedAudioConfig( |
| 119 const ::media::AudioConfig& config) { | 119 const ::media::AudioConfig& config) { |
| 120 #if defined(OS_ANDROID) | 120 #if defined(OS_ANDROID) |
| 121 media::AudioCodec codec = media::ToCastAudioCodec(config.codec); |
| 122 |
| 123 // No ATV device we know of has (E)AC3 decoder, so it relies on the audio sink |
| 124 // device. |
| 125 if (codec == media::kCodecEAC3) |
| 126 return media::MediaCapabilities::HdmiSinkSupportsEAC3(); |
| 127 if (codec == media::kCodecAC3) |
| 128 return media::MediaCapabilities::HdmiSinkSupportsAC3(); |
| 129 |
| 121 // TODO(sanfin): Implement this for Android. | 130 // TODO(sanfin): Implement this for Android. |
| 122 return true; | 131 return true; |
| 123 #else | 132 #else |
| 124 media::AudioCodec codec = media::ToCastAudioCodec(config.codec); | 133 media::AudioCodec codec = media::ToCastAudioCodec(config.codec); |
| 125 // Cast platform implements software decoding of Opus and FLAC, so only PCM | 134 // Cast platform implements software decoding of Opus and FLAC, so only PCM |
| 126 // support is necessary in order to support Opus and FLAC. | 135 // support is necessary in order to support Opus and FLAC. |
| 127 if (codec == media::kCodecOpus || codec == media::kCodecFLAC) | 136 if (codec == media::kCodecOpus || codec == media::kCodecFLAC) |
| 128 codec = media::kCodecPCM; | 137 codec = media::kCodecPCM; |
| 129 | 138 |
| 130 // If HDMI sink supports AC3/EAC3 codecs then we don't need the vendor backend | 139 // If HDMI sink supports AC3/EAC3 codecs then we don't need the vendor backend |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 } | 200 } |
| 192 | 201 |
| 193 void CastContentRendererClient:: | 202 void CastContentRendererClient:: |
| 194 SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { | 203 SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { |
| 195 // Settings for ATV (Android defaults are not what we want). | 204 // Settings for ATV (Android defaults are not what we want). |
| 196 blink::WebRuntimeFeatures::EnableMediaControlsOverlayPlayButton(false); | 205 blink::WebRuntimeFeatures::EnableMediaControlsOverlayPlayButton(false); |
| 197 } | 206 } |
| 198 | 207 |
| 199 } // namespace shell | 208 } // namespace shell |
| 200 } // namespace chromecast | 209 } // namespace chromecast |
| OLD | NEW |