Add AudioSendStream::SetMuted() method and use it in WVoMC::MuteStream().
Removes the need to use VoEVolume::SetInputMute()/GetInputMute().
BUG=webrtc:4690
NOTRY=true
Review-Url: https://codereview.webrtc.org/2066973002
Cr-Commit-Position: refs/heads/master@{#13172}
diff --git a/webrtc/audio/audio_send_stream.cc b/webrtc/audio/audio_send_stream.cc
index 9aa2fc0..d08bfea 100644
--- a/webrtc/audio/audio_send_stream.cc
+++ b/webrtc/audio/audio_send_stream.cc
@@ -127,6 +127,11 @@
channel_proxy_->SendTelephoneEventOutband(event, duration_ms);
}
+void AudioSendStream::SetMuted(bool muted) {
+ RTC_DCHECK(thread_checker_.CalledOnValidThread());
+ channel_proxy_->SetInputMute(muted);
+}
+
webrtc::AudioSendStream::Stats AudioSendStream::GetStats() const {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
webrtc::AudioSendStream::Stats stats;
diff --git a/webrtc/audio/audio_send_stream.h b/webrtc/audio/audio_send_stream.h
index 61dd7f2..264f9b3 100644
--- a/webrtc/audio/audio_send_stream.h
+++ b/webrtc/audio/audio_send_stream.h
@@ -39,6 +39,7 @@
void Stop() override;
bool SendTelephoneEvent(int payload_type, int event,
int duration_ms) override;
+ void SetMuted(bool muted) override;
webrtc::AudioSendStream::Stats GetStats() const override;
void SignalNetworkState(NetworkState state);
diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc
index 44392ea..b953554 100644
--- a/webrtc/audio/audio_send_stream_unittest.cc
+++ b/webrtc/audio/audio_send_stream_unittest.cc
@@ -110,6 +110,7 @@
AudioSendStream::Config& config() { return stream_config_; }
rtc::scoped_refptr<AudioState> audio_state() { return audio_state_; }
+ MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
CongestionController* congestion_controller() {
return &congestion_controller_;
}
@@ -200,6 +201,14 @@
kTelephoneEventCode, kTelephoneEventDuration));
}
+TEST(AudioSendStreamTest, SetMuted) {
+ ConfigHelper helper;
+ internal::AudioSendStream send_stream(helper.config(), helper.audio_state(),
+ helper.congestion_controller());
+ EXPECT_CALL(*helper.channel_proxy(), SetInputMute(true));
+ send_stream.SetMuted(true);
+}
+
TEST(AudioSendStreamTest, GetStats) {
ConfigHelper helper;
internal::AudioSendStream send_stream(helper.config(), helper.audio_state(),