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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 class Observer { | 51 class Observer { |
52 public: | 52 public: |
53 virtual void OnNetworkChanged(uint32_t bitrate_bps, | 53 virtual void OnNetworkChanged(uint32_t bitrate_bps, |
54 uint8_t fraction_loss, // 0 - 255. | 54 uint8_t fraction_loss, // 0 - 255. |
55 int64_t rtt_ms, | 55 int64_t rtt_ms, |
56 int64_t probing_interval_ms) = 0; | 56 int64_t probing_interval_ms) = 0; |
57 | 57 |
58 protected: | 58 protected: |
59 virtual ~Observer() {} | 59 virtual ~Observer() {} |
60 }; | 60 }; |
| 61 // TODO(holmer): Delete after fixing upstream projects. |
| 62 RTC_DEPRECATED SendSideCongestionController(const Clock* clock, |
| 63 Observer* observer, |
| 64 RtcEventLog* event_log, |
| 65 PacketRouter* packet_router); |
61 // TODO(nisse): Consider deleting the |observer| argument to constructors | 66 // TODO(nisse): Consider deleting the |observer| argument to constructors |
62 // once CongestionController is deleted. | 67 // once CongestionController is deleted. |
63 SendSideCongestionController(const Clock* clock, | 68 SendSideCongestionController(const Clock* clock, |
64 Observer* observer, | 69 Observer* observer, |
65 RtcEventLog* event_log, | 70 RtcEventLog* event_log, |
66 PacketRouter* packet_router); | 71 PacedSender* pacer); |
67 SendSideCongestionController(const Clock* clock, | |
68 Observer* observer, | |
69 RtcEventLog* event_log, | |
70 std::unique_ptr<PacedSender> pacer); | |
71 ~SendSideCongestionController() override; | 72 ~SendSideCongestionController() override; |
72 | 73 |
73 void RegisterPacketFeedbackObserver(PacketFeedbackObserver* observer); | 74 void RegisterPacketFeedbackObserver(PacketFeedbackObserver* observer); |
74 void DeRegisterPacketFeedbackObserver(PacketFeedbackObserver* observer); | 75 void DeRegisterPacketFeedbackObserver(PacketFeedbackObserver* observer); |
75 | 76 |
76 // Currently, there can be at most one observer. | 77 // Currently, there can be at most one observer. |
77 void RegisterNetworkObserver(Observer* observer); | 78 void RegisterNetworkObserver(Observer* observer); |
78 void DeRegisterNetworkObserver(Observer* observer); | 79 void DeRegisterNetworkObserver(Observer* observer); |
79 | 80 |
80 virtual void SetBweBitrates(int min_bitrate_bps, | 81 virtual void SetBweBitrates(int min_bitrate_bps, |
81 int start_bitrate_bps, | 82 int start_bitrate_bps, |
82 int max_bitrate_bps); | 83 int max_bitrate_bps); |
83 // Resets the BWE state. Note the first argument is the bitrate_bps. | 84 // Resets the BWE state. Note the first argument is the bitrate_bps. |
84 virtual void OnNetworkRouteChanged(const rtc::NetworkRoute& network_route, | 85 virtual void OnNetworkRouteChanged(const rtc::NetworkRoute& network_route, |
85 int bitrate_bps, | 86 int bitrate_bps, |
86 int min_bitrate_bps, | 87 int min_bitrate_bps, |
87 int max_bitrate_bps); | 88 int max_bitrate_bps); |
88 virtual void SignalNetworkState(NetworkState state); | 89 virtual void SignalNetworkState(NetworkState state); |
89 virtual void SetTransportOverhead(size_t transport_overhead_bytes_per_packet); | 90 virtual void SetTransportOverhead(size_t transport_overhead_bytes_per_packet); |
90 | 91 |
91 virtual BitrateController* GetBitrateController() const; | 92 virtual BitrateController* GetBitrateController() const; |
92 virtual int64_t GetPacerQueuingDelayMs() const; | 93 virtual int64_t GetPacerQueuingDelayMs() const; |
93 virtual int64_t GetFirstPacketTimeMs() const; | 94 virtual int64_t GetFirstPacketTimeMs() const; |
94 // TODO(nisse): Delete this accessor function. The pacer should be | 95 |
95 // internal to the congestion controller. | |
96 virtual PacedSender* pacer(); | |
97 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); | 96 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); |
98 | 97 |
99 RateLimiter* GetRetransmissionRateLimiter(); | 98 RateLimiter* GetRetransmissionRateLimiter(); |
100 void EnablePeriodicAlrProbing(bool enable); | 99 void EnablePeriodicAlrProbing(bool enable); |
101 | 100 |
102 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec | 101 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec |
103 // settings. | 102 // settings. |
104 // |min_send_bitrate_bps| is the total minimum send bitrate required by all | 103 // |min_send_bitrate_bps| is the total minimum send bitrate required by all |
105 // sending streams. This is the minimum bitrate the PacedSender will use. | 104 // sending streams. This is the minimum bitrate the PacedSender will use. |
106 // Note that SendSideCongestionController::OnNetworkChanged can still be | 105 // Note that SendSideCongestionController::OnNetworkChanged can still be |
(...skipping 27 matching lines...) Expand all Loading... |
134 bool IsSendQueueFull() const; | 133 bool IsSendQueueFull() const; |
135 bool IsNetworkDown() const; | 134 bool IsNetworkDown() const; |
136 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, | 135 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, |
137 uint8_t fraction_loss, | 136 uint8_t fraction_loss, |
138 int64_t rtt); | 137 int64_t rtt); |
139 void LimitOutstandingBytes(size_t num_outstanding_bytes); | 138 void LimitOutstandingBytes(size_t num_outstanding_bytes); |
140 const Clock* const clock_; | 139 const Clock* const clock_; |
141 rtc::CriticalSection observer_lock_; | 140 rtc::CriticalSection observer_lock_; |
142 Observer* observer_ GUARDED_BY(observer_lock_); | 141 Observer* observer_ GUARDED_BY(observer_lock_); |
143 RtcEventLog* const event_log_; | 142 RtcEventLog* const event_log_; |
144 const std::unique_ptr<PacedSender> pacer_; | 143 std::unique_ptr<PacedSender> owned_pacer_; |
| 144 PacedSender* pacer_; |
145 const std::unique_ptr<BitrateController> bitrate_controller_; | 145 const std::unique_ptr<BitrateController> bitrate_controller_; |
146 std::unique_ptr<AcknowledgedBitrateEstimator> acknowledged_bitrate_estimator_; | 146 std::unique_ptr<AcknowledgedBitrateEstimator> acknowledged_bitrate_estimator_; |
147 const std::unique_ptr<ProbeController> probe_controller_; | 147 const std::unique_ptr<ProbeController> probe_controller_; |
148 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 148 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
149 TransportFeedbackAdapter transport_feedback_adapter_; | 149 TransportFeedbackAdapter transport_feedback_adapter_; |
150 rtc::CriticalSection network_state_lock_; | 150 rtc::CriticalSection network_state_lock_; |
151 uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); | 151 uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); |
152 uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); | 152 uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); |
153 int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); | 153 int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); |
154 NetworkState network_state_ GUARDED_BY(network_state_lock_); | 154 NetworkState network_state_ GUARDED_BY(network_state_lock_); |
(...skipping 10 matching lines...) Expand all Loading... |
165 bool was_in_alr_; | 165 bool was_in_alr_; |
166 | 166 |
167 rtc::RaceChecker worker_race_; | 167 rtc::RaceChecker worker_race_; |
168 | 168 |
169 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); | 169 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); |
170 }; | 170 }; |
171 | 171 |
172 } // namespace webrtc | 172 } // namespace webrtc |
173 | 173 |
174 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON
TROLLER_H_ | 174 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON
TROLLER_H_ |
OLD | NEW |