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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 namespace rtc { | 25 namespace rtc { |
26 struct SentPacket; | 26 struct SentPacket; |
27 } | 27 } |
28 | 28 |
29 namespace webrtc { | 29 namespace webrtc { |
30 | 30 |
31 class BitrateController; | 31 class BitrateController; |
32 class Clock; | 32 class Clock; |
33 class ProcessThread; | 33 class ProcessThread; |
| 34 class RateLimiter; |
34 class RemoteBitrateEstimator; | 35 class RemoteBitrateEstimator; |
35 class RemoteBitrateObserver; | 36 class RemoteBitrateObserver; |
36 class RtcEventLog; | 37 class RtcEventLog; |
37 class TransportFeedbackObserver; | 38 class TransportFeedbackObserver; |
38 | 39 |
39 class CongestionController : public CallStatsObserver, public Module { | 40 class CongestionController : public CallStatsObserver, public Module { |
40 public: | 41 public: |
41 // Observer class for bitrate changes announced due to change in bandwidth | 42 // Observer class for bitrate changes announced due to change in bandwidth |
42 // estimate or due to that the send pacer is full. Fraction loss and rtt is | 43 // estimate or due to that the send pacer is full. Fraction loss and rtt is |
43 // also part of this callback to allow the observer to optimize its settings | 44 // also part of this callback to allow the observer to optimize its settings |
(...skipping 29 matching lines...) Expand all Loading... |
73 int min_bitrate_bps, | 74 int min_bitrate_bps, |
74 int max_bitrate_bps); | 75 int max_bitrate_bps); |
75 virtual void SignalNetworkState(NetworkState state); | 76 virtual void SignalNetworkState(NetworkState state); |
76 virtual BitrateController* GetBitrateController() const; | 77 virtual BitrateController* GetBitrateController() const; |
77 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( | 78 virtual RemoteBitrateEstimator* GetRemoteBitrateEstimator( |
78 bool send_side_bwe); | 79 bool send_side_bwe); |
79 virtual int64_t GetPacerQueuingDelayMs() const; | 80 virtual int64_t GetPacerQueuingDelayMs() const; |
80 virtual PacedSender* pacer() { return pacer_.get(); } | 81 virtual PacedSender* pacer() { return pacer_.get(); } |
81 virtual PacketRouter* packet_router() { return packet_router_.get(); } | 82 virtual PacketRouter* packet_router() { return packet_router_.get(); } |
82 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); | 83 virtual TransportFeedbackObserver* GetTransportFeedbackObserver(); |
| 84 RateLimiter* GetRetransmissionRateLimiter(); |
83 | 85 |
84 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec | 86 // SetAllocatedSendBitrateLimits sets bitrates limits imposed by send codec |
85 // settings. | 87 // settings. |
86 // |min_send_bitrate_bps| is the total minimum send bitrate required by all | 88 // |min_send_bitrate_bps| is the total minimum send bitrate required by all |
87 // sending streams. This is the minimum bitrate the PacedSender will use. | 89 // sending streams. This is the minimum bitrate the PacedSender will use. |
88 // Note that CongestionController::OnNetworkChanged can still be called with | 90 // Note that CongestionController::OnNetworkChanged can still be called with |
89 // a lower bitrate estimate. | 91 // a lower bitrate estimate. |
90 // |max_padding_bitrate_bps| is the max bitrate the send streams request for | 92 // |max_padding_bitrate_bps| is the max bitrate the send streams request for |
91 // padding. This can be higher than the current network estimate and tells | 93 // padding. This can be higher than the current network estimate and tells |
92 // the PacedSender how much it should max pad unless there is real packets to | 94 // the PacedSender how much it should max pad unless there is real packets to |
(...skipping 18 matching lines...) Expand all Loading... |
111 bool IsNetworkDown() const; | 113 bool IsNetworkDown() const; |
112 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, | 114 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, |
113 uint8_t fraction_loss, | 115 uint8_t fraction_loss, |
114 int64_t rtt); | 116 int64_t rtt); |
115 Clock* const clock_; | 117 Clock* const clock_; |
116 Observer* const observer_; | 118 Observer* const observer_; |
117 const std::unique_ptr<PacketRouter> packet_router_; | 119 const std::unique_ptr<PacketRouter> packet_router_; |
118 const std::unique_ptr<PacedSender> pacer_; | 120 const std::unique_ptr<PacedSender> pacer_; |
119 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 121 const std::unique_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
120 const std::unique_ptr<BitrateController> bitrate_controller_; | 122 const std::unique_ptr<BitrateController> bitrate_controller_; |
| 123 const std::unique_ptr<RateLimiter> retransmission_rate_limiter_; |
121 RemoteEstimatorProxy remote_estimator_proxy_; | 124 RemoteEstimatorProxy remote_estimator_proxy_; |
122 TransportFeedbackAdapter transport_feedback_adapter_; | 125 TransportFeedbackAdapter transport_feedback_adapter_; |
123 int min_bitrate_bps_; | 126 int min_bitrate_bps_; |
124 rtc::CriticalSection critsect_; | 127 rtc::CriticalSection critsect_; |
125 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); | 128 uint32_t last_reported_bitrate_bps_ GUARDED_BY(critsect_); |
126 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); | 129 uint8_t last_reported_fraction_loss_ GUARDED_BY(critsect_); |
127 int64_t last_reported_rtt_ GUARDED_BY(critsect_); | 130 int64_t last_reported_rtt_ GUARDED_BY(critsect_); |
128 NetworkState network_state_ GUARDED_BY(critsect_); | 131 NetworkState network_state_ GUARDED_BY(critsect_); |
129 | 132 |
130 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); | 133 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CongestionController); |
131 }; | 134 }; |
132 | 135 |
133 } // namespace webrtc | 136 } // namespace webrtc |
134 | 137 |
135 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ | 138 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_CONGESTION_CONTROLLER_H_ |
OLD | NEW |