| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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/remote_bitrate_estimator/aimd_rate_control.h" | 11 #include "webrtc/modules/remote_bitrate_estimator/aimd_rate_control.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <cassert> | 14 #include <cassert> |
| 15 #include <cmath> | 15 #include <cmath> |
| 16 | 16 |
| 17 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 18 | 18 |
| 19 #include "webrtc/modules/congestion_controller/include/congestion_controller.h" |
| 19 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" | 20 #include "webrtc/modules/remote_bitrate_estimator/overuse_detector.h" |
| 20 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" | 21 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimat
or.h" |
| 21 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" | 22 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
| 22 | 23 |
| 23 namespace webrtc { | 24 namespace webrtc { |
| 24 | 25 |
| 25 static const int64_t kDefaultRttMs = 200; | 26 static const int64_t kDefaultRttMs = 200; |
| 26 static const double kWithinIncomingBitrateHysteresis = 1.05; | 27 static const double kWithinIncomingBitrateHysteresis = 1.05; |
| 27 static const int64_t kMaxFeedbackIntervalMs = 1000; | 28 static const int64_t kMaxFeedbackIntervalMs = 1000; |
| 28 | 29 |
| 29 AimdRateControl::AimdRateControl() | 30 AimdRateControl::AimdRateControl() |
| 30 : min_configured_bitrate_bps_( | 31 : min_configured_bitrate_bps_(CongestionController::GetMinBitrateBps()), |
| 31 RemoteBitrateEstimator::kDefaultMinBitrateBps), | |
| 32 max_configured_bitrate_bps_(30000000), | 32 max_configured_bitrate_bps_(30000000), |
| 33 current_bitrate_bps_(max_configured_bitrate_bps_), | 33 current_bitrate_bps_(max_configured_bitrate_bps_), |
| 34 avg_max_bitrate_kbps_(-1.0f), | 34 avg_max_bitrate_kbps_(-1.0f), |
| 35 var_max_bitrate_kbps_(0.4f), | 35 var_max_bitrate_kbps_(0.4f), |
| 36 rate_control_state_(kRcHold), | 36 rate_control_state_(kRcHold), |
| 37 rate_control_region_(kRcMaxUnknown), | 37 rate_control_region_(kRcMaxUnknown), |
| 38 time_last_bitrate_change_(-1), | 38 time_last_bitrate_change_(-1), |
| 39 current_input_(kBwNormal, rtc::Optional<uint32_t>(), 1.0), | 39 current_input_(kBwNormal, rtc::Optional<uint32_t>(), 1.0), |
| 40 updated_(false), | 40 updated_(false), |
| 41 time_first_incoming_estimate_(-1), | 41 time_first_incoming_estimate_(-1), |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 } | 299 } |
| 300 | 300 |
| 301 void AimdRateControl::ChangeRegion(RateControlRegion region) { | 301 void AimdRateControl::ChangeRegion(RateControlRegion region) { |
| 302 rate_control_region_ = region; | 302 rate_control_region_ = region; |
| 303 } | 303 } |
| 304 | 304 |
| 305 void AimdRateControl::ChangeState(RateControlState new_state) { | 305 void AimdRateControl::ChangeState(RateControlState new_state) { |
| 306 rate_control_state_ = new_state; | 306 rate_control_state_ = new_state; |
| 307 } | 307 } |
| 308 } // namespace webrtc | 308 } // namespace webrtc |
| OLD | NEW |