Replace interfaces for sending RTCP with std::functions in ReceiveSideCongestionController

Logic for throttling how often REMB messages are sent is added to ReceiveSideCongestionController as well as a new method SetMaxDesiredReceiveBitrate. These are based on the logic in PacketRouter. The logic for throttling REMB and setting the max REMB will be removed from PacketRouter in a follow up cl.
The purpose is to eventually decouple PacketRouter from sending RTCP messages when RtcpTransceiver is used.

Bug: webrtc:12693
Change-Id: I9fb5cbcd14bb17d977e76d329a906fc0a9abc276
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215685
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Per Kjellander <perkj@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#33801}
This commit is contained in:
Per Kjellander
2021-04-21 11:56:32 +02:00
committed by Commit Bot
parent 1585587c57
commit 898f091eeb
11 changed files with 330 additions and 83 deletions

View File

@ -16,7 +16,10 @@
#include "api/transport/field_trial_based_config.h"
#include "api/transport/network_control.h"
#include "api/units/data_rate.h"
#include "modules/congestion_controller/remb_throttler.h"
#include "modules/include/module.h"
#include "modules/pacing/packet_router.h"
#include "modules/remote_bitrate_estimator/remote_estimator_proxy.h"
#include "rtc_base/synchronization/mutex.h"
@ -32,12 +35,20 @@ class RemoteBitrateObserver;
class ReceiveSideCongestionController : public CallStatsObserver,
public Module {
public:
// TODO(bugs.webrtc.org/12693): Deprecate
ReceiveSideCongestionController(Clock* clock, PacketRouter* packet_router);
// TODO(bugs.webrtc.org/12693): Deprecate
ReceiveSideCongestionController(
Clock* clock,
PacketRouter* packet_router,
NetworkStateEstimator* network_state_estimator);
ReceiveSideCongestionController(
Clock* clock,
RemoteEstimatorProxy::TransportFeedbackSender feedback_sender,
RembThrottler::RembSender remb_sender,
NetworkStateEstimator* network_state_estimator);
~ReceiveSideCongestionController() override {}
virtual void OnReceivedPacket(int64_t arrival_time_ms,
@ -56,6 +67,10 @@ class ReceiveSideCongestionController : public CallStatsObserver,
// This is send bitrate, used to control the rate of feedback messages.
void OnBitrateChanged(int bitrate_bps);
// Ensures the remote party is notified of the receive bitrate no larger than
// |bitrate| using RTCP REMB.
void SetMaxDesiredReceiveBitrate(DataRate bitrate);
// Implements Module.
int64_t TimeUntilNextProcess() override;
void Process() override;
@ -103,6 +118,7 @@ class ReceiveSideCongestionController : public CallStatsObserver,
};
const FieldTrialBasedConfig field_trial_config_;
RembThrottler remb_throttler_;
WrappingBitrateEstimator remote_bitrate_estimator_;
RemoteEstimatorProxy remote_estimator_proxy_;
};