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

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

Issue 8480028: support video device enumeration from renderer process. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: code review Created 8 years, 11 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) 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 "content/browser/renderer_host/media/media_stream_settings_requester.h" 8 #include "content/browser/renderer_host/media/media_stream_settings_requester.h"
9 #include "content/common/media/media_stream_options.h" 9 #include "content/common/media/media_stream_options.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Request with this id already exists. 59 // Request with this id already exists.
60 requester_->SettingsError(label); 60 requester_->SettingsError(label);
61 return; 61 return;
62 } 62 }
63 63
64 // Create a new request. 64 // Create a new request.
65 requests_.insert(std::make_pair(label, new SettingsRequest(render_process_id, 65 requests_.insert(std::make_pair(label, new SettingsRequest(render_process_id,
66 render_view_id, 66 render_view_id,
67 security_origin, 67 security_origin,
68 request_options))); 68 request_options)));
69 // Ask for available devices.
70 if (request_options.audio) {
71 requester_->GetDevices(label, kAudioCapture);
72 }
73 if (request_options.video_option != StreamOptions::kNoCamera) {
74 requester_->GetDevices(label, kVideoCapture);
75 }
76 } 69 }
77 70
78 void MediaStreamDeviceSettings::AvailableDevices( 71 void MediaStreamDeviceSettings::AvailableDevices(
79 const std::string& label, MediaStreamType stream_type, 72 const std::string& label, MediaStreamType stream_type,
80 const StreamDeviceInfoArray& devices) { 73 const StreamDeviceInfoArray& devices) {
81 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 74 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
82 75
83 SettingsRequests::iterator request_it = requests_.find(label); 76 SettingsRequests::iterator request_it = requests_.find(label);
84 if (request_it == requests_.end()) { 77 if (request_it == requests_.end()) {
85 // Request with this id doesn't exist. 78 // Request with this id doesn't exist.
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 } 133 }
141 } 134 }
142 } 135 }
143 136
144 void MediaStreamDeviceSettings::UseFakeUI() { 137 void MediaStreamDeviceSettings::UseFakeUI() {
145 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 138 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
146 use_fake_ui_ = true; 139 use_fake_ui_ = true;
147 } 140 }
148 141
149 } // namespace media_stream 142 } // namespace media_stream
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698