Wire up BitrateAllocation to be sent as RTCP TargetBitrate

This is the video parts of https://codereview.webrtc.org/2531383002/
Wire up BitrateAllocation to be sent as RTCP TargetBitrate

BUG=webrtc:6301

Review-Url: https://codereview.webrtc.org/2541303003
Cr-Commit-Position: refs/heads/master@{#15359}
This commit is contained in:
sprang
2016-12-01 06:34:11 -08:00
committed by Commit bot
parent 5e38c967e0
commit 1a646ee522
12 changed files with 270 additions and 138 deletions

View File

@ -312,7 +312,7 @@ TEST_F(TestVideoSenderWithMockEncoder, TestSetRate) {
.Times(1)
.WillOnce(Return(0));
sender_->SetChannelParameters(new_bitrate_kbps * 1000, 0, 200,
rate_allocator_.get());
rate_allocator_.get(), nullptr);
AddFrame();
clock_.AdvanceTimeMilliseconds(kFrameIntervalMs);
@ -334,7 +334,7 @@ TEST_F(TestVideoSenderWithMockEncoder, TestSetRate) {
// Expect no call to encoder_.SetRates if the new bitrate is zero.
EXPECT_CALL(encoder_, SetRateAllocation(_, _)).Times(0);
sender_->SetChannelParameters(0, 0, 200, rate_allocator_.get());
sender_->SetChannelParameters(0, 0, 200, rate_allocator_.get(), nullptr);
AddFrame();
}
@ -372,12 +372,12 @@ TEST_F(TestVideoSenderWithMockEncoder, TestEncoderParametersForInternalSource) {
.Times(1)
.WillOnce(Return(0));
sender_->SetChannelParameters(new_bitrate_kbps * 1000, 0, 200,
rate_allocator_.get());
rate_allocator_.get(), nullptr);
}
TEST_F(TestVideoSenderWithMockEncoder, EncoderFramerateUpdatedViaProcess) {
sender_->SetChannelParameters(settings_.startBitrate * 1000, 0, 200,
rate_allocator_.get());
rate_allocator_.get(), nullptr);
const int64_t kRateStatsWindowMs = 2000;
const uint32_t kInputFps = 20;
int64_t start_time = clock_.TimeInMilliseconds();
@ -406,7 +406,7 @@ TEST_F(TestVideoSenderWithMockEncoder,
.Times(1)
.WillOnce(Return(0));
sender_->SetChannelParameters(settings_.startBitrate * 1000, kLossRate, kRtt,
rate_allocator_.get());
rate_allocator_.get(), nullptr);
while (clock_.TimeInMilliseconds() < start_time + kRateStatsWindowMs) {
AddFrame();
clock_.AdvanceTimeMilliseconds(1000 / kInputFps);
@ -427,7 +427,7 @@ TEST_F(TestVideoSenderWithMockEncoder,
.Times(1)
.WillOnce(Return(0));
sender_->SetChannelParameters(new_bitrate_bps, kLossRate, kRtt,
rate_allocator_.get());
rate_allocator_.get(), nullptr);
AddFrame();
}
@ -481,9 +481,9 @@ class TestVideoSenderWithVp8 : public TestVideoSender {
// Note: SetChannelParameters fails if less than 2 frames are in the
// buffer since it will fail to calculate the framerate.
if (i != 0) {
EXPECT_EQ(VCM_OK,
sender_->SetChannelParameters(available_bitrate_kbps_ * 1000,
0, 200, rate_allocator_.get()));
EXPECT_EQ(VCM_OK, sender_->SetChannelParameters(
available_bitrate_kbps_ * 1000, 0, 200,
rate_allocator_.get(), nullptr));
}
}
}