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 16 matching lines...) Expand all Loading... | |
27 #include "webrtc/modules/pacing/packet_router.h" | 27 #include "webrtc/modules/pacing/packet_router.h" |
28 | 28 |
29 namespace rtc { | 29 namespace rtc { |
30 struct SentPacket; | 30 struct SentPacket; |
31 } | 31 } |
32 | 32 |
33 namespace webrtc { | 33 namespace webrtc { |
34 | 34 |
35 class BitrateController; | 35 class BitrateController; |
36 class Clock; | 36 class Clock; |
37 class AcknowledgedBitrateEstimator; | |
37 class ProbeController; | 38 class ProbeController; |
38 class RateLimiter; | 39 class RateLimiter; |
39 class RtcEventLog; | 40 class RtcEventLog; |
40 | 41 |
41 class SendSideCongestionController : public CallStatsObserver, | 42 class SendSideCongestionController : public CallStatsObserver, |
42 public Module, | 43 public Module, |
43 public TransportFeedbackObserver { | 44 public TransportFeedbackObserver { |
44 public: | 45 public: |
45 // Observer class for bitrate changes announced due to change in bandwidth | 46 // Observer class for bitrate changes announced due to change in bandwidth |
46 // estimate or due to that the send pacer is full. Fraction loss and rtt is | 47 // estimate or due to that the send pacer is full. Fraction loss and rtt is |
47 // also part of this callback to allow the observer to optimize its settings | 48 // also part of this callback to allow the observer to optimize its settings |
48 // for different types of network environments. The bitrate does not include | 49 // for different types of network environments. The bitrate does not include |
49 // packet headers and is measured in bits per second. | 50 // packet headers and is measured in bits per second. |
50 class Observer { | 51 class Observer { |
51 public: | 52 public: |
52 virtual void OnNetworkChanged(uint32_t bitrate_bps, | 53 virtual void OnNetworkChanged(uint32_t bitrate_bps, |
53 uint8_t fraction_loss, // 0 - 255. | 54 uint8_t fraction_loss, // 0 - 255. |
54 int64_t rtt_ms, | 55 int64_t rtt_ms, |
55 int64_t probing_interval_ms) = 0; | 56 int64_t probinbweg_interval_ms) = 0; |
terelius
2017/06/02 12:14:05
Please fix :)
tschumi
2017/06/02 13:13:04
Done.
| |
56 | 57 |
57 protected: | 58 protected: |
58 virtual ~Observer() {} | 59 virtual ~Observer() {} |
59 }; | 60 }; |
60 // TODO(nisse): Consider deleting the |observer| argument to constructors | 61 // TODO(nisse): Consider deleting the |observer| argument to constructors |
61 // once CongestionController is deleted. | 62 // once CongestionController is deleted. |
62 SendSideCongestionController(const Clock* clock, | 63 SendSideCongestionController(const Clock* clock, |
63 Observer* observer, | 64 Observer* observer, |
64 RtcEventLog* event_log, | 65 RtcEventLog* event_log, |
65 PacketRouter* packet_router); | 66 PacketRouter* packet_router); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 bool IsNetworkDown() const; | 135 bool IsNetworkDown() const; |
135 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, | 136 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, |
136 uint8_t fraction_loss, | 137 uint8_t fraction_loss, |
137 int64_t rtt); | 138 int64_t rtt); |
138 const Clock* const clock_; | 139 const Clock* const clock_; |
139 rtc::CriticalSection observer_lock_; | 140 rtc::CriticalSection observer_lock_; |
140 Observer* observer_ GUARDED_BY(observer_lock_); | 141 Observer* observer_ GUARDED_BY(observer_lock_); |
141 RtcEventLog* const event_log_; | 142 RtcEventLog* const event_log_; |
142 const std::unique_ptr<PacedSender> pacer_; | 143 const std::unique_ptr<PacedSender> pacer_; |
143 const std::unique_ptr<BitrateController> bitrate_controller_; | 144 const std::unique_ptr<BitrateController> bitrate_controller_; |
145 const std::unique_ptr<AcknowledgedBitrateEstimator> | |
146 acknowledged_bitrate_estimator_; | |
144 const std::unique_ptr<ProbeController> probe_controller_; | 147 const std::unique_ptr<ProbeController> probe_controller_; |
145 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; | 148 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
146 TransportFeedbackAdapter transport_feedback_adapter_; | 149 TransportFeedbackAdapter transport_feedback_adapter_; |
147 rtc::CriticalSection network_state_lock_; | 150 rtc::CriticalSection network_state_lock_; |
148 uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); | 151 uint32_t last_reported_bitrate_bps_ GUARDED_BY(network_state_lock_); |
149 uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); | 152 uint8_t last_reported_fraction_loss_ GUARDED_BY(network_state_lock_); |
150 int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); | 153 int64_t last_reported_rtt_ GUARDED_BY(network_state_lock_); |
151 NetworkState network_state_ GUARDED_BY(network_state_lock_); | 154 NetworkState network_state_ GUARDED_BY(network_state_lock_); |
152 rtc::CriticalSection bwe_lock_; | 155 rtc::CriticalSection bwe_lock_; |
153 int min_bitrate_bps_ GUARDED_BY(bwe_lock_); | 156 int min_bitrate_bps_ GUARDED_BY(bwe_lock_); |
154 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_); | 157 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_); |
155 | 158 |
156 rtc::ThreadChecker worker_thread_checker_; | 159 rtc::ThreadChecker worker_thread_checker_; |
157 | 160 |
158 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); | 161 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); |
159 }; | 162 }; |
160 | 163 |
161 } // namespace webrtc | 164 } // namespace webrtc |
162 | 165 |
163 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON TROLLER_H_ | 166 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON TROLLER_H_ |
OLD | NEW |