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

Side by Side Diff: media/audio/audio_manager_base.cc

Issue 11878032: Plumb |input_channels| all the way to AudioManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_device.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698