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

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

Issue 1275783003: Add a virtual beamforming audio device on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some cross-platform errors. Created 5 years, 3 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
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 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/mac/mac_logging.h" 10 #include "base/mac/mac_logging.h"
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 // work correctly. 665 // work correctly.
666 int output_channels = input_params.channels(); 666 int output_channels = input_params.channels();
667 ChannelLayout channel_layout = input_params.channel_layout(); 667 ChannelLayout channel_layout = input_params.channel_layout();
668 if (!has_valid_input_params || output_channels > hardware_channels) { 668 if (!has_valid_input_params || output_channels > hardware_channels) {
669 output_channels = hardware_channels; 669 output_channels = hardware_channels;
670 channel_layout = GuessChannelLayout(output_channels); 670 channel_layout = GuessChannelLayout(output_channels);
671 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED) 671 if (channel_layout == CHANNEL_LAYOUT_UNSUPPORTED)
672 channel_layout = CHANNEL_LAYOUT_DISCRETE; 672 channel_layout = CHANNEL_LAYOUT_DISCRETE;
673 } 673 }
674 674
675 return AudioParameters( 675 return AudioParameters(AudioParameters::AUDIO_PCM_LOW_LATENCY,
676 AudioParameters::AUDIO_PCM_LOW_LATENCY, channel_layout, output_channels, 676 output_channels, channel_layout, hardware_sample_rate,
677 hardware_sample_rate, 16, buffer_size, AudioParameters::NO_EFFECTS); 677 16, buffer_size);
678 } 678 }
679 679
680 void AudioManagerMac::InitializeOnAudioThread() { 680 void AudioManagerMac::InitializeOnAudioThread() {
681 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); 681 DCHECK(GetTaskRunner()->BelongsToCurrentThread());
682 power_observer_.reset(new AudioPowerObserver()); 682 power_observer_.reset(new AudioPowerObserver());
683 } 683 }
684 684
685 void AudioManagerMac::ShutdownOnAudioThread() { 685 void AudioManagerMac::ShutdownOnAudioThread() {
686 DCHECK(GetTaskRunner()->BelongsToCurrentThread()); 686 DCHECK(GetTaskRunner()->BelongsToCurrentThread());
687 output_device_listener_.reset(); 687 output_device_listener_.reset();
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 basic_input_streams_.erase(stream_it); 825 basic_input_streams_.erase(stream_it);
826 826
827 AudioManagerBase::ReleaseInputStream(stream); 827 AudioManagerBase::ReleaseInputStream(stream);
828 } 828 }
829 829
830 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) { 830 AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) {
831 return new AudioManagerMac(audio_log_factory); 831 return new AudioManagerMac(audio_log_factory);
832 } 832 }
833 833
834 } // namespace media 834 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698