Stop using VideoBitrateAllocationObserver in VideoStreamEncoder.

VideoBitrateAllocation is instead reported through the EncoderSink.
Enable VideoBitrateAllocation reporting from WebRtcVideoChannel::AddSendStream in preparation for
using the extension RtpVideoLayersAllocationExtension instead of RTCP XR.

Bug: webrtc:12000
Change-Id: I5ea8e4f237a1c4e84a89cbfd97ac4353d4c2984f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186940
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32347}
This commit is contained in:
Per Kjellander
2020-10-07 15:09:05 +02:00
committed by Commit Bot
parent 5c71f779e9
commit dcef6410b3
11 changed files with 142 additions and 103 deletions

View File

@ -49,6 +49,9 @@ class VideoStreamEncoderInterface : public rtc::VideoSinkInterface<VideoFrame> {
bool is_svc,
VideoEncoderConfig::ContentType content_type,
int min_transmit_bitrate_bps) = 0;
virtual void OnBitrateAllocationUpdated(
const VideoBitrateAllocation& allocation) = 0;
};
// If the resource is overusing, the VideoStreamEncoder will try to reduce
@ -110,11 +113,6 @@ class VideoStreamEncoderInterface : public rtc::VideoSinkInterface<VideoFrame> {
int64_t round_trip_time_ms,
double cwnd_reduce_ratio) = 0;
// Register observer for the bitrate allocation between the temporal
// and spatial layers.
virtual void SetBitrateAllocationObserver(
VideoBitrateAllocationObserver* bitrate_observer) = 0;
// Set a FecControllerOverride, through which the encoder may override
// decisions made by FecController.
virtual void SetFecControllerOverride(

View File

@ -39,6 +39,12 @@ class EncoderSwitchRequestCallback {
};
struct VideoStreamEncoderSettings {
enum class BitrateAllocationCallbackType {
kVideoBitrateAllocation,
kVideoBitrateAllocationWhenScreenSharing,
kVideoLayersAllocation
};
explicit VideoStreamEncoderSettings(
const VideoEncoder::Capabilities& capabilities)
: capabilities(capabilities) {}
@ -59,6 +65,11 @@ struct VideoStreamEncoderSettings {
// Negotiated capabilities which the VideoEncoder may expect the other
// side to use.
VideoEncoder::Capabilities capabilities;
// TODO(bugs.webrtc.org/12000): Reporting of VideoBitrateAllocation is beeing
// deprecated. Instead VideoLayersAllocation should be reported.
BitrateAllocationCallbackType allocation_cb_type =
BitrateAllocationCallbackType::kVideoBitrateAllocationWhenScreenSharing;
};
} // namespace webrtc