Routing BitrateAllocationUpdate to audio codec.
This will be used in a later CL to use the link capacity field in the
update to control the Opus encoder.
Bug: webrtc:9718
Change-Id: If2ad16a8f4656e8cdf10c33f5fb060ef7ca5caba
Reviewed-on: https://webrtc-review.googlesource.com/c/111510
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25761}
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index d89acd5..5d4966c 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -42,6 +42,7 @@
using testing::_;
using testing::Eq;
using testing::Ne;
+using testing::Field;
using testing::Invoke;
using testing::Return;
using testing::StrEq;
@@ -472,7 +473,9 @@
ConfigHelper helper(false, true);
auto send_stream = helper.CreateAudioSendStream();
EXPECT_CALL(*helper.channel_send(),
- SetBitrate(helper.config().max_bitrate_bps, _));
+ OnBitrateAllocation(
+ Field(&BitrateAllocationUpdate::target_bitrate,
+ Eq(DataRate::bps(helper.config().max_bitrate_bps)))));
BitrateAllocationUpdate update;
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
update.packet_loss_ratio = 0;
@@ -484,7 +487,10 @@
TEST(AudioSendStreamTest, ProbingIntervalOnBitrateUpdated) {
ConfigHelper helper(false, true);
auto send_stream = helper.CreateAudioSendStream();
- EXPECT_CALL(*helper.channel_send(), SetBitrate(_, 5000));
+
+ EXPECT_CALL(*helper.channel_send(),
+ OnBitrateAllocation(Field(&BitrateAllocationUpdate::bwe_period,
+ Eq(TimeDelta::ms(5000)))));
BitrateAllocationUpdate update;
update.target_bitrate = DataRate::bps(helper.config().max_bitrate_bps + 5000);
update.packet_loss_ratio = 0;