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

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

Issue 12440027: Do not pass the string device_id via IPC message to create an audio input stream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ready for review Created 7 years, 9 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
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index 3adfaf4eaf53b63ee4a685221bb74b1bc2374fce..389679361bf001d958c151f1ae6f7bf00fe73046 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -663,9 +663,16 @@ void MediaStreamManager::Opened(MediaStreamType stream_type,
case MEDIA_GENERATE_STREAM: {
// Partition the array of devices into audio vs video.
StreamDeviceInfoArray audio_devices, video_devices;
- for (StreamDeviceInfoArray::const_iterator device_it = devices->begin();
+ for (StreamDeviceInfoArray::iterator device_it = devices->begin();
device_it != devices->end(); ++device_it) {
if (IsAudioMediaType(device_it->device.type)) {
+ // Store the native audio parameters in the device struct.
+ const StreamDeviceInfo& info =
+ audio_input_device_manager_->GetOpenedDeviceInfoById(
+ capture_session_id);
+ DCHECK_EQ(info.device.id, device_it->device.id);
+ device_it->device.sample_rate = info.device.sample_rate;
+ device_it->device.channel_layout = info.device.channel_layout;
audio_devices.push_back(*device_it);
} else if (IsVideoMediaType(device_it->device.type)) {
video_devices.push_back(*device_it);

Powered by Google App Engine
This is Rietveld 408576698