From d21e30f57bf7121bfeced19a03e8fc93a4d7715c Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Fri, 26 Oct 2018 01:01:22 +0530 Subject: [PATCH] Reorganize MediaStreamType enums https://chromium-review.googlesource.com/c/chromium/src/+/1160000 --- .../media/media_stream_devices_controller.cc | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/atom/browser/media/media_stream_devices_controller.cc b/atom/browser/media/media_stream_devices_controller.cc index 534bd675d7..3ed306c64e 100644 --- a/atom/browser/media/media_stream_devices_controller.cc +++ b/atom/browser/media/media_stream_devices_controller.cc @@ -50,10 +50,10 @@ MediaStreamDevicesController::~MediaStreamDevicesController() { bool MediaStreamDevicesController::TakeAction() { // Do special handling of desktop screen cast. - if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || - request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE || - request_.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE || - request_.video_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { + if (request_.audio_type == content::MEDIA_GUM_TAB_AUDIO_CAPTURE || + request_.video_type == content::MEDIA_GUM_TAB_VIDEO_CAPTURE || + request_.audio_type == content::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE || + request_.video_type == content::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) { HandleUserMediaRequest(); return true; } @@ -154,19 +154,19 @@ void MediaStreamDevicesController::Deny( void MediaStreamDevicesController::HandleUserMediaRequest() { content::MediaStreamDevices devices; - if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) { - devices.push_back( - content::MediaStreamDevice(content::MEDIA_TAB_AUDIO_CAPTURE, "", "")); - } - if (request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE) { - devices.push_back( - content::MediaStreamDevice(content::MEDIA_TAB_VIDEO_CAPTURE, "", "")); - } - if (request_.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE) { + if (request_.audio_type == content::MEDIA_GUM_TAB_AUDIO_CAPTURE) { devices.push_back(content::MediaStreamDevice( - content::MEDIA_DESKTOP_AUDIO_CAPTURE, "loopback", "System Audio")); + content::MEDIA_GUM_TAB_AUDIO_CAPTURE, "", "")); } - if (request_.video_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { + if (request_.video_type == content::MEDIA_GUM_TAB_VIDEO_CAPTURE) { + devices.push_back(content::MediaStreamDevice( + content::MEDIA_GUM_TAB_VIDEO_CAPTURE, "", "")); + } + if (request_.audio_type == content::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE) { + devices.push_back(content::MediaStreamDevice( + content::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE, "loopback", "System Audio")); + } + if (request_.video_type == content::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) { content::DesktopMediaID screen_id; // If the device id wasn't specified then this is a screen capture request // (i.e. chooseDesktopMedia() API wasn't used to generate device id). @@ -178,8 +178,9 @@ void MediaStreamDevicesController::HandleUserMediaRequest() { content::DesktopMediaID::Parse(request_.requested_video_device_id); } - devices.push_back(content::MediaStreamDevice( - content::MEDIA_DESKTOP_VIDEO_CAPTURE, screen_id.ToString(), "Screen")); + devices.push_back( + content::MediaStreamDevice(content::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE, + screen_id.ToString(), "Screen")); } std::move(callback_).Run(devices,