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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 return; 656 return;
657 } 657 }
658 658
659 switch (request->type) { 659 switch (request->type) {
660 case MEDIA_OPEN_DEVICE: 660 case MEDIA_OPEN_DEVICE:
661 request->requester->DeviceOpened(label, devices->front()); 661 request->requester->DeviceOpened(label, devices->front());
662 break; 662 break;
663 case MEDIA_GENERATE_STREAM: { 663 case MEDIA_GENERATE_STREAM: {
664 // Partition the array of devices into audio vs video. 664 // Partition the array of devices into audio vs video.
665 StreamDeviceInfoArray audio_devices, video_devices; 665 StreamDeviceInfoArray audio_devices, video_devices;
666 for (StreamDeviceInfoArray::const_iterator device_it = devices->begin(); 666 for (StreamDeviceInfoArray::iterator device_it = devices->begin();
667 device_it != devices->end(); ++device_it) { 667 device_it != devices->end(); ++device_it) {
668 if (IsAudioMediaType(device_it->device.type)) { 668 if (IsAudioMediaType(device_it->device.type)) {
669 // Store the native audio parameters in the device struct.
670 const StreamDeviceInfo& info =
671 audio_input_device_manager_->GetOpenedDeviceInfoById(
672 capture_session_id);
673 DCHECK_EQ(info.device.id, device_it->device.id);
674 device_it->device.sample_rate = info.device.sample_rate;
675 device_it->device.channel_layout = info.device.channel_layout;
669 audio_devices.push_back(*device_it); 676 audio_devices.push_back(*device_it);
670 } else if (IsVideoMediaType(device_it->device.type)) { 677 } else if (IsVideoMediaType(device_it->device.type)) {
671 video_devices.push_back(*device_it); 678 video_devices.push_back(*device_it);
672 } else { 679 } else {
673 NOTREACHED(); 680 NOTREACHED();
674 } 681 }
675 } 682 }
676 683
677 request->requester->StreamGenerated(label, audio_devices, video_devices); 684 request->requester->StreamGenerated(label, audio_devices, video_devices);
678 NotifyDevicesOpened(*request); 685 NotifyDevicesOpened(*request);
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 } 1085 }
1079 1086
1080 // Always do enumeration even though some enumeration is in progress, 1087 // Always do enumeration even though some enumeration is in progress,
1081 // because those enumeration commands could be sent before these devices 1088 // because those enumeration commands could be sent before these devices
1082 // change. 1089 // change.
1083 ++active_enumeration_ref_count_[stream_type]; 1090 ++active_enumeration_ref_count_[stream_type];
1084 GetDeviceManager(stream_type)->EnumerateDevices(stream_type); 1091 GetDeviceManager(stream_type)->EnumerateDevices(stream_type);
1085 } 1092 }
1086 1093
1087 } // namespace content 1094 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698