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

Side by Side Diff: chromecast/renderer/cast_content_renderer_client.cc

Issue 2798263006: [Chromecast] Fix CastMediaClient::IsSupportedAudioConfig() for (E)AC3 on Android (Closed)
Patch Set: [Chromecast] Fix CastMediaClient::IsSupportedAudioConfig() for (E)AC3 on Android Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698