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

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: Run Git Cl Format 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 | « media/audio/cras/cras_input.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..af63eabbe30536e3977b5a90afb761ffb983f547 100644
--- a/media/audio/cras/cras_input.cc
+++ b/media/audio/cras/cras_input.cc
@@ -27,8 +27,12 @@ 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),
+ mute_done_(false) {
DCHECK(audio_manager_);
audio_bus_ = AudioBus::Create(params_);
}
@@ -93,6 +97,12 @@ bool CrasInputStream::Open() {
client_ = NULL;
return false;
}
+
+ if (mute_system_audio_ && !cras_client_get_system_muted(client_)) {
+ cras_client_set_system_mute(client_, 1);
+ mute_done_ = true;
+ }
+
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 +241,11 @@ void CrasInputStream::Stop() {
if (!callback_ || !started_)
return;
+ if (mute_system_audio_ && mute_done_) {
DaleCurtis 2016/07/26 23:42:58 Open is called once, but Start()/Stop() may be cal
qiangchen 2016/07/27 17:23:48 Done.
+ cras_client_set_system_mute(client_, 0);
+ mute_done_ = false;
+ }
+
StopAgc();
// Removing the stream from the client stops audio.
« no previous file with comments | « media/audio/cras/cras_input.h ('k') | media/audio/win/audio_low_latency_input_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698