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

Side by Side Diff: content/browser/renderer_host/media/media_stream_device_settings.cc

Issue 8695004: Let fake UI allow a video capture device to be opened several times. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_device_settings.h" 5 #include "content/browser/renderer_host/media/media_stream_device_settings.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/task.h" 8 #include "base/task.h"
9 #include "content/browser/renderer_host/media/media_stream_settings_requester.h" 9 #include "content/browser/renderer_host/media/media_stream_settings_requester.h"
10 #include "content/common/media/media_stream_options.h" 10 #include "content/common/media/media_stream_options.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 StreamDeviceInfoArray devices_to_use; 116 StreamDeviceInfoArray devices_to_use;
117 for (DeviceMap::iterator it = request->devices.begin(); 117 for (DeviceMap::iterator it = request->devices.begin();
118 it != request->devices.end(); ++it) { 118 it != request->devices.end(); ++it) {
119 for (StreamDeviceInfoArray::iterator device_it = it->second.begin(); 119 for (StreamDeviceInfoArray::iterator device_it = it->second.begin();
120 device_it != it->second.end(); ++device_it) { 120 device_it != it->second.end(); ++device_it) {
121 if (!device_it->in_use) { 121 if (!device_it->in_use) {
122 devices_to_use.push_back(*device_it); 122 devices_to_use.push_back(*device_it);
123 break; 123 break;
124 } 124 }
125 } 125 }
126 } 126 }
wjia(left Chromium) 2011/11/24 20:44:29 I was thinking of a simple way: remove the inner f
mflodman_chromium_OOO 2011/11/25 08:37:42 I thought about that too, but that would remove th
127 if (num_media_requests != devices_to_use.size()) {
128 // Not all requested device types were opened. This happens if all
129 // video capture devices are already opened, |in_use| isn't set for
130 // audio devices. Allow the first video capture device in the list to be
131 // opened for this user too.
132 DCHECK(request->options.video_option != StreamOptions::kNoCamera);
scherkus (not reviewing) 2011/11/29 02:39:53 DCHECK_NE
mflodman_chromium_OOO 2011/11/29 23:31:00 Done.
133 StreamDeviceInfoArray device_array = (request->devices[kVideoCapture]);
134 devices_to_use.push_back(*(device_array.begin()));
135 }
136
127 // Post result and delete request. 137 // Post result and delete request.
128 requester_->DevicesAccepted(label, devices_to_use); 138 requester_->DevicesAccepted(label, devices_to_use);
129 requests_.erase(request_it); 139 requests_.erase(request_it);
130 delete request; 140 delete request;
131 } 141 }
132 } 142 }
133 } 143 }
134 144
135 void MediaStreamDeviceSettings::UseFakeUI() { 145 void MediaStreamDeviceSettings::UseFakeUI() {
136 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 146 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
137 use_fake_ui_ = true; 147 use_fake_ui_ = true;
138 } 148 }
139 149
140 } // namespace media_stream 150 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698