OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_ui_proxy.h" | 5 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
6 | 6 |
7 #include "content/browser/renderer_host/render_view_host_delegate.h" | 7 #include "content/browser/renderer_host/render_view_host_delegate.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "media/video/capture/fake_video_capture_device.h" | 10 #include "media/video/capture/fake_video_capture_device.h" |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 MediaStreamDevices devices_to_use; | 187 MediaStreamDevices devices_to_use; |
188 bool accepted_audio = false; | 188 bool accepted_audio = false; |
189 bool accepted_video = false; | 189 bool accepted_video = false; |
190 // Use the first capture device of the same media type in the list for the | 190 // Use the first capture device of the same media type in the list for the |
191 // fake UI. | 191 // fake UI. |
192 for (MediaStreamDevices::const_iterator it = devices_.begin(); | 192 for (MediaStreamDevices::const_iterator it = devices_.begin(); |
193 it != devices_.end(); ++it) { | 193 it != devices_.end(); ++it) { |
194 if (!accepted_audio && | 194 if (!accepted_audio && |
195 IsAudioMediaType(request.audio_type) && | 195 IsAudioMediaType(request.audio_type) && |
196 IsAudioMediaType(it->type) && | 196 IsAudioMediaType(it->type)) { |
197 (request.requested_audio_device_id.empty() || | |
198 request.requested_audio_device_id == it->id)) { | |
199 devices_to_use.push_back(*it); | 197 devices_to_use.push_back(*it); |
200 accepted_audio = true; | 198 accepted_audio = true; |
201 } else if (!accepted_video && | 199 } else if (!accepted_video && |
202 IsVideoMediaType(request.video_type) && | 200 IsVideoMediaType(request.video_type) && |
203 IsVideoMediaType(it->type) && | 201 IsVideoMediaType(it->type)) { |
204 (request.requested_video_device_id.empty() || | |
205 request.requested_video_device_id == it->id)) { | |
206 devices_to_use.push_back(*it); | 202 devices_to_use.push_back(*it); |
207 accepted_video = true; | 203 accepted_video = true; |
208 } | 204 } |
209 } | 205 } |
210 | 206 |
211 BrowserThread::PostTask( | 207 BrowserThread::PostTask( |
212 BrowserThread::IO, FROM_HERE, | 208 BrowserThread::IO, FROM_HERE, |
213 base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse, | 209 base::Bind(&MediaStreamUIProxy::ProcessAccessRequestResponse, |
214 weak_factory_.GetWeakPtr(), devices_to_use)); | 210 weak_factory_.GetWeakPtr(), devices_to_use)); |
215 } | 211 } |
216 | 212 |
217 void FakeMediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) { | 213 void FakeMediaStreamUIProxy::OnStarted(const base::Closure& stop_callback) { |
218 } | 214 } |
219 | 215 |
220 } // namespace content | 216 } // namespace content |
OLD | NEW |