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

Unified Diff: media/audio/win/wavein_input_win.h

Issue 8770005: Adds input device selection on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rebased Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | media/audio/win/wavein_input_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/win/wavein_input_win.h
===================================================================
--- media/audio/win/wavein_input_win.h (revision 112958)
+++ media/audio/win/wavein_input_win.h (working copy)
@@ -24,7 +24,7 @@
PCMWaveInAudioInputStream(AudioManagerWin* manager,
const AudioParameters& params,
int num_buffers,
- UINT device_id);
+ const std::string& device_id);
virtual ~PCMWaveInAudioInputStream();
// Implementation of AudioInputStream.
@@ -61,6 +61,10 @@
// Sends a buffer to the audio driver for recording.
void QueueNextPacket(WAVEHDR* buffer);
+ // Converts the stored device id string into an unsigned integer which
+ // can be used by waveInOpen() to open the specified capture device.
+ bool GetDeviceId(UINT* device_index);
+
// Reader beware. Visual C has stronger guarantees on volatile vars than
// most people expect. In fact, it has release semantics on write and
// acquire semantics on reads. See the msdn documentation.
@@ -82,9 +86,10 @@
// Channels, 1 or 2.
const int channels_;
- // The id assigned by the operating system to the selected wave output
- // hardware device. Usually this is just -1 which means 'default device'.
- UINT device_id_;
+ // Contains the unique name of the selected endpoint device.
+ // Note that AudioManagerBase::kDefaultDeviceId represents the default
+ // device role and is not a valid ID as such.
+ std::string device_id_;
// Windows native structure to encode the format parameters.
WAVEFORMATEX format_;
« no previous file with comments | « media/audio/win/audio_manager_win.cc ('k') | media/audio/win/wavein_input_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698