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

Unified Diff: content/browser/renderer_host/media/audio_input_device_manager.cc

Issue 11783059: Ensures that WebRTC works for device selection using a different sample rate than default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix after review from Chris Created 7 years, 11 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_device_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..14bd4706fc38d73025068bc3162226fe0e5967d1 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 {
@@ -154,8 +156,17 @@ void AudioInputDeviceManager::EnumerateOnDeviceThread(
scoped_ptr<StreamDeviceInfoArray> devices(new StreamDeviceInfoArray());
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.
+ int sample_rate =
+ media::GetAudioInputHardwareSampleRate(it->unique_id);
+ media::ChannelLayout 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
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_device_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698