Update VideoStreamEncoder to use new VideoEncoder::SetRates() method.
This CL wires up the new SetRates() method of the video encoders, and
refactors a few things in the process:
Most notably, the VideoStreamEncoderInterface is update so that the
|target_headroom| parameter is replaced with |link_allocation|, meaning
that instead of indicating bitrate capacity in excess of the target
bitrate, it indicates to total network capacity allocated for the
stream including the target bitrate. This matches the VideoEncoder API.
The VideoEncoder::RateControlParameters struct gets a few new helper
methods.
In VideoStreamEncoder, instead of adding more fields to the
|last_observed_bitrate*| family, uses an optional struct that
inherits from VideoEncoder::RateControlParameters.
Bug: webrtc:10481
Change-Id: Iee3965531142ae9b964ed86c0d51db59b1cdd61c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/131123
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27487}
diff --git a/api/video/video_stream_encoder_interface.h b/api/video/video_stream_encoder_interface.h
index b6fed6b..5463118 100644
--- a/api/video/video_stream_encoder_interface.h
+++ b/api/video/video_stream_encoder_interface.h
@@ -78,10 +78,13 @@
// Request a key frame. Used for signalling from the remote receiver.
virtual void SendKeyFrame() = 0;
- // Set the currently estimated network properties. A |bitrate_bps|
+ // Set the currently estimated network properties. A |target_bitrate|
// of zero pauses the encoder.
+ // |link_allocation| is the bandwidth available for this video stream on the
+ // network link. It is always at least |target_bitrate| but may be higher
+ // if we are not network constrained.
virtual void OnBitrateUpdated(DataRate target_bitrate,
- DataRate target_headroom,
+ DataRate link_allocation,
uint8_t fraction_lost,
int64_t round_trip_time_ms) = 0;