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

Side by Side Diff: media/audio/mac/audio_manager_mac.cc

Issue 115413002: Enable platform echo cancellation through the AudioRecord path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 7 years 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
« no previous file with comments | « media/audio/fake_audio_manager.cc ('k') | media/audio/openbsd/audio_manager_openbsd.cc » ('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/mac/audio_manager_mac.h" 5 #include "media/audio/mac/audio_manager_mac.h"
6 6
7 #include <CoreAudio/AudioHardware.h> 7 #include <CoreAudio/AudioHardware.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 if (input_channels > 0) { 668 if (input_channels > 0) {
669 // TODO(xians): given the limitations of the AudioOutputStream 669 // TODO(xians): given the limitations of the AudioOutputStream
670 // back-ends used with synchronized I/O, we hard-code to stereo. 670 // back-ends used with synchronized I/O, we hard-code to stereo.
671 // Specifically, this is a limitation of AudioSynchronizedStream which 671 // Specifically, this is a limitation of AudioSynchronizedStream which
672 // can be removed as part of the work to consolidate these back-ends. 672 // can be removed as part of the work to consolidate these back-ends.
673 channel_layout = CHANNEL_LAYOUT_STEREO; 673 channel_layout = CHANNEL_LAYOUT_STEREO;
674 } 674 }
675 } 675 }
676 676
677 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED)
678 channel_layout = CHANNEL_LAYOUT_DISCRETE;
679 else
680 hardware_channels = ChannelLayoutToChannelCount(channel_layout);
681
677 AudioParameters params( 682 AudioParameters params(
678 AudioParameters::AUDIO_PCM_LOW_LATENCY, 683 AudioParameters::AUDIO_PCM_LOW_LATENCY,
679 channel_layout, 684 channel_layout,
685 hardware_channels,
680 input_channels, 686 input_channels,
681 hardware_sample_rate, 687 hardware_sample_rate,
682 16, 688 16,
683 buffer_size); 689 buffer_size,
684 690 AudioParameters::NO_EFFECTS);
685 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED)
686 params.SetDiscreteChannels(hardware_channels);
687 691
688 return params; 692 return params;
689 } 693 }
690 694
691 void AudioManagerMac::CreateDeviceListener() { 695 void AudioManagerMac::CreateDeviceListener() {
692 DCHECK(GetMessageLoop()->BelongsToCurrentThread()); 696 DCHECK(GetMessageLoop()->BelongsToCurrentThread());
693 697
694 // Get a baseline for the sample-rate and current device, 698 // Get a baseline for the sample-rate and current device,
695 // so we can intelligently handle device notifications only when necessary. 699 // so we can intelligently handle device notifications only when necessary.
696 current_sample_rate_ = HardwareSampleRate(); 700 current_sample_rate_ = HardwareSampleRate();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 } 745 }
742 746
743 return buffer_size; 747 return buffer_size;
744 } 748 }
745 749
746 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { 750 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) {
747 return new AudioManagerMac(audio_log_factory); 751 return new AudioManagerMac(audio_log_factory);
748 } 752 }
749 753
750 } // namespace media 754 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/fake_audio_manager.cc ('k') | media/audio/openbsd/audio_manager_openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698