OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Implements CallStatsObserver. | 84 // Implements CallStatsObserver. |
85 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; | 85 void OnRttUpdate(int64_t avg_rtt_ms, int64_t max_rtt_ms) override; |
86 | 86 |
87 // Implements Module. | 87 // Implements Module. |
88 int64_t TimeUntilNextProcess() override; | 88 int64_t TimeUntilNextProcess() override; |
89 void Process() override; | 89 void Process() override; |
90 | 90 |
91 private: | 91 private: |
92 void Init(); | 92 void Init(); |
93 void MaybeTriggerOnNetworkChanged(); | 93 void MaybeTriggerOnNetworkChanged(); |
94 // Updates |send_queue_is_full_|. Returns true if |send_queue_is_full_| | 94 |
95 // has changed. | 95 bool IsSendQueueFull() const; |
96 bool UpdateSendQueueStatus(bool send_queue_is_full); | 96 bool IsNetworkDown() const; |
| 97 bool HasBitrateToReportChanged(uint32_t bitrate_bps); |
97 | 98 |
98 Clock* const clock_; | 99 Clock* const clock_; |
99 Observer* const observer_; | 100 Observer* const observer_; |
100 const std::unique_ptr<PacketRouter> packet_router_; | 101 const std::unique_ptr<PacketRouter> packet_router_; |
101 const std::unique_ptr<PacedSender> pacer_; | 102 const std::unique_ptr<PacedSender> pacer_; |
102 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 103 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
103 const std::unique_ptr<BitrateController> bitrate_controller_; | 104 const std::unique_ptr<BitrateController> bitrate_controller_; |
104 RemoteEstimatorProxy remote_estimator_proxy_; | 105 RemoteEstimatorProxy remote_estimator_proxy_; |
105 TransportFeedbackAdapter transport_feedback_adapter_; | 106 TransportFeedbackAdapter transport_feedback_adapter_; |
106 int min_bitrate_bps_; | 107 int min_bitrate_bps_; |
107 rtc::CriticalSection critsect_; | 108 rtc::CriticalSection critsect_; |
108 bool send_queue_is_full_ GUARDED_BY(critsect_); | 109 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); |
| 110 NetworkState network_state_ GUARDED_BY(critsect_); |
109 | 111 |
110 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); | 112 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
111 }; | 113 }; |
112 | 114 |
113 } // namespace webrtc | 115 } // namespace webrtc |
114 | 116 |
115 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 117 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
OLD | NEW |