Add AudioReceiveStream::SetGain() method and use that in WVoMC::SetOutputVolume().
Removes the need to use VoEVolume::SetChannelOutputVolumeScaling().
BUG=webrtc:4690
Review-Url: https://codereview.webrtc.org/2062193002
Cr-Commit-Position: refs/heads/master@{#13194}
diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc
index 2e789f9..8e26dd9 100644
--- a/webrtc/audio/audio_receive_stream_unittest.cc
+++ b/webrtc/audio/audio_receive_stream_unittest.cc
@@ -30,6 +30,7 @@
namespace {
using testing::_;
+using testing::FloatEq;
using testing::Return;
using testing::ReturnRef;
@@ -92,12 +93,12 @@
EXPECT_CALL(*channel_proxy_,
SetReceiveAudioLevelIndicationStatus(true, kAudioLevelId))
.Times(1);
- EXPECT_CALL(*channel_proxy_, EnableReceiveTransportSequenceNumber(
- kTransportSequenceNumberId))
- .Times(1);
EXPECT_CALL(*channel_proxy_,
- RegisterReceiverCongestionControlObjects(&packet_router_))
- .Times(1);
+ EnableReceiveTransportSequenceNumber(kTransportSequenceNumberId))
+ .Times(1);
+ EXPECT_CALL(*channel_proxy_,
+ RegisterReceiverCongestionControlObjects(&packet_router_))
+ .Times(1);
EXPECT_CALL(congestion_controller_, packet_router())
.WillOnce(Return(&packet_router_));
EXPECT_CALL(*channel_proxy_, ResetCongestionControlObjects())
@@ -303,7 +304,6 @@
EXPECT_TRUE(recv_stream.DeliverRtcp(&rtcp_packet[0], rtcp_packet.size()));
}
-
TEST(AudioReceiveStreamTest, GetStats) {
ConfigHelper helper;
internal::AudioReceiveStream recv_stream(
@@ -345,5 +345,14 @@
EXPECT_EQ(kCallStats.capture_start_ntp_time_ms_,
stats.capture_start_ntp_time_ms);
}
+
+TEST(AudioReceiveStreamTest, SetGain) {
+ ConfigHelper helper;
+ internal::AudioReceiveStream recv_stream(
+ helper.congestion_controller(), helper.config(), helper.audio_state());
+ EXPECT_CALL(*helper.channel_proxy(),
+ SetChannelOutputVolumeScaling(FloatEq(0.765f)));
+ recv_stream.SetGain(0.765f);
+}
} // namespace test
} // namespace webrtc