| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/audio_manager_base.h" | 5 #include "media/audio/audio_manager_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 AudioParameters AudioManagerBase::GetPreferredLowLatencyOutputStreamParameters( | 389 AudioParameters AudioManagerBase::GetPreferredLowLatencyOutputStreamParameters( |
| 390 const AudioParameters& input_params) { | 390 const AudioParameters& input_params) { |
| 391 #if defined(OS_IOS) | 391 #if defined(OS_IOS) |
| 392 // IOS implements audio input only. | 392 // IOS implements audio input only. |
| 393 NOTIMPLEMENTED(); | 393 NOTIMPLEMENTED(); |
| 394 return AudioParameters(); | 394 return AudioParameters(); |
| 395 #else | 395 #else |
| 396 // TODO(dalecurtis): This should include bits per channel and channel layout | 396 // TODO(dalecurtis): This should include bits per channel and channel layout |
| 397 // eventually. | 397 // eventually. |
| 398 return AudioParameters( | 398 return AudioParameters( |
| 399 AudioParameters::AUDIO_PCM_LOW_LATENCY, input_params.channel_layout(), | 399 AudioParameters::AUDIO_PCM_LOW_LATENCY, |
| 400 input_params.channel_layout(), input_params.input_channels(), |
| 400 GetAudioHardwareSampleRate(), 16, GetAudioHardwareBufferSize()); | 401 GetAudioHardwareSampleRate(), 16, GetAudioHardwareBufferSize()); |
| 401 #endif // defined(OS_IOS) | 402 #endif // defined(OS_IOS) |
| 402 } | 403 } |
| 403 | 404 |
| 404 void AudioManagerBase::AddOutputDeviceChangeListener( | 405 void AudioManagerBase::AddOutputDeviceChangeListener( |
| 405 AudioDeviceListener* listener) { | 406 AudioDeviceListener* listener) { |
| 406 DCHECK(message_loop_->BelongsToCurrentThread()); | 407 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 407 output_listeners_.AddObserver(listener); | 408 output_listeners_.AddObserver(listener); |
| 408 } | 409 } |
| 409 | 410 |
| 410 void AudioManagerBase::RemoveOutputDeviceChangeListener( | 411 void AudioManagerBase::RemoveOutputDeviceChangeListener( |
| 411 AudioDeviceListener* listener) { | 412 AudioDeviceListener* listener) { |
| 412 DCHECK(message_loop_->BelongsToCurrentThread()); | 413 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 413 output_listeners_.RemoveObserver(listener); | 414 output_listeners_.RemoveObserver(listener); |
| 414 } | 415 } |
| 415 | 416 |
| 416 void AudioManagerBase::NotifyAllOutputDeviceChangeListeners() { | 417 void AudioManagerBase::NotifyAllOutputDeviceChangeListeners() { |
| 417 DCHECK(message_loop_->BelongsToCurrentThread()); | 418 DCHECK(message_loop_->BelongsToCurrentThread()); |
| 418 DVLOG(1) << "Firing OnDeviceChange() notifications."; | 419 DVLOG(1) << "Firing OnDeviceChange() notifications."; |
| 419 FOR_EACH_OBSERVER(AudioDeviceListener, output_listeners_, OnDeviceChange()); | 420 FOR_EACH_OBSERVER(AudioDeviceListener, output_listeners_, OnDeviceChange()); |
| 420 } | 421 } |
| 421 | 422 |
| 422 } // namespace media | 423 } // namespace media |
| OLD | NEW |