Add a function for enabling the congestion window and pushback controller in the webrtc::SendSideCongestionController.
Bug: webrtc:9923 Change-Id: Id01ebd7237ba33f34003aa9560405a13da7580e2 Reviewed-on: https://webrtc-review.googlesource.com/c/107893 Reviewed-by: Sebastian Jansson <srte@webrtc.org> Reviewed-by: Ying Wang <yinwa@webrtc.org> Commit-Queue: Erik Varga <erikvarga@webrtc.org> Cr-Commit-Position: refs/heads/master@{#25393}
This commit is contained in:

committed by
Commit Bot

parent
99b71dfd4a
commit
0f08d227c2
@ -47,6 +47,10 @@ CongestionWindowPushbackController::CongestionWindowPushbackController() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CongestionWindowPushbackController::CongestionWindowPushbackController(
|
||||||
|
uint32_t min_pushback_target_bitrate_bps)
|
||||||
|
: min_pushback_target_bitrate_bps_(min_pushback_target_bitrate_bps) {}
|
||||||
|
|
||||||
void CongestionWindowPushbackController::UpdateOutstandingData(
|
void CongestionWindowPushbackController::UpdateOutstandingData(
|
||||||
size_t outstanding_bytes) {
|
size_t outstanding_bytes) {
|
||||||
outstanding_bytes_ = outstanding_bytes;
|
outstanding_bytes_ = outstanding_bytes;
|
||||||
|
@ -23,6 +23,8 @@ namespace webrtc {
|
|||||||
class CongestionWindowPushbackController {
|
class CongestionWindowPushbackController {
|
||||||
public:
|
public:
|
||||||
CongestionWindowPushbackController();
|
CongestionWindowPushbackController();
|
||||||
|
explicit CongestionWindowPushbackController(
|
||||||
|
uint32_t min_pushback_target_bitrate_bps);
|
||||||
void UpdateOutstandingData(size_t outstanding_bytes);
|
void UpdateOutstandingData(size_t outstanding_bytes);
|
||||||
void UpdateMaxOutstandingData(size_t max_outstanding_bytes);
|
void UpdateMaxOutstandingData(size_t max_outstanding_bytes);
|
||||||
uint32_t UpdateTargetBitrate(uint32_t bitrate_bps);
|
uint32_t UpdateTargetBitrate(uint32_t bitrate_bps);
|
||||||
|
@ -113,6 +113,9 @@ class SendSideCongestionController
|
|||||||
|
|
||||||
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override;
|
void SetAllocatedBitrateWithoutFeedback(uint32_t bitrate_bps) override;
|
||||||
|
|
||||||
|
void EnableCongestionWindowPushback(int64_t accepted_queue_ms,
|
||||||
|
uint32_t min_pushback_target_bitrate_bps);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void MaybeTriggerOnNetworkChanged();
|
void MaybeTriggerOnNetworkChanged();
|
||||||
|
|
||||||
@ -161,7 +164,7 @@ class SendSideCongestionController
|
|||||||
bool pacer_pushback_experiment_ = false;
|
bool pacer_pushback_experiment_ = false;
|
||||||
float encoding_rate_ = 1.0;
|
float encoding_rate_ = 1.0;
|
||||||
|
|
||||||
const std::unique_ptr<CongestionWindowPushbackController>
|
std::unique_ptr<CongestionWindowPushbackController>
|
||||||
congestion_window_pushback_controller_;
|
congestion_window_pushback_controller_;
|
||||||
|
|
||||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController);
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController);
|
||||||
|
@ -164,6 +164,23 @@ SendSideCongestionController::SendSideCongestionController(
|
|||||||
|
|
||||||
SendSideCongestionController::~SendSideCongestionController() {}
|
SendSideCongestionController::~SendSideCongestionController() {}
|
||||||
|
|
||||||
|
void SendSideCongestionController::EnableCongestionWindowPushback(
|
||||||
|
int64_t accepted_queue_ms,
|
||||||
|
uint32_t min_pushback_target_bitrate_bps) {
|
||||||
|
RTC_DCHECK(!congestion_window_pushback_controller_)
|
||||||
|
<< "The congestion pushback is already enabled.";
|
||||||
|
RTC_CHECK_GE(accepted_queue_ms, 0)
|
||||||
|
<< "Accepted must be greater than or equal to 0.";
|
||||||
|
RTC_CHECK_GE(min_pushback_target_bitrate_bps, 0)
|
||||||
|
<< "Min pushback target bitrate must be greater than or equal to 0.";
|
||||||
|
|
||||||
|
in_cwnd_experiment_ = true;
|
||||||
|
accepted_queue_ms_ = accepted_queue_ms;
|
||||||
|
congestion_window_pushback_controller_ =
|
||||||
|
absl::make_unique<CongestionWindowPushbackController>(
|
||||||
|
min_pushback_target_bitrate_bps);
|
||||||
|
}
|
||||||
|
|
||||||
void SendSideCongestionController::RegisterPacketFeedbackObserver(
|
void SendSideCongestionController::RegisterPacketFeedbackObserver(
|
||||||
PacketFeedbackObserver* observer) {
|
PacketFeedbackObserver* observer) {
|
||||||
transport_feedback_adapter_.RegisterPacketFeedbackObserver(observer);
|
transport_feedback_adapter_.RegisterPacketFeedbackObserver(observer);
|
||||||
|
Reference in New Issue
Block a user