Connect the stable target rate to the video encoders
The stable target rate is used to make smarter choices in the rate to chose which layers to enable in SVC or simulcast modes. the addition of hysteresis, we can improve a call quality by reducing the amount of resolution switch. Bug: webrtc:10126 Change-Id: I04d0df9e6bbe247e2f2a668207ff74d475e2464c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/150642 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Florent Castelli <orphis@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29112}
This commit is contained in:
committed by
Commit Bot
parent
ddef8d1b6b
commit
a8336d3cf4
@ -659,15 +659,17 @@ TEST_F(VideoSendStreamImplTest, CallsVideoStreamEncoderOnBitrateUpdate) {
|
||||
DataRate::bps(qvga_stream.target_bitrate_bps);
|
||||
BitrateAllocationUpdate update;
|
||||
update.target_bitrate = network_constrained_rate;
|
||||
update.stable_target_bitrate = network_constrained_rate;
|
||||
update.round_trip_time = TimeDelta::ms(1);
|
||||
EXPECT_CALL(rtp_video_sender_,
|
||||
OnBitrateUpdated(network_constrained_rate.bps(), _,
|
||||
update.round_trip_time.ms(), _));
|
||||
EXPECT_CALL(rtp_video_sender_, GetPayloadBitrateBps())
|
||||
.WillOnce(Return(network_constrained_rate.bps()));
|
||||
EXPECT_CALL(video_stream_encoder_,
|
||||
OnBitrateUpdated(network_constrained_rate,
|
||||
network_constrained_rate, 0, _));
|
||||
EXPECT_CALL(
|
||||
video_stream_encoder_,
|
||||
OnBitrateUpdated(network_constrained_rate, network_constrained_rate,
|
||||
network_constrained_rate, 0, _));
|
||||
static_cast<BitrateAllocatorObserver*>(vss_impl.get())
|
||||
->OnBitrateUpdated(update);
|
||||
|
||||
@ -683,8 +685,10 @@ TEST_F(VideoSendStreamImplTest, CallsVideoStreamEncoderOnBitrateUpdate) {
|
||||
EXPECT_CALL(rtp_video_sender_, GetPayloadBitrateBps())
|
||||
.WillOnce(Return(rate_with_headroom.bps()));
|
||||
EXPECT_CALL(video_stream_encoder_,
|
||||
OnBitrateUpdated(qvga_max_bitrate, rate_with_headroom, 0, _));
|
||||
OnBitrateUpdated(qvga_max_bitrate, qvga_max_bitrate,
|
||||
rate_with_headroom, 0, _));
|
||||
update.target_bitrate = rate_with_headroom;
|
||||
update.stable_target_bitrate = rate_with_headroom;
|
||||
static_cast<BitrateAllocatorObserver*>(vss_impl.get())
|
||||
->OnBitrateUpdated(update);
|
||||
|
||||
@ -701,9 +705,9 @@ TEST_F(VideoSendStreamImplTest, CallsVideoStreamEncoderOnBitrateUpdate) {
|
||||
.WillOnce(Return(rate_with_headroom.bps()));
|
||||
const DataRate headroom_minus_protection =
|
||||
rate_with_headroom - DataRate::bps(protection_bitrate_bps);
|
||||
EXPECT_CALL(
|
||||
video_stream_encoder_,
|
||||
OnBitrateUpdated(qvga_max_bitrate, headroom_minus_protection, 0, _));
|
||||
EXPECT_CALL(video_stream_encoder_,
|
||||
OnBitrateUpdated(qvga_max_bitrate, qvga_max_bitrate,
|
||||
headroom_minus_protection, 0, _));
|
||||
static_cast<BitrateAllocatorObserver*>(vss_impl.get())
|
||||
->OnBitrateUpdated(update);
|
||||
|
||||
@ -717,13 +721,15 @@ TEST_F(VideoSendStreamImplTest, CallsVideoStreamEncoderOnBitrateUpdate) {
|
||||
EXPECT_CALL(rtp_video_sender_, GetPayloadBitrateBps())
|
||||
.WillOnce(Return(rate_with_headroom.bps()));
|
||||
EXPECT_CALL(video_stream_encoder_,
|
||||
OnBitrateUpdated(qvga_max_bitrate, qvga_max_bitrate, 0, _));
|
||||
OnBitrateUpdated(qvga_max_bitrate, qvga_max_bitrate,
|
||||
qvga_max_bitrate, 0, _));
|
||||
static_cast<BitrateAllocatorObserver*>(vss_impl.get())
|
||||
->OnBitrateUpdated(update);
|
||||
|
||||
// Set rates to zero on stop.
|
||||
EXPECT_CALL(video_stream_encoder_,
|
||||
OnBitrateUpdated(DataRate::Zero(), DataRate::Zero(), 0, 0));
|
||||
OnBitrateUpdated(DataRate::Zero(), DataRate::Zero(),
|
||||
DataRate::Zero(), 0, 0));
|
||||
vss_impl->Stop();
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user