| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled; | 256 min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled; |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 if (state_ != State::kProbingComplete || !enable_periodic_alr_probing_) | 260 if (state_ != State::kProbingComplete || !enable_periodic_alr_probing_) |
| 261 return; | 261 return; |
| 262 | 262 |
| 263 // Probe bandwidth periodically when in ALR state. | 263 // Probe bandwidth periodically when in ALR state. |
| 264 rtc::Optional<int64_t> alr_start_time = | 264 rtc::Optional<int64_t> alr_start_time = |
| 265 pacer_->GetApplicationLimitedRegionStartTime(); | 265 pacer_->GetApplicationLimitedRegionStartTime(); |
| 266 if (!in_alr && alr_start_time) { |
| 267 in_alr = true; |
| 268 Print("Enter ALR: %ld", *alr_start_time); |
| 269 } else if (in_alr && !alr_start_time) { |
| 270 in_alr = false; |
| 271 Print("Exit ALR"); |
| 272 } |
| 273 |
| 266 if (alr_start_time && estimated_bitrate_bps_ > 0) { | 274 if (alr_start_time && estimated_bitrate_bps_ > 0) { |
| 267 int64_t next_probe_time_ms = | 275 int64_t next_probe_time_ms = |
| 268 std::max(*alr_start_time, time_last_probing_initiated_ms_) + | 276 std::max(*alr_start_time, time_last_probing_initiated_ms_) + |
| 269 kAlrPeriodicProbingIntervalMs; | 277 kAlrPeriodicProbingIntervalMs; |
| 270 if (now_ms >= next_probe_time_ms) { | 278 if (now_ms >= next_probe_time_ms) { |
| 271 InitiateProbing(now_ms, {estimated_bitrate_bps_ * 2}, true); | 279 InitiateProbing(now_ms, {estimated_bitrate_bps_ * 2}, true); |
| 272 } | 280 } |
| 273 } | 281 } |
| 274 } | 282 } |
| 275 | 283 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 292 state_ = State::kWaitingForProbingResult; | 300 state_ = State::kWaitingForProbingResult; |
| 293 min_bitrate_to_probe_further_bps_ = | 301 min_bitrate_to_probe_further_bps_ = |
| 294 (*(bitrates_to_probe.end() - 1)) * kRepeatedProbeMinPercentage / 100; | 302 (*(bitrates_to_probe.end() - 1)) * kRepeatedProbeMinPercentage / 100; |
| 295 } else { | 303 } else { |
| 296 state_ = State::kProbingComplete; | 304 state_ = State::kProbingComplete; |
| 297 min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled; | 305 min_bitrate_to_probe_further_bps_ = kExponentialProbingDisabled; |
| 298 } | 306 } |
| 299 } | 307 } |
| 300 | 308 |
| 301 } // namespace webrtc | 309 } // namespace webrtc |
| OLD | NEW |