summaryrefslogtreecommitdiffstats
path: root/media/audio/mac
diff options
context:
space:
mode:
authorxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 09:13:22 +0000
committerxians@chromium.org <xians@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-03 09:13:22 +0000
commit7df6736db0dcefcddd9bc69796d4c302becf1324 (patch)
tree3759170ebdc34f5195e5342c474699baafc5392c /media/audio/mac
parent4d71e95c6059b8ceedaecf5bbfb8b93181edf671 (diff)
downloadchromium_src-7df6736db0dcefcddd9bc69796d4c302becf1324.zip
chromium_src-7df6736db0dcefcddd9bc69796d4c302becf1324.tar.gz
chromium_src-7df6736db0dcefcddd9bc69796d4c302becf1324.tar.bz2
Trying relanding this CL, the original CL passed the try bots but failed the mac 10.7 bot, I am keeping an eye on the bots and will revert it if it fails the bot again.
Hook up the device selection to the WebAudio live audio. WebAudio live audio needs to pass the session_id to the browser process so that Chrome can open the correct input device for unitfied IO. This CL looks big because it touches quite some interfaces from the render to the browser. But the change is simple and basically adding a session_id/device_id to the classes. All the changes some together and it is very hard to break it down. It also makes the media output code more similar to the media input code as well, and it will be easier to merge them for the future. TBR=henrika@chormium.org BUG=147327 TEST=http://chromium.googlecode.com/svn/trunk/samples/audio/visualizer-live.html Change the device using the camera icon on the right of the omnibox, then reload. Verify the sound is coming from the correct input device. Review URL: https://codereview.chromium.org/15836006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/mac')
-rw-r--r--media/audio/mac/audio_auhal_mac_unittest.cc3
-rw-r--r--media/audio/mac/audio_manager_mac.cc13
-rw-r--r--media/audio/mac/audio_manager_mac.h3
3 files changed, 13 insertions, 6 deletions
diff --git a/media/audio/mac/audio_auhal_mac_unittest.cc b/media/audio/mac/audio_auhal_mac_unittest.cc
index cab8c28..b4cf8c6 100644
--- a/media/audio/mac/audio_auhal_mac_unittest.cc
+++ b/media/audio/mac/audio_auhal_mac_unittest.cc
@@ -100,7 +100,8 @@ class AudioOutputStreamWrapper {
sample_rate_, bits_per_sample_,
samples_per_packet_);
- AudioOutputStream* aos = audio_man_->MakeAudioOutputStream(params);
+ AudioOutputStream* aos = audio_man_->MakeAudioOutputStream(params,
+ std::string());
EXPECT_TRUE(aos);
return aos;
}
diff --git a/media/audio/mac/audio_manager_mac.cc b/media/audio/mac/audio_manager_mac.cc
index 3671317..33dcff0 100644
--- a/media/audio/mac/audio_manager_mac.cc
+++ b/media/audio/mac/audio_manager_mac.cc
@@ -421,11 +421,11 @@ AudioParameters AudioManagerMac::GetInputStreamParameters(
AudioOutputStream* AudioManagerMac::MakeLinearOutputStream(
const AudioParameters& params) {
- return MakeLowLatencyOutputStream(params);
+ return MakeLowLatencyOutputStream(params, std::string());
}
AudioOutputStream* AudioManagerMac::MakeLowLatencyOutputStream(
- const AudioParameters& params) {
+ const AudioParameters& params, const std::string& input_device_id) {
// Handle basic output with no input channels.
if (params.input_channels() == 0) {
AudioDeviceID device = kAudioObjectUnknown;
@@ -462,7 +462,8 @@ AudioOutputStream* AudioManagerMac::MakeLowLatencyOutputStream(
LOG(INFO) << "Using AGGREGATE audio device";
}
- if (device != kAudioObjectUnknown)
+ if (device != kAudioObjectUnknown &&
+ input_device_id == AudioManagerBase::kDefaultDeviceId)
return new AUHALStream(this, params, device);
// Fallback to AudioSynchronizedStream which will handle completely
@@ -471,9 +472,13 @@ AudioOutputStream* AudioManagerMac::MakeLowLatencyOutputStream(
// kAudioDeviceUnknown translates to "use default" here.
// TODO(crogers): consider tracking UMA stats on AUHALStream
// versus AudioSynchronizedStream.
+ AudioDeviceID audio_device_id = GetAudioDeviceIdByUId(true, input_device_id);
+ if (audio_device_id == kAudioObjectUnknown)
+ return NULL;
+
return new AudioSynchronizedStream(this,
params,
- kAudioDeviceUnknown,
+ audio_device_id,
kAudioDeviceUnknown);
}
diff --git a/media/audio/mac/audio_manager_mac.h b/media/audio/mac/audio_manager_mac.h
index af867d8..0691ec2 100644
--- a/media/audio/mac/audio_manager_mac.h
+++ b/media/audio/mac/audio_manager_mac.h
@@ -36,7 +36,8 @@ class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase {
virtual AudioOutputStream* MakeLinearOutputStream(
const AudioParameters& params) OVERRIDE;
virtual AudioOutputStream* MakeLowLatencyOutputStream(
- const AudioParameters& params) OVERRIDE;
+ const AudioParameters& params,
+ const std::string& input_device_id) OVERRIDE;
virtual AudioInputStream* MakeLinearInputStream(
const AudioParameters& params, const std::string& device_id) OVERRIDE;
virtual AudioInputStream* MakeLowLatencyInputStream(