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

Unified Diff: content/renderer/media/media_stream_source.cc

Issue 2922733002: Propagate muted state from MediaStreamAudioSource into JS. (Closed)
Patch Set: Rebase: FakeAudioInputStream changes moved into earlier CL 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
Index: content/renderer/media/media_stream_source.cc
diff --git a/content/renderer/media/media_stream_source.cc b/content/renderer/media/media_stream_source.cc
index 3334bfd57120d66fa4bbd13cac1a12a50d968479..97b34d8340b39df103fc558cfc74d61e3734890f 100644
--- a/content/renderer/media/media_stream_source.cc
+++ b/content/renderer/media/media_stream_source.cc
@@ -26,6 +26,14 @@ void MediaStreamSource::StopSource() {
Owner().SetReadyState(blink::WebMediaStreamSource::kReadyStateEnded);
}
+void MediaStreamSource::SetSourceMuted(bool is_muted) {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ // TODO(ossu): Check that we only go between Muted and Live, not from Ended.
miu 2017/06/19 19:40:37 Instead of this TODO, why not: DCHECK_NE(readyS
ossu-chromium 2017/06/26 16:06:14 I considered that but am a bit worried that we may
miu 2017/06/26 23:01:08 Nice! No TODO here anymore. :)
+ Owner().SetReadyState(is_muted
+ ? blink::WebMediaStreamSource::kReadyStateMuted
+ : blink::WebMediaStreamSource::kReadyStateLive);
+}
+
void MediaStreamSource::SetDeviceInfo(const StreamDeviceInfo& device_info) {
DCHECK(thread_checker_.CalledOnValidThread());
device_info_ = device_info;

Powered by Google App Engine
This is Rietveld 408576698