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) { | |
289 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 288 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
290 return MakeOutputStream(params); | 289 return MakeOutputStream(params); |
291 } | 290 } |
292 | 291 |
293 AudioOutputStream* AudioManagerAlsa::MakeLowLatencyOutputStream( | 292 AudioOutputStream* AudioManagerAlsa::MakeLowLatencyOutputStream( |
294 const AudioParameters& params, | 293 const AudioParameters& params, |
295 const std::string& device_id, | 294 const std::string& device_id) { |
296 const LogCallback& log_callback) { | |
297 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; | 295 DLOG_IF(ERROR, !device_id.empty()) << "Not implemented!"; |
298 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 296 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
299 return MakeOutputStream(params); | 297 return MakeOutputStream(params); |
300 } | 298 } |
301 | 299 |
302 AudioInputStream* AudioManagerAlsa::MakeLinearInputStream( | 300 AudioInputStream* AudioManagerAlsa::MakeLinearInputStream( |
303 const AudioParameters& params, | 301 const AudioParameters& params, const std::string& device_id) { |
304 const std::string& device_id, | |
305 const LogCallback& log_callback) { | |
306 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); | 302 DCHECK_EQ(AudioParameters::AUDIO_PCM_LINEAR, params.format()); |
307 return MakeInputStream(params, device_id); | 303 return MakeInputStream(params, device_id); |
308 } | 304 } |
309 | 305 |
310 AudioInputStream* AudioManagerAlsa::MakeLowLatencyInputStream( | 306 AudioInputStream* AudioManagerAlsa::MakeLowLatencyInputStream( |
311 const AudioParameters& params, | 307 const AudioParameters& params, const std::string& device_id) { |
312 const std::string& device_id, | |
313 const LogCallback& log_callback) { | |
314 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); | 308 DCHECK_EQ(AudioParameters::AUDIO_PCM_LOW_LATENCY, params.format()); |
315 return MakeInputStream(params, device_id); | 309 return MakeInputStream(params, device_id); |
316 } | 310 } |
317 | 311 |
318 AudioParameters AudioManagerAlsa::GetPreferredOutputStreamParameters( | 312 AudioParameters AudioManagerAlsa::GetPreferredOutputStreamParameters( |
319 const std::string& output_device_id, | 313 const std::string& output_device_id, |
320 const AudioParameters& input_params) { | 314 const AudioParameters& input_params) { |
321 // TODO(tommi): Support |output_device_id|. | 315 // TODO(tommi): Support |output_device_id|. |
322 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; | 316 DLOG_IF(ERROR, !output_device_id.empty()) << "Not implemented!"; |
323 static const int kDefaultOutputBufferSize = 2048; | 317 static const int kDefaultOutputBufferSize = 2048; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 359 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
366 switches::kAlsaInputDevice)) { | 360 switches::kAlsaInputDevice)) { |
367 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 361 device_name = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
368 switches::kAlsaInputDevice); | 362 switches::kAlsaInputDevice); |
369 } | 363 } |
370 | 364 |
371 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); | 365 return new AlsaPcmInputStream(this, device_name, params, wrapper_.get()); |
372 } | 366 } |
373 | 367 |
374 } // namespace media | 368 } // namespace media |
OLD | NEW |