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}
This commit is contained in:
Erik Språng
2019-04-08 15:14:01 +02:00
committed by Commit Bot
parent e893bfc336
commit 4c6ca30019
8 changed files with 306 additions and 212 deletions

View File

@ -78,10 +78,13 @@ class VideoStreamEncoderInterface : public rtc::VideoSinkInterface<VideoFrame> {
// 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;