| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "media/audio/cras/audio_manager_cras.h" | 5 #include "media/audio/cras/audio_manager_cras.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 if (!IsBeamformingDefaultEnabled()) | 212 if (!IsBeamformingDefaultEnabled()) |
| 213 RecordBeamformingDeviceState(BEAMFORMING_DEFAULT_DISABLED); | 213 RecordBeamformingDeviceState(BEAMFORMING_DEFAULT_DISABLED); |
| 214 else | 214 else |
| 215 RecordBeamformingDeviceState(BEAMFORMING_USER_DISABLED); | 215 RecordBeamformingDeviceState(BEAMFORMING_USER_DISABLED); |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 return params; | 218 return params; |
| 219 } | 219 } |
| 220 | 220 |
| 221 AudioOutputStream* AudioManagerCras::MakeLinearOutputStream( | 221 AudioOutputStream* AudioManagerCras::MakeLinearOutputStream( |
| 222 const AudioParameters& params) { | 222 const AudioParameters& params, |
| 223 const LogCallback& log_callback) { |
| 223 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 224 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
| 224 return MakeOutputStream(params); | 225 return MakeOutputStream(params); |
| 225 } | 226 } |
| 226 | 227 |
| 227 AudioOutputStream* AudioManagerCras::MakeLowLatencyOutputStream( | 228 AudioOutputStream* AudioManagerCras::MakeLowLatencyOutputStream( |
| 228 const AudioParameters& params, | 229 const AudioParameters& params, |
| 229 const std::string& device_id) { | 230 const std::string& device_id, |
| 231 const LogCallback& log_callback) { |
| 230 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; | 232 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; |
| 231 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 233 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 232 // TODO(dgreid): Open the correct input device for unified IO. | 234 // TODO(dgreid): Open the correct input device for unified IO. |
| 233 return MakeOutputStream(params); | 235 return MakeOutputStream(params); |
| 234 } | 236 } |
| 235 | 237 |
| 236 AudioInputStream* AudioManagerCras::MakeLinearInputStream( | 238 AudioInputStream* AudioManagerCras::MakeLinearInputStream( |
| 237 const AudioParameters& params, const std::string& device_id) { | 239 const AudioParameters& params, |
| 240 const std::string& device_id, |
| 241 const LogCallback& log_callback) { |
| 238 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 242 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
| 239 return MakeInputStream(params, device_id); | 243 return MakeInputStream(params, device_id); |
| 240 } | 244 } |
| 241 | 245 |
| 242 AudioInputStream* AudioManagerCras::MakeLowLatencyInputStream( | 246 AudioInputStream* AudioManagerCras::MakeLowLatencyInputStream( |
| 243 const AudioParameters& params, const std::string& device_id) { | 247 const AudioParameters& params, |
| 248 const std::string& device_id, |
| 249 const LogCallback& log_callback) { |
| 244 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 250 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
| 245 return MakeInputStream(params, device_id); | 251 return MakeInputStream(params, device_id); |
| 246 } | 252 } |
| 247 | 253 |
| 248 AudioParameters AudioManagerCras::GetPreferredOutputStreamParameters( | 254 AudioParameters AudioManagerCras::GetPreferredOutputStreamParameters( |
| 249 const std::string& output_device_id, | 255 const std::string& output_device_id, |
| 250 const AudioParameters& input_params) { | 256 const AudioParameters& input_params) { |
| 251 // TODO(tommi): Support |output_device_id|. | 257 // TODO(tommi): Support |output_device_id|. |
| 252 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; | 258 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; |
| 253 ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; | 259 ChannelLayout channel_layout = CHANNEL_LAYOUT_STEREO; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 case 24: | 296 case 24: |
| 291 return SND_PCM_FORMAT_S24; | 297 return SND_PCM_FORMAT_S24; |
| 292 case 32: | 298 case 32: |
| 293 return SND_PCM_FORMAT_S32; | 299 return SND_PCM_FORMAT_S32; |
| 294 default: | 300 default: |
| 295 return SND_PCM_FORMAT_UNKNOWN; | 301 return SND_PCM_FORMAT_UNKNOWN; |
| 296 } | 302 } |
| 297 } | 303 } |
| 298 | 304 |
| 299 } // namespace media | 305 } // namespace media |
| OLD | NEW |