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

Unified Diff: chrome/browser/media/desktop_capture_access_handler.cc

Issue 2144333002: MuteSource Audio During Full Screen Cast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/desktop_capture_access_handler.cc
diff --git a/chrome/browser/media/desktop_capture_access_handler.cc b/chrome/browser/media/desktop_capture_access_handler.cc
index 6aa8d20f3160666abbc341c6375dc26af9399d4f..19577a2ae691db22f867301feca4faf61a866f3a 100644
--- a/chrome/browser/media/desktop_capture_access_handler.cc
+++ b/chrome/browser/media/desktop_capture_access_handler.cc
@@ -140,6 +140,7 @@ std::unique_ptr<content::MediaStreamUI> GetDevicesForDesktopCapture(
content::MediaStreamDevices* devices,
content::DesktopMediaID media_id,
bool capture_audio,
+ bool mute_system_audio,
bool display_notification,
const base::string16& application_title,
const base::string16& registered_extension_name) {
@@ -154,6 +155,12 @@ std::unique_ptr<content::MediaStreamUI> GetDevicesForDesktopCapture(
devices->push_back(
content::MediaStreamDevice(content::MEDIA_DESKTOP_AUDIO_CAPTURE,
media_id.ToString(), "Tab audio"));
+ } else if (mute_system_audio) {
+ // Use the special loopback device ID for system audio capture.
+ devices->push_back(content::MediaStreamDevice(
+ content::MEDIA_DESKTOP_AUDIO_CAPTURE,
+ media::AudioDeviceDescription::kLoopbackWithMuteDeviceId,
+ "System Audio"));
} else {
// Use the special loopback device ID for system audio capture.
devices->push_back(content::MediaStreamDevice(
@@ -309,7 +316,7 @@ void DesktopCaptureAccessHandler::ProcessScreenCaptureAccessRequest(
// display the notification for stream capture.
bool display_notification = !component_extension;
- ui = GetDevicesForDesktopCapture(&devices, screen_id, capture_audio,
+ ui = GetDevicesForDesktopCapture(&devices, screen_id, capture_audio, true,
display_notification, application_title,
application_title);
DCHECK(!devices.empty());
@@ -418,7 +425,8 @@ void DesktopCaptureAccessHandler::HandleRequest(
(check_audio_permission ? audio_permitted : true) && audio_requested &&
audio_supported;
- ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, true,
+ ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, false,
+ true,
GetApplicationTitle(web_contents, extension),
base::UTF8ToUTF16(original_extension_name));
UpdateExtensionTrusted(request, extension);
« no previous file with comments | « no previous file | content/browser/renderer_host/media/audio_input_renderer_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698