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" | |
19 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
20 #include "webrtc/base/rate_limiter.h" | 19 #include "webrtc/base/rate_limiter.h" |
21 #include "webrtc/base/socket.h" | 20 #include "webrtc/base/socket.h" |
22 #include "webrtc/base/thread_annotations.h" | |
23 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" | 21 #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" |
24 #include "webrtc/modules/congestion_controller/probe_controller.h" | 22 #include "webrtc/modules/congestion_controller/probe_controller.h" |
25 #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" | |
26 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" | 23 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_s
end_time.h" |
27 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" | 24 #include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_singl
e_stream.h" |
28 #include "webrtc/modules/utility/include/process_thread.h" | |
29 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" | 25 #include "webrtc/system_wrappers/include/critical_section_wrapper.h" |
30 #include "webrtc/video/payload_router.h" | |
31 | 26 |
32 namespace webrtc { | 27 namespace webrtc { |
33 namespace { | 28 namespace { |
34 | 29 |
35 static const uint32_t kTimeOffsetSwitchThreshold = 30; | 30 static const uint32_t kTimeOffsetSwitchThreshold = 30; |
36 static const int64_t kRetransmitWindowSizeMs = 500; | 31 static const int64_t kRetransmitWindowSizeMs = 500; |
37 | 32 |
38 // Makes sure that the bitrate and the min, max values are in valid range. | 33 // Makes sure that the bitrate and the min, max values are in valid range. |
39 static void ClampBitrates(int* bitrate_bps, | 34 static void ClampBitrates(int* bitrate_bps, |
40 int* min_bitrate_bps, | 35 int* min_bitrate_bps, |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 bool CongestionController::IsSendQueueFull() const { | 367 bool CongestionController::IsSendQueueFull() const { |
373 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 368 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
374 } | 369 } |
375 | 370 |
376 bool CongestionController::IsNetworkDown() const { | 371 bool CongestionController::IsNetworkDown() const { |
377 rtc::CritScope cs(&critsect_); | 372 rtc::CritScope cs(&critsect_); |
378 return network_state_ == kNetworkDown; | 373 return network_state_ == kNetworkDown; |
379 } | 374 } |
380 | 375 |
381 } // namespace webrtc | 376 } // namespace webrtc |
OLD | NEW |