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

Unified Diff: media/audio/fake_audio_input_stream.cc

Issue 2919793002: Detect AudioInputStream muting and propagate to MediaStreamAudioSource. (Closed)
Patch Set: Reworked test again, to make tsan2 happy. Created 3 years, 6 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/fake_audio_input_stream.h ('k') | media/base/audio_capturer_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/fake_audio_input_stream.cc
diff --git a/media/audio/fake_audio_input_stream.cc b/media/audio/fake_audio_input_stream.cc
index 52d7218d2870da974913803fe97a1989f290f4e3..188d05c7fb131def740fb0c86322545735e924fd 100644
--- a/media/audio/fake_audio_input_stream.cc
+++ b/media/audio/fake_audio_input_stream.cc
@@ -4,6 +4,7 @@
#include "media/audio/fake_audio_input_stream.h"
+#include "base/atomicops.h"
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/command_line.h"
@@ -19,6 +20,10 @@
namespace media {
+namespace {
+base::subtle::AtomicWord g_fake_input_streams_are_muted = 0;
+}
+
AudioInputStream* FakeAudioInputStream::MakeFakeStream(
AudioManagerBase* manager,
const AudioParameters& params) {
@@ -81,7 +86,7 @@ double FakeAudioInputStream::GetVolume() {
bool FakeAudioInputStream::IsMuted() {
DCHECK(audio_manager_->GetTaskRunner()->BelongsToCurrentThread());
- return false;
+ return base::subtle::NoBarrier_Load(&g_fake_input_streams_are_muted) != 0;
}
bool FakeAudioInputStream::SetAutomaticGainControl(bool enabled) {
@@ -136,4 +141,9 @@ void FakeAudioInputStream::BeepOnce() {
BeepingSource::BeepOnce();
}
+void FakeAudioInputStream::SetGlobalMutedState(bool is_muted) {
+ base::subtle::NoBarrier_Store(&g_fake_input_streams_are_muted,
+ (is_muted ? 1 : 0));
+}
+
} // namespace media
« no previous file with comments | « media/audio/fake_audio_input_stream.h ('k') | media/base/audio_capturer_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698