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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: media/audio/mac/audio_manager_mac.cc
===================================================================
--- media/audio/mac/audio_manager_mac.cc (revision 86276)
+++ media/audio/mac/audio_manager_mac.cc (working copy)
@@ -4,6 +4,7 @@
#include <CoreAudio/AudioHardware.h>
+#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "media/audio/fake_audio_input_stream.h"
#include "media/audio/fake_audio_output_stream.h"
@@ -127,6 +128,21 @@
// TODO(cpu): implement.
}
+void AudioManagerMac::GetAudioInputDeviceNames(
+ AudioInputDeviceNames* device_names) {
+ // TODO(xians): query a full list of valid devices.
+ if (HasAudioInputDevices()) {
+ // 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
+ // We use (device_name)_(index) to make up the unique_ids to identify the
+ // devices. For default device, the index is 0, so its unique_id is
+ // Default_0.
+ AudioInputDeviceName name;
+ name.device_name = AudioManagerBase::kDefaultDeviceName;
+ name.unique_id = StringPrintf("%s_0", AudioManagerBase::kDefaultDeviceName);
+ device_names->push_back(name);
+ }
+}
+
// Called by the stream when it has been released by calling Close().
void AudioManagerMac::ReleaseOutputStream(AudioOutputStream* stream) {
DCHECK(stream);

Powered by Google App Engine
This is Rietveld 408576698