| 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 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" | 11 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <memory> | 14 #include <memory> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
| 19 #include "webrtc/base/logging.h" | 19 #include "webrtc/base/logging.h" |
| 20 #include "webrtc/base/rate_limiter.h" | 20 #include "webrtc/base/rate_limiter.h" |
| 21 #include "webrtc/base/socket.h" | 21 #include "webrtc/base/socket.h" |
| 22 #include "webrtc/base/thread_annotations.h" | 22 #include "webrtc/base/thread_annotations.h" |
| 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
| 24 #include "webrtc/modules/congestion_controller/delay_based_bwe.h" | 24 #include "webrtc/modules/congestion_controller/delay_based_bwe.h" |
| 25 #include "webrtc/modules/congestion_controller/probe_controller.h" | 25 #include "webrtc/modules/congestion_controller/probe_controller.h" |
| 26 #include "webrtc/modules/pacing/alr_detector.h" |
| 26 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" | 27 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" |
| 27 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 28 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
| 28 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" | 29 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
| 29 #include "webrtc/modules/utility/include/process_thread.h" | 30 #include "webrtc/modules/utility/include/process_thread.h" |
| 30 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 31 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
| 31 #include "webrtc/video/payload_router.h" | 32 #include "webrtc/video/payload_router.h" |
| 32 | 33 |
| 33 namespace webrtc { | 34 namespace webrtc { |
| 34 namespace { | 35 namespace { |
| 35 | 36 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } // namespace | 156 } // namespace |
| 156 | 157 |
| 157 CongestionController::CongestionController( | 158 CongestionController::CongestionController( |
| 158 Clock* clock, | 159 Clock* clock, |
| 159 Observer* observer, | 160 Observer* observer, |
| 160 RemoteBitrateObserver* remote_bitrate_observer, | 161 RemoteBitrateObserver* remote_bitrate_observer, |
| 161 RtcEventLog* event_log) | 162 RtcEventLog* event_log) |
| 162 : clock_(clock), | 163 : clock_(clock), |
| 163 observer_(observer), | 164 observer_(observer), |
| 164 packet_router_(new PacketRouter()), | 165 packet_router_(new PacketRouter()), |
| 165 pacer_(new PacedSender(clock_, packet_router_.get())), | 166 alr_detector_(new AlrDetector()), |
| 167 pacer_( |
| 168 new PacedSender(clock_, packet_router_.get(), alr_detector_.get())), |
| 166 remote_bitrate_estimator_( | 169 remote_bitrate_estimator_( |
| 167 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), | 170 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), |
| 168 bitrate_controller_( | 171 bitrate_controller_( |
| 169 BitrateController::CreateBitrateController(clock_, event_log)), | 172 BitrateController::CreateBitrateController(clock_, event_log)), |
| 170 probe_controller_(new ProbeController(pacer_.get(), clock_)), | 173 probe_controller_(new ProbeController(pacer_.get(), clock_)), |
| 171 retransmission_rate_limiter_( | 174 retransmission_rate_limiter_( |
| 172 new RateLimiter(clock, kRetransmitWindowSizeMs)), | 175 new RateLimiter(clock, kRetransmitWindowSizeMs)), |
| 173 remote_estimator_proxy_(clock_, packet_router_.get()), | 176 remote_estimator_proxy_(clock_, packet_router_.get()), |
| 174 transport_feedback_adapter_(clock_), | 177 transport_feedback_adapter_(clock_), |
| 175 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), | 178 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 bool CongestionController::IsSendQueueFull() const { | 381 bool CongestionController::IsSendQueueFull() const { |
| 379 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 382 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 380 } | 383 } |
| 381 | 384 |
| 382 bool CongestionController::IsNetworkDown() const { | 385 bool CongestionController::IsNetworkDown() const { |
| 383 rtc::CritScope cs(&critsect_); | 386 rtc::CritScope cs(&critsect_); |
| 384 return network_state_ == kNetworkDown; | 387 return network_state_ == kNetworkDown; |
| 385 } | 388 } |
| 386 | 389 |
| 387 } // namespace webrtc | 390 } // namespace webrtc |
| OLD | NEW |