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

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

Issue 312773002: Support for audio output devices for getMediaDevices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/renderer_host/render_view_host_delegate.h" 8 #include "content/browser/renderer_host/render_view_host_delegate.h"
9 #include "content/browser/renderer_host/render_view_host_impl.h" 9 #include "content/browser/renderer_host/render_view_host_impl.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 MediaStreamDevices devices_to_use; 223 MediaStreamDevices devices_to_use;
224 bool accepted_audio = false; 224 bool accepted_audio = false;
225 bool accepted_video = false; 225 bool accepted_video = false;
226 226
227 // Use the first capture device of the same media type in the list for the 227 // Use the first capture device of the same media type in the list for the
228 // fake UI. 228 // fake UI.
229 for (MediaStreamDevices::const_iterator it = devices_.begin(); 229 for (MediaStreamDevices::const_iterator it = devices_.begin();
230 it != devices_.end(); ++it) { 230 it != devices_.end(); ++it) {
231 if (!accepted_audio && 231 if (!accepted_audio &&
232 IsAudioMediaType(request.audio_type) && 232 IsAudioInputMediaType(request.audio_type) &&
233 IsAudioMediaType(it->type) && 233 IsAudioInputMediaType(it->type) &&
234 (request.requested_audio_device_id.empty() || 234 (request.requested_audio_device_id.empty() ||
235 request.requested_audio_device_id == it->id)) { 235 request.requested_audio_device_id == it->id)) {
236 devices_to_use.push_back(*it); 236 devices_to_use.push_back(*it);
237 accepted_audio = true; 237 accepted_audio = true;
238 } else if (!accepted_video && 238 } else if (!accepted_video &&
239 IsVideoMediaType(request.video_type) && 239 IsVideoMediaType(request.video_type) &&
240 IsVideoMediaType(it->type) && 240 IsVideoMediaType(it->type) &&
241 (request.requested_video_device_id.empty() || 241 (request.requested_video_device_id.empty() ||
242 request.requested_video_device_id == it->id)) { 242 request.requested_video_device_id == it->id)) {
243 devices_to_use.push_back(*it); 243 devices_to_use.push_back(*it);
(...skipping 15 matching lines...) Expand all
259 devices_to_use.empty() ? 259 devices_to_use.empty() ?
260 MEDIA_DEVICE_NO_HARDWARE : 260 MEDIA_DEVICE_NO_HARDWARE :
261 MEDIA_DEVICE_OK)); 261 MEDIA_DEVICE_OK));
262 } 262 }
263 263
264 void FakeMediaStreamUIProxy::OnStarted( 264 void FakeMediaStreamUIProxy::OnStarted(
265 const base::Closure& stop_callback, 265 const base::Closure& stop_callback,
266 const WindowIdCallback& window_id_callback) {} 266 const WindowIdCallback& window_id_callback) {}
267 267
268 } // namespace content 268 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/media_stream_manager.cc ('k') | content/public/common/media_stream_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698