Index: webrtc/modules/congestion_controller/probing_interval_estimator.cc |
diff --git a/webrtc/modules/congestion_controller/probing_interval_estimator.cc b/webrtc/modules/congestion_controller/probing_interval_estimator.cc |
index ed1134737e6dc3294fbd0e53a9fa044da6ee60ce..6e7a674ae8b4a5f7b182f19c88b547a9922ee82e 100644 |
--- a/webrtc/modules/congestion_controller/probing_interval_estimator.cc |
+++ b/webrtc/modules/congestion_controller/probing_interval_estimator.cc |
@@ -17,6 +17,7 @@ namespace webrtc { |
namespace { |
constexpr int kMinIntervalMs = 2000; |
+constexpr int kDefaultIntervalMs = 3000; |
constexpr int kMaxIntervalMs = 50000; |
} |
@@ -24,27 +25,31 @@ ProbingIntervalEstimator::ProbingIntervalEstimator( |
const AimdRateControl* aimd_rate_control) |
: ProbingIntervalEstimator(kMinIntervalMs, |
kMaxIntervalMs, |
+ kDefaultIntervalMs, |
aimd_rate_control) {} |
ProbingIntervalEstimator::ProbingIntervalEstimator( |
- int min_interval_ms, |
- int max_interval_ms, |
+ int64_t min_interval_ms, |
+ int64_t max_interval_ms, |
+ int64_t default_interval_ms, |
const AimdRateControl* aimd_rate_control) |
: min_interval_ms_(min_interval_ms), |
max_interval_ms_(max_interval_ms), |
+ default_interval_ms_(default_interval_ms), |
aimd_rate_control_(aimd_rate_control) {} |
-rtc::Optional<int> ProbingIntervalEstimator::GetIntervalMs() const { |
+int64_t ProbingIntervalEstimator::GetIntervalMs() const { |
rtc::Optional<int> bitrate_drop = |
aimd_rate_control_->GetLastBitrateDecreaseBps(); |
int increase_rate = aimd_rate_control_->GetNearMaxIncreaseRateBps(); |
if (!bitrate_drop || increase_rate <= 0) |
- return rtc::Optional<int>(); |
+ return default_interval_ms_; |
- return rtc::Optional<int>(std::min( |
+ return std::min( |
max_interval_ms_, |
- std::max(1000 * (*bitrate_drop) / increase_rate, min_interval_ms_))); |
+ std::max(static_cast<int64_t>(1000 * (*bitrate_drop) / increase_rate), |
+ min_interval_ms_)); |
} |
} // namespace webrtc |