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

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: addressed Per's comments. 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..f3917be5e2bd3dab89dcf2a1346be2d0c7162ed3 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -663,9 +663,20 @@ 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.
+ // TODO(xians): Handle the tab capture sample rate/channel layout
+ // in AudioInputDeviceManager::Open().
+ if (device_it->device.type != content::MEDIA_TAB_AUDIO_CAPTURE) {
+ 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);
« no previous file with comments | « content/browser/renderer_host/media/audio_input_renderer_host.cc ('k') | content/common/media/audio_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698