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

Unified Diff: media/audio/cras/cras_input.cc

Issue 2144333002: MuteSource Audio During Full Screen Cast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mute system audio for getUserMedia(audio:System) 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
Index: media/audio/cras/cras_input.cc
diff --git a/media/audio/cras/cras_input.cc b/media/audio/cras/cras_input.cc
index 0c24be94cafc50e7a0856182166973be986e178e..2ea4521889c15230f78021b60c5eb4b9025e5a1c 100644
--- a/media/audio/cras/cras_input.cc
+++ b/media/audio/cras/cras_input.cc
@@ -27,8 +27,11 @@ CrasInputStream::CrasInputStream(const AudioParameters& params,
stream_id_(0),
stream_direction_(CRAS_STREAM_INPUT),
pin_device_(NO_DEVICE),
- is_loopback_(device_id ==
- AudioDeviceDescription::kLoopbackInputDeviceId) {
+ is_loopback_(
+ device_id == AudioDeviceDescription::kLoopbackInputDeviceId ||
+ device_id == AudioDeviceDescription::kLoopbackWithMuteDeviceId),
+ mute_system_audio_(device_id ==
+ AudioDeviceDescription::kLoopbackWithMuteDeviceId) {
DCHECK(audio_manager_);
audio_bus_ = AudioBus::Create(params_);
}
@@ -93,6 +96,8 @@ bool CrasInputStream::Open() {
client_ = NULL;
return false;
}
+ if (mute_system_audio_)
+ cras_client_set_system_mute(client_, 1);
miu 2016/07/19 01:09:44 What if the system audio was already muted? Perhap
qiangchen 2016/07/20 22:13:22 Done.
pin_device_ = cras_client_get_first_dev_type_idx(client_,
CRAS_NODE_TYPE_POST_MIX_PRE_DSP, CRAS_STREAM_INPUT);
if (pin_device_ < 0) {
@@ -231,6 +236,10 @@ void CrasInputStream::Stop() {
if (!callback_ || !started_)
return;
+ if (mute_system_audio_) {
+ cras_client_set_system_mute(client_, 0);
+ }
+
StopAgc();
// Removing the stream from the client stops audio.

Powered by Google App Engine
This is Rietveld 408576698