This reland https://codereview.webrtc.org/1932683002/.
Remove ViEEncoder::SetNetworkStatus. Original cl description: This cl removed ViEEncoder::SetNetworkStatus. Instead the PacedSender will report that frames can not be sent when the network is down and the BitrateController will report an estimated available bandwidth of 0 bps. Patchset #1 is a pure reland. Patchset #2 change the bitrate allocator to always return an initial bitrate >0 regardless of the estimates. The observer will be notified though if the network is down. BUG=webrtc:5687 Review-Url: https://codereview.webrtc.org/1972183004 Cr-Commit-Position: refs/heads/master@{#12743}
This commit is contained in:
@ -228,6 +228,10 @@ int32_t VideoSender::SetChannelParameters(uint32_t target_bitrate,
|
||||
}
|
||||
|
||||
void VideoSender::SetEncoderParameters(EncoderParameters params) {
|
||||
// |target_bitrate == 0 | means that the network is down or the send pacer is
|
||||
// full.
|
||||
// TODO(perkj): Consider setting |target_bitrate| == 0 to the encoders.
|
||||
// Especially if |encoder_has_internal_source_ | == true.
|
||||
if (params.target_bitrate == 0)
|
||||
return;
|
||||
|
||||
|
||||
@ -292,6 +292,18 @@ TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequests) {
|
||||
AddFrame();
|
||||
}
|
||||
|
||||
TEST_F(TestVideoSenderWithMockEncoder, TestSetRate) {
|
||||
const uint32_t new_bitrate = settings_.startBitrate + 300;
|
||||
EXPECT_CALL(encoder_, SetRates(new_bitrate, _)).Times(1).WillOnce(Return(0));
|
||||
sender_->SetChannelParameters(new_bitrate * 1000, 0, 200);
|
||||
AddFrame();
|
||||
|
||||
// Expect no call to encoder_.SetRates if the new bitrate is zero.
|
||||
EXPECT_CALL(encoder_, SetRates(new_bitrate, _)).Times(0);
|
||||
sender_->SetChannelParameters(0, 0, 200);
|
||||
AddFrame();
|
||||
}
|
||||
|
||||
TEST_F(TestVideoSenderWithMockEncoder, TestIntraRequestsInternalCapture) {
|
||||
// De-register current external encoder.
|
||||
sender_->RegisterExternalEncoder(nullptr, kUnusedPayloadType, false);
|
||||
|
||||
Reference in New Issue
Block a user