Index: webrtc/call/congestion_controller.h |
diff --git a/webrtc/call/congestion_controller.h b/webrtc/call/congestion_controller.h |
index a1c1b853ffa1aa2d71d88ca2ee2cc8b3663a4d74..4e7db3835a74b247987c97018f71237e7d6dc9fa 100644 |
--- a/webrtc/call/congestion_controller.h |
+++ b/webrtc/call/congestion_controller.h |
@@ -12,6 +12,9 @@ |
#define WEBRTC_CALL_CONGESTION_CONTROLLER_H_ |
#include "webrtc/base/scoped_ptr.h" |
+#include "webrtc/base/thread_checker.h" |
+#include "webrtc/modules/include/module.h" |
+#include "webrtc/modules/include/module_common_types.h" |
#include "webrtc/stream.h" |
namespace rtc { |
@@ -22,7 +25,6 @@ namespace webrtc { |
class BitrateController; |
class BitrateObserver; |
-class CallStats; |
class Clock; |
class PacedSender; |
class PacketRouter; |
@@ -30,24 +32,20 @@ class ProcessThread; |
class RemoteBitrateEstimator; |
class RemoteBitrateObserver; |
class RemoteEstimatorProxy; |
-class RtpRtcp; |
class TransportFeedbackAdapter; |
class TransportFeedbackObserver; |
-class CongestionController { |
+class CongestionController : public CallStatsObserver, public Module { |
public: |
CongestionController(Clock* clock, |
- ProcessThread* process_thread, |
- CallStats* call_stats, |
BitrateObserver* bitrate_observer, |
RemoteBitrateObserver* remote_bitrate_observer); |
virtual ~CongestionController(); |
+ |
virtual void SetBweBitrates(int min_bitrate_bps, |
int start_bitrate_bps, |
int max_bitrate_bps); |
- |
virtual void SignalNetworkState(NetworkState state); |
- |
virtual BitrateController* GetBitrateController() const; |
virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( |
bool send_side_bwe) const; |
@@ -62,21 +60,28 @@ class CongestionController { |
virtual void OnSentPacket(const rtc::SentPacket& sent_packet); |
+ // Implements CallStatsObserver. |
+ void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
+ |
+ // Implements Module. |
+ int64_t TimeUntilNextProcess() override; |
+ int32_t Process() override; |
+ |
private: |
Clock* const clock_; |
+ rtc::ThreadChecker config_thread_checker_; |
rtc::scoped_ptr<PacketRouter> packet_router_; |
rtc::scoped_ptr<PacedSender> pacer_; |
rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
rtc::scoped_ptr<RemoteEstimatorProxy> remote_estimator_proxy_; |
- |
- // Registered at construct time and assumed to outlive this class. |
- ProcessThread* const process_thread_; |
- CallStats* const call_stats_; |
- |
rtc::scoped_ptr<ProcessThread> pacer_thread_; |
- |
rtc::scoped_ptr<BitrateController> bitrate_controller_; |
- rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_; |
+ // Protects the scoped_pointer as transport_feedback_adapter_ doesn't get |
+ // created in the constructor. Internally TransportFeedbackAdapter is |
+ // thread-safe. |
+ rtc::CriticalSection crit_; |
+ rtc::scoped_ptr<TransportFeedbackAdapter> transport_feedback_adapter_ |
+ GUARDED_BY(&crit_); |
int min_bitrate_bps_; |
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |