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

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

Issue 7060011: Adding GetAudioInputDeviceNames to AudioManager, this function is supposed to do device enumerati... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 7 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <CoreAudio/AudioHardware.h> 5 #include <CoreAudio/AudioHardware.h>
6 6
7 #include "base/stringprintf.h"
7 #include "base/sys_info.h" 8 #include "base/sys_info.h"
8 #include "media/audio/fake_audio_input_stream.h" 9 #include "media/audio/fake_audio_input_stream.h"
9 #include "media/audio/fake_audio_output_stream.h" 10 #include "media/audio/fake_audio_output_stream.h"
10 #include "media/audio/mac/audio_input_mac.h" 11 #include "media/audio/mac/audio_input_mac.h"
11 #include "media/audio/mac/audio_low_latency_output_mac.h" 12 #include "media/audio/mac/audio_low_latency_output_mac.h"
12 #include "media/audio/mac/audio_manager_mac.h" 13 #include "media/audio/mac/audio_manager_mac.h"
13 #include "media/audio/mac/audio_output_mac.h" 14 #include "media/audio/mac/audio_output_mac.h"
14 #include "media/base/limits.h" 15 #include "media/base/limits.h"
15 16
16 static const int kMaxInputChannels = 2; 17 static const int kMaxInputChannels = 2;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 121 }
121 122
122 void AudioManagerMac::MuteAll() { 123 void AudioManagerMac::MuteAll() {
123 // TODO(cpu): implement. 124 // TODO(cpu): implement.
124 } 125 }
125 126
126 void AudioManagerMac::UnMuteAll() { 127 void AudioManagerMac::UnMuteAll() {
127 // TODO(cpu): implement. 128 // TODO(cpu): implement.
128 } 129 }
129 130
131 void AudioManagerMac::GetAudioInputDeviceNames(
132 AudioInputDeviceNames* device_names) {
133 // TODO(xians): query a full list of valid devices.
134 if (HasAudioInputDevices()) {
135 // Add the default device to the list.
awong 2011/05/23 17:36:15 Does this make sense in Mac?
xians 2011/05/23 20:15:59 We only prepend the default device to the list to
136 // We use (device_name)_(index) to make up the unique_ids to identify the
137 // devices. For default device, the index is 0, so its unique_id is
138 // Default_0.
139 AudioInputDeviceName name;
140 name.device_name = AudioManagerBase::kDefaultDeviceName;
141 name.unique_id = StringPrintf("%s_0", AudioManagerBase::kDefaultDeviceName);
142 device_names->push_back(name);
143 }
144 }
145
130 // Called by the stream when it has been released by calling Close(). 146 // Called by the stream when it has been released by calling Close().
131 void AudioManagerMac::ReleaseOutputStream(AudioOutputStream* stream) { 147 void AudioManagerMac::ReleaseOutputStream(AudioOutputStream* stream) {
132 DCHECK(stream); 148 DCHECK(stream);
133 num_output_streams_--; 149 num_output_streams_--;
134 delete stream; 150 delete stream;
135 } 151 }
136 152
137 // Called by the stream when it has been released by calling Close(). 153 // Called by the stream when it has been released by calling Close().
138 void AudioManagerMac::ReleaseInputStream(PCMQueueInAudioInputStream* stream) { 154 void AudioManagerMac::ReleaseInputStream(PCMQueueInAudioInputStream* stream) {
139 delete stream; 155 delete stream;
140 } 156 }
141 157
142 // static 158 // static
143 AudioManager* AudioManager::CreateAudioManager() { 159 AudioManager* AudioManager::CreateAudioManager() {
144 return new AudioManagerMac(); 160 return new AudioManagerMac();
145 } 161 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698