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

Unified Diff: media/audio/audio_input_controller.cc

Issue 8491044: Link things together and enable the device selection for linux and mac. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: rebase2 Created 9 years, 1 month 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/audio_input_controller.h ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_input_controller.cc
diff --git a/media/audio/audio_input_controller.cc b/media/audio/audio_input_controller.cc
index 1e264e6039f06d30845dfd400afa637f85f3b62e..197378c8814398e547a09154ae3faf1885edf3e1 100644
--- a/media/audio/audio_input_controller.cc
+++ b/media/audio/audio_input_controller.cc
@@ -50,9 +50,12 @@ scoped_refptr<AudioInputController> AudioInputController::Create(
event_handler, NULL));
// Start the thread and post a task to create the audio input stream.
+ // Pass an empty string to indicate using default device.
+ std::string device_id = AudioManagerBase::kDefaultDeviceId;
controller->thread_.Start();
controller->thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
- &AudioInputController::DoCreate, controller.get(), params));
+ &AudioInputController::DoCreate, controller.get(),
+ params, device_id));
return controller;
}
@@ -60,6 +63,7 @@ scoped_refptr<AudioInputController> AudioInputController::Create(
scoped_refptr<AudioInputController> AudioInputController::CreateLowLatency(
EventHandler* event_handler,
const AudioParameters& params,
+ const std::string& device_id,
SyncWriter* sync_writer) {
DCHECK(sync_writer);
@@ -76,7 +80,7 @@ scoped_refptr<AudioInputController> AudioInputController::CreateLowLatency(
// Start the thread and post a task to create the audio input stream.
controller->thread_.Start();
controller->thread_.message_loop()->PostTask(FROM_HERE, base::Bind(
- &AudioInputController::DoCreate, controller.get(), params));
+ &AudioInputController::DoCreate, controller.get(), params, device_id));
return controller;
}
@@ -108,8 +112,10 @@ void AudioInputController::Close() {
thread_.Stop();
}
-void AudioInputController::DoCreate(const AudioParameters& params) {
- stream_ = AudioManager::GetAudioManager()->MakeAudioInputStream(params);
+void AudioInputController::DoCreate(const AudioParameters& params,
+ const std::string& device_id) {
+ stream_ = AudioManager::GetAudioManager()->MakeAudioInputStream(params,
+ device_id);
if (!stream_) {
// TODO(satish): Define error types.
« no previous file with comments | « media/audio/audio_input_controller.h ('k') | media/audio/audio_input_device_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698