Chromium Code Reviews| Index: webrtc/modules/congestion_controller/include/congestion_controller.h |
| diff --git a/webrtc/modules/congestion_controller/include/congestion_controller.h b/webrtc/modules/congestion_controller/include/congestion_controller.h |
| index 284070cc21ced91971fd7a08a04aeb2a7acd9cce..74ac2966ad5499dbffc79362004e8d968e8c76d8 100644 |
| --- a/webrtc/modules/congestion_controller/include/congestion_controller.h |
| +++ b/webrtc/modules/congestion_controller/include/congestion_controller.h |
| @@ -19,6 +19,7 @@ |
| #include "webrtc/modules/include/module.h" |
| #include "webrtc/modules/include/module_common_types.h" |
| #include "webrtc/modules/pacing/packet_router.h" |
| +#include "webrtc/modules/pacing/paced_sender.h" |
| #include "webrtc/modules/remote_bitrate_estimator/remote_estimator_proxy.h" |
| #include "webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.h" |
| @@ -31,17 +32,36 @@ namespace webrtc { |
| class BitrateController; |
| class BitrateObserver; |
| class Clock; |
| -class PacedSender; |
| class ProcessThread; |
| class RemoteBitrateEstimator; |
| class RemoteBitrateObserver; |
| class TransportFeedbackObserver; |
| +class CongestionObserver { |
|
stefan-webrtc
2016/05/02 12:56:47
Not sure what a good name for this would be... Net
perkj_webrtc
2016/05/02 14:45:35
Keep as is?
Or move to inner class of CongestionC
|
| + // 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 |
| + // also part of this callback to allow the obsevrer to optimize its settings |
| + // for different types of network environments. The bitrate does not include |
| + // packet headers and is measured in bits per second. |
| + public: |
| + virtual void OnNetworkChanged(uint32_t bitrate_bps, |
| + uint8_t fraction_loss, // 0 - 255. |
| + int64_t rtt_ms) = 0; |
| + |
| + protected: |
| + virtual ~CongestionObserver() {} |
| +}; |
| + |
| class CongestionController : public CallStatsObserver, public Module { |
| public: |
| CongestionController(Clock* clock, |
| - BitrateObserver* bitrate_observer, |
| + CongestionObserver* observer, |
| RemoteBitrateObserver* remote_bitrate_observer); |
| + CongestionController(Clock* clock, |
| + CongestionObserver* observer, |
| + RemoteBitrateObserver* remote_bitrate_observer, |
| + std::unique_ptr<PacketRouter> packet_router, |
| + std::unique_ptr<PacedSender> pacer); |
| virtual ~CongestionController(); |
| virtual void SetBweBitrates(int min_bitrate_bps, |
| @@ -53,12 +73,11 @@ class CongestionController : public CallStatsObserver, public Module { |
| bool send_side_bwe); |
| virtual int64_t GetPacerQueuingDelayMs() const; |
| virtual PacedSender* pacer() { return pacer_.get(); } |
| - virtual PacketRouter* packet_router() { return &packet_router_; } |
| + virtual PacketRouter* packet_router() { return packet_router_.get(); } |
| virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); |
| - virtual void UpdatePacerBitrate(int bitrate_kbps, |
| - int max_bitrate_kbps, |
| - int min_bitrate_kbps); |
| + void SetAllocatedSendBitrate(int allocated_bitrate_bps, |
| + int padding_bitrate_bps); |
| virtual void OnSentPacket(const rtc::SentPacket& sent_packet); |
| @@ -71,13 +90,19 @@ class CongestionController : public CallStatsObserver, public Module { |
| private: |
| Clock* const clock_; |
| + CongestionObserver* const observer_; |
| + const std::unique_ptr<PacketRouter> packet_router_; |
| const std::unique_ptr<PacedSender> pacer_; |
| const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
| const std::unique_ptr<BitrateController> bitrate_controller_; |
| - PacketRouter packet_router_; |
| RemoteEstimatorProxy remote_estimator_proxy_; |
| TransportFeedbackAdapter transport_feedback_adapter_; |
| int min_bitrate_bps_; |
| + bool send_queue_is_full_; |
| + |
| + void Init(); |
| + |
| + void MaybeTriggerOnNetworkChanged(); |
|
stefan-webrtc
2016/05/02 12:56:47
Methods before members
perkj_webrtc
2016/05/02 14:45:35
Done.
|
| RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
| }; |