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 |
11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTRO
LLER_H_ | 11 #ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTRO
LLER_H_ |
12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTRO
LLER_H_ | 12 #define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CONTRO
LLER_H_ |
13 | 13 |
14 #include <memory> | 14 #include <memory> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "webrtc/common_types.h" | 17 #include "webrtc/common_types.h" |
18 #include "webrtc/modules/congestion_controller/delay_based_bwe.h" | 18 #include "webrtc/modules/congestion_controller/delay_based_bwe.h" |
19 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" | 19 #include "webrtc/modules/congestion_controller/transport_feedback_adapter.h" |
20 #include "webrtc/modules/include/module.h" | 20 #include "webrtc/modules/include/module.h" |
21 #include "webrtc/modules/include/module_common_types.h" | 21 #include "webrtc/modules/include/module_common_types.h" |
22 #include "webrtc/modules/pacing/paced_sender.h" | 22 #include "webrtc/modules/pacing/paced_sender.h" |
23 #include "webrtc/modules/pacing/packet_router.h" | 23 #include "webrtc/modules/pacing/packet_router.h" |
24 #include "webrtc/rtc_base/constructormagic.h" | 24 #include "webrtc/rtc_base/constructormagic.h" |
25 #include "webrtc/rtc_base/criticalsection.h" | 25 #include "webrtc/rtc_base/criticalsection.h" |
26 #include "webrtc/rtc_base/networkroute.h" | 26 #include "webrtc/rtc_base/networkroute.h" |
| 27 #include "webrtc/rtc_base/optional.h" |
27 #include "webrtc/rtc_base/race_checker.h" | 28 #include "webrtc/rtc_base/race_checker.h" |
28 | 29 |
29 namespace rtc { | 30 namespace rtc { |
30 struct SentPacket; | 31 struct SentPacket; |
31 } | 32 } |
32 | 33 |
33 namespace webrtc { | 34 namespace webrtc { |
34 | 35 |
35 class BitrateController; | 36 class BitrateController; |
36 class Clock; | 37 class Clock; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void Process() override; | 109 void Process() override; |
109 | 110 |
110 // Implements TransportFeedbackObserver. | 111 // Implements TransportFeedbackObserver. |
111 void AddPacket(uint32_t ssrc, | 112 void AddPacket(uint32_t ssrc, |
112 uint16_t sequence_number, | 113 uint16_t sequence_number, |
113 size_t length, | 114 size_t length, |
114 const PacedPacketInfo& pacing_info) override; | 115 const PacedPacketInfo& pacing_info) override; |
115 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; | 116 void OnTransportFeedback(const rtcp::TransportFeedback& feedback) override; |
116 std::vector<PacketFeedback> GetTransportFeedbackVector() const override; | 117 std::vector<PacketFeedback> GetTransportFeedbackVector() const override; |
117 | 118 |
| 119 void PrintDebugStuff(); |
| 120 |
118 private: | 121 private: |
119 void MaybeTriggerOnNetworkChanged(); | 122 void MaybeTriggerOnNetworkChanged(); |
120 | 123 |
121 bool IsSendQueueFull() const; | 124 bool IsSendQueueFull() const; |
122 bool IsNetworkDown() const; | 125 bool IsNetworkDown() const; |
123 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, | 126 bool HasNetworkParametersToReportChanged(uint32_t bitrate_bps, |
124 uint8_t fraction_loss, | 127 uint8_t fraction_loss, |
125 int64_t rtt); | 128 int64_t rtt); |
126 void LimitOutstandingBytes(size_t num_outstanding_bytes); | 129 void LimitOutstandingBytes(size_t num_outstanding_bytes); |
127 const Clock* const clock_; | 130 const Clock* const clock_; |
(...skipping 19 matching lines...) Expand all Loading... |
147 bool pacer_paused_; | 150 bool pacer_paused_; |
148 rtc::CriticalSection bwe_lock_; | 151 rtc::CriticalSection bwe_lock_; |
149 int min_bitrate_bps_ GUARDED_BY(bwe_lock_); | 152 int min_bitrate_bps_ GUARDED_BY(bwe_lock_); |
150 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_); | 153 std::unique_ptr<DelayBasedBwe> delay_based_bwe_ GUARDED_BY(bwe_lock_); |
151 bool in_cwnd_experiment_; | 154 bool in_cwnd_experiment_; |
152 int64_t accepted_queue_ms_; | 155 int64_t accepted_queue_ms_; |
153 bool was_in_alr_; | 156 bool was_in_alr_; |
154 | 157 |
155 rtc::RaceChecker worker_race_; | 158 rtc::RaceChecker worker_race_; |
156 | 159 |
| 160 bool print_ = false; |
| 161 rtc::Optional<float> reduction_rate_; |
| 162 |
157 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); | 163 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); |
158 }; | 164 }; |
159 | 165 |
160 } // namespace webrtc | 166 } // namespace webrtc |
161 | 167 |
162 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON
TROLLER_H_ | 168 #endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_SEND_SIDE_CONGESTION_CON
TROLLER_H_ |
OLD | NEW |