From b43d26a4e58e1c941d18df4d13780e12c40855f0 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 9 Mar 2015 21:57:00 +0000 Subject: [PATCH] Support selection of WebRTC audio/video source (issue #1335). git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@2065 5089003a-bbd8-11dd-ad1f-f1f9622dbc98 --- libcef/browser/browser_host_impl.cc | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/libcef/browser/browser_host_impl.cc b/libcef/browser/browser_host_impl.cc index a8208a41a..18326c4dd 100644 --- a/libcef/browser/browser_host_impl.cc +++ b/libcef/browser/browser_host_impl.cc @@ -2370,24 +2370,22 @@ void CefBrowserHostImpl::RequestMediaAccessPermission( if (microphone_requested || webcam_requested) { switch (request.request_type) { case content::MEDIA_OPEN_DEVICE: - // For open device request pick the desired device or fall back to the - // first available of the given type. - CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( - (microphone_requested ? request.requested_audio_device_id : - request.requested_video_device_id), - microphone_requested, - webcam_requested, - &devices); - break; case content::MEDIA_DEVICE_ACCESS: case content::MEDIA_GENERATE_STREAM: case content::MEDIA_ENUMERATE_DEVICES: - // Get the default devices for the request. - CefMediaCaptureDevicesDispatcher::GetInstance()-> - GetDefaultDevices(CefContentBrowserClient::Get()->pref_service(), - microphone_requested, - webcam_requested, - &devices); + // Pick the desired device or fall back to the first available of the + // given type. + CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( + request.requested_audio_device_id, + microphone_requested, + false, + &devices); + + CefMediaCaptureDevicesDispatcher::GetInstance()->GetRequestedDevice( + request.requested_video_device_id, + false, + webcam_requested, + &devices); break; } }