Reorganize MediaStreamType enums

https://chromium-review.googlesource.com/c/chromium/src/+/1160000
This commit is contained in:
deepak1556 2018-10-26 01:01:22 +05:30
parent d1da0aad7f
commit d21e30f57b

View file

@ -50,10 +50,10 @@ MediaStreamDevicesController::~MediaStreamDevicesController() {
bool MediaStreamDevicesController::TakeAction() { bool MediaStreamDevicesController::TakeAction() {
// Do special handling of desktop screen cast. // Do special handling of desktop screen cast.
if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE || if (request_.audio_type == content::MEDIA_GUM_TAB_AUDIO_CAPTURE ||
request_.video_type == content::MEDIA_TAB_VIDEO_CAPTURE || request_.video_type == content::MEDIA_GUM_TAB_VIDEO_CAPTURE ||
request_.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE || request_.audio_type == content::MEDIA_GUM_DESKTOP_AUDIO_CAPTURE ||
request_.video_type == content::MEDIA_DESKTOP_VIDEO_CAPTURE) { request_.video_type == content::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE) {
HandleUserMediaRequest(); HandleUserMediaRequest();
return true; return true;
} }
@ -154,19 +154,19 @@ void MediaStreamDevicesController::Deny(
void MediaStreamDevicesController::HandleUserMediaRequest() { void MediaStreamDevicesController::HandleUserMediaRequest() {
content::MediaStreamDevices devices; content::MediaStreamDevices devices;
if (request_.audio_type == content::MEDIA_TAB_AUDIO_CAPTURE) { if (request_.audio_type == content::MEDIA_GUM_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) {
devices.push_back(content::MediaStreamDevice( 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; content::DesktopMediaID screen_id;
// If the device id wasn't specified then this is a screen capture request // 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). // (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); content::DesktopMediaID::Parse(request_.requested_video_device_id);
} }
devices.push_back(content::MediaStreamDevice( devices.push_back(
content::MEDIA_DESKTOP_VIDEO_CAPTURE, screen_id.ToString(), "Screen")); content::MediaStreamDevice(content::MEDIA_GUM_DESKTOP_VIDEO_CAPTURE,
screen_id.ToString(), "Screen"));
} }
std::move(callback_).Run(devices, std::move(callback_).Run(devices,