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/alsa/audio_manager_alsa.h" | 5 #include "media/audio/alsa/audio_manager_alsa.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } else { | 277 } else { |
278 DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: " | 278 DLOG(WARNING) << "HasAnyAudioDevice: unable to get device hints: " |
279 << wrapper_->StrError(error); | 279 << wrapper_->StrError(error); |
280 } | 280 } |
281 } | 281 } |
282 | 282 |
283 return has_device; | 283 return has_device; |
284 } | 284 } |
285 | 285 |
286 AudioOutputStream* AudioManagerAlsa::MakeLinearOutputStream( | 286 AudioOutputStream* AudioManagerAlsa::MakeLinearOutputStream( |
287 const AudioParameters& params) { | 287 const AudioParameters& params, |
| 288 const LogCallback& log_callback) { |
288 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 289 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
289 return MakeOutputStream(params); | 290 return MakeOutputStream(params); |
290 } | 291 } |
291 | 292 |
292 AudioOutputStream* AudioManagerAlsa::MakeLowLatencyOutputStream( | 293 AudioOutputStream* AudioManagerAlsa::MakeLowLatencyOutputStream( |
293 const AudioParameters& params, | 294 const AudioParameters& params, |
294 const std::string& device_id) { | 295 const std::string& device_id, |
| 296 const LogCallback& log_callback) { |
295 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; | 297 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; |
296 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 298 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
297 return MakeOutputStream(params); | 299 return MakeOutputStream(params); |
298 } | 300 } |
299 | 301 |
300 AudioInputStream* AudioManagerAlsa::MakeLinearInputStream( | 302 AudioInputStream* AudioManagerAlsa::MakeLinearInputStream( |
301 const AudioParameters& params, const std::string& device_id) { | 303 const AudioParameters& params, |
| 304 const std::string& device_id, |
| 305 const LogCallback& log_callback) { |
302 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 306 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
303 return MakeInputStream(params, device_id); | 307 return MakeInputStream(params, device_id); |
304 } | 308 } |
305 | 309 |
306 AudioInputStream* AudioManagerAlsa::MakeLowLatencyInputStream( | 310 AudioInputStream* AudioManagerAlsa::MakeLowLatencyInputStream( |
307 const AudioParameters& params, const std::string& device_id) { | 311 const AudioParameters& params, |
| 312 const std::string& device_id, |
| 313 const LogCallback& log_callback) { |
308 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 314 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
309 return MakeInputStream(params, device_id); | 315 return MakeInputStream(params, device_id); |
310 } | 316 } |
311 | 317 |
312 AudioParameters AudioManagerAlsa::GetPreferredOutputStreamParameters( | 318 AudioParameters AudioManagerAlsa::GetPreferredOutputStreamParameters( |
313 const std::string& output_device_id, | 319 const std::string& output_device_id, |
314 const AudioParameters& input_params) { | 320 const AudioParameters& input_params) { |
315 // TODO(tommi): Support |output_device_id|. | 321 // TODO(tommi): Support |output_device_id|. |
316 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; | 322 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; |
317 static const int kDefaultOutputBufferSize = 2048; | 323 static const int kDefaultOutputBufferSize = 2048; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 365 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
360 switches::kAlsaInputDevice)) { | 366 switches::kAlsaInputDevice)) { |
361 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 367 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
362 switches::kAlsaInputDevice); | 368 switches::kAlsaInputDevice); |
363 } | 369 } |
364 | 370 |
365 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); | 371 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); |
366 } | 372 } |
367 | 373 |
368 } // namespace media | 374 } // namespace media |
OLD | NEW |