Chromium Code Reviews| Index: content/browser/renderer_host/media/audio_input_device_manager.cc |
| diff --git a/content/browser/renderer_host/media/audio_input_device_manager.cc b/content/browser/renderer_host/media/audio_input_device_manager.cc |
| index b4579f88571f4a2ba666c1c1d2587e2b9d0cd778..cb484b396e69d7cf71cefd6708205b5fe6a4794f 100644 |
| --- a/content/browser/renderer_host/media/audio_input_device_manager.cc |
| +++ b/content/browser/renderer_host/media/audio_input_device_manager.cc |
| @@ -12,6 +12,8 @@ |
| #include "media/audio/audio_device_name.h" |
| #include "media/audio/audio_input_ipc.h" |
| #include "media/audio/audio_manager_base.h" |
| +#include "media/audio/audio_util.h" |
| +#include "media/base/channel_layout.h" |
| namespace content { |
| @@ -152,10 +154,21 @@ void AudioInputDeviceManager::EnumerateOnDeviceThread( |
| } |
| scoped_ptr<StreamDeviceInfoArray> devices(new StreamDeviceInfoArray()); |
| + int sample_rate = 0; |
|
tommi (sloooow) - chröme
2013/01/15 17:43:49
define these two variables where they are used
henrika (OOO until Aug 14)
2013/01/16 16:37:17
Done.
|
| + media::ChannelLayout channel_layout = media::CHANNEL_LAYOUT_NONE; |
| for (media::AudioDeviceNames::iterator it = device_names.begin(); |
| it != device_names.end(); ++it) { |
| + // Get the preferred sample rate and channel configuration for the |
| + // current audio device. |
| + sample_rate = |
| + media::GetAudioInputHardwareSampleRate(it->unique_id); |
| + channel_layout = |
| + media::GetAudioInputHardwareChannelLayout(it->unique_id); |
| + |
| + // Add device information to device vector. |
| devices->push_back(StreamDeviceInfo( |
| - stream_type, it->device_name, it->unique_id, false)); |
| + stream_type, it->device_name, it->unique_id, sample_rate, |
| + channel_layout, false)); |
| } |
| // Return the device list through the listener by posting a task on |
| @@ -207,8 +220,9 @@ void AudioInputDeviceManager::DevicesEnumeratedOnIOThread( |
| scoped_ptr<StreamDeviceInfoArray> devices) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| // Ensure that |devices| gets deleted on exit. |
| - if (listener_) |
| + if (listener_) { |
|
tommi (sloooow) - chröme
2013/01/15 17:43:49
nit: revert this change (it's not consistent with
henrika (OOO until Aug 14)
2013/01/16 16:37:17
Done.
|
| listener_->DevicesEnumerated(stream_type, *devices); |
| + } |
| } |
| void AudioInputDeviceManager::OpenedOnIOThread(MediaStreamType stream_type, |