Index: webrtc/modules/congestion_controller/include/send_side_congestion_controller.h |
diff --git a/webrtc/modules/congestion_controller/include/congestion_controller.h b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h |
similarity index 60% |
copy from webrtc/modules/congestion_controller/include/congestion_controller.h |
copy to webrtc/modules/congestion_controller/include/send_side_congestion_controller.h |
index 6b85f42b15a5695419f21c49202faa67bb40b86a..9aa4727196272cc8e8618964846eec21afaa97f2 100644 |
--- a/webrtc/modules/congestion_controller/include/congestion_controller.h |
+++ b/webrtc/modules/congestion_controller/include/send_side_congestion_controller.h |
@@ -8,8 +8,8 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
-#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
-#define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
+#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTROLLER_H_ |
+#define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTROLLER_H_ |
#include <memory> |
#include <vector> |
@@ -25,7 +25,6 @@ |
#include "webrtc/modules/include/module_common_types.h" |
#include "webrtc/modules/pacing/paced_sender.h" |
#include "webrtc/modules/pacing/packet_router.h" |
-#include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" |
namespace rtc { |
struct SentPacket; |
@@ -37,13 +36,11 @@ class BitrateController; |
class Clock; |
class ProbeController; |
class RateLimiter; |
-class RemoteBitrateEstimator; |
-class RemoteBitrateObserver; |
class RtcEventLog; |
-class CongestionController : public CallStatsObserver, |
- public Module, |
- public TransportFeedbackObserver { |
+class SendSideCongestionController : public CallStatsObserver, |
+ public Module, |
+ public TransportFeedbackObserver { |
public: |
// Observer class for bitrate changes announced due to change in bandwidth |
// estimate or due to that the send pacer is full. Fraction loss and rtt is |
@@ -60,28 +57,20 @@ class CongestionController : public CallStatsObserver, |
protected: |
virtual ~Observer() {} |
}; |
- CongestionController(const Clock* clock, |
- Observer* observer, |
- RemoteBitrateObserver* remote_bitrate_observer, |
- RtcEventLog* event_log, |
- PacketRouter* packet_router); |
- CongestionController(const Clock* clock, |
- Observer* observer, |
- RemoteBitrateObserver* remote_bitrate_observer, |
- RtcEventLog* event_log, |
- PacketRouter* packet_router, |
- std::unique_ptr<PacedSender> pacer); |
- virtual ~CongestionController(); |
- |
- virtual void OnReceivedPacket(int64_t arrival_time_ms, |
- size_t payload_size, |
- const RTPHeader& header); |
+ SendSideCongestionController(const Clock* clock, |
+ Observer* observer, |
+ RtcEventLog* event_log, |
+ PacketRouter* packet_router); |
+ SendSideCongestionController(const Clock* clock, |
+ Observer* observer, |
+ RtcEventLog* event_log, |
+ std::unique_ptr<PacedSender> pacer); |
+ virtual ~SendSideCongestionController(); |
virtual void SetBweBitrates(int min_bitrate_bps, |
int start_bitrate_bps, |
int max_bitrate_bps); |
- // Resets both the BWE state and the bitrate estimator. Note the first |
- // argument is the bitrate_bps. |
+ // Resets the BWE state. Note the first argument is the bitrate_bps. |
virtual void OnNetworkRouteChanged(const rtc::NetworkRoute& network_route, |
int bitrate_bps, |
int min_bitrate_bps, |
@@ -90,8 +79,6 @@ class CongestionController : public CallStatsObserver, |
virtual void SetTransportOverhead(size_t transport_overhead_bytes_per_packet); |
virtual BitrateController* GetBitrateController() const; |
- virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( |
- bool send_side_bwe); |
virtual int64_t GetPacerQueuingDelayMs() const; |
// TODO(nisse): Delete this accessor function. The pacer should be |
// internal to the congestion controller. |
@@ -106,12 +93,11 @@ class CongestionController : public CallStatsObserver, |
// settings. |
// |min_send_bitrate_bps| is the total minimum send bitrate required by all |
// sending streams. This is the minimum bitrate the PacedSender will use. |
- // Note that CongestionController::OnNetworkChanged can still be called with |
- // a lower bitrate estimate. |
- // |max_padding_bitrate_bps| is the max bitrate the send streams request for |
- // padding. This can be higher than the current network estimate and tells |
- // the PacedSender how much it should max pad unless there is real packets to |
- // send. |
+ // Note that SendSideCongestionController::OnNetworkChanged can still be |
+ // called with a lower bitrate estimate. |max_padding_bitrate_bps| is the max |
+ // bitrate the send streams request for padding. This can be higher than the |
+ // current network estimate and tells the PacedSender how much it should max |
+ // pad unless there is real packets to send. |
void SetAllocatedSendBitrateLimits(int min_send_bitrate_bps, |
int max_padding_bitrate_bps); |
@@ -132,45 +118,6 @@ class CongestionController : public CallStatsObserver, |
std::vector<PacketFeedback> GetTransportFeedbackVector() const override; |
private: |
- class WrappingBitrateEstimator : public RemoteBitrateEstimator { |
- public: |
- WrappingBitrateEstimator(RemoteBitrateObserver* observer, |
- const Clock* clock); |
- |
- virtual ~WrappingBitrateEstimator() {} |
- |
- void IncomingPacket(int64_t arrival_time_ms, |
- size_t payload_size, |
- const RTPHeader& header) override; |
- |
- void Process() override; |
- |
- int64_t TimeUntilNextProcess() override; |
- |
- void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
- |
- void RemoveStream(unsigned int ssrc) override; |
- |
- bool LatestEstimate(std::vector<unsigned int>* ssrcs, |
- unsigned int* bitrate_bps) const override; |
- |
- void SetMinBitrate(int min_bitrate_bps) override; |
- |
- private: |
- void PickEstimatorFromHeader(const RTPHeader& header) |
- EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
- void PickEstimator() EXCLUSIVE_LOCKS_REQUIRED(crit_sect_); |
- RemoteBitrateObserver* observer_; |
- const Clock* const clock_; |
- rtc::CriticalSection crit_sect_; |
- std::unique_ptr<RemoteBitrateEstimator> rbe_; |
- bool using_absolute_send_time_; |
- uint32_t packets_since_absolute_send_time_; |
- int min_bitrate_bps_; |
- |
- RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WrappingBitrateEstimator); |
- }; |
- |
void MaybeTriggerOnNetworkChanged(); |
bool IsSendQueueFull() const; |
@@ -181,13 +128,10 @@ class CongestionController : public CallStatsObserver, |
const Clock* const clock_; |
Observer* const observer_; |
RtcEventLog* const event_log_; |
- PacketRouter* const packet_router_; |
const std::unique_ptr<PacedSender> pacer_; |
const std::unique_ptr<BitrateController> bitrate_controller_; |
const std::unique_ptr<ProbeController> probe_controller_; |
const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
- WrappingBitrateEstimator remote_bitrate_estimator_; |
- RemoteEstimatorProxy remote_estimator_proxy_; |
TransportFeedbackAdapter transport_feedback_adapter_; |
rtc::CriticalSection network_state_lock_; |
uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); |
@@ -200,9 +144,9 @@ class CongestionController : public CallStatsObserver, |
rtc::ThreadChecker worker_thread_checker_; |
- RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
+ RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); |
}; |
} // namespace webrtc |
-#endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
+#endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTROLLER_H_ |