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

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: changed the pepper code to use OpenDevice() for default device, and fixed a minor mistake in MediaS… 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 e32aaca6b2ce6c014c3b9db9e2dbaa5dee546076..da5a6e8681d99e7f685843450144d48f1fc459e0 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(
+ device_it->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