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 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 packet_router_(new PacketRouter()), | 163 packet_router_(new PacketRouter()), |
164 pacer_(new PacedSender(clock_, packet_router_.get())), | 164 pacer_(new PacedSender(clock_, packet_router_.get())), |
165 remote_bitrate_estimator_( | 165 remote_bitrate_estimator_( |
166 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), | 166 new WrappingBitrateEstimator(remote_bitrate_observer, clock_)), |
167 bitrate_controller_( | 167 bitrate_controller_( |
168 BitrateController::CreateBitrateController(clock_, event_log)), | 168 BitrateController::CreateBitrateController(clock_, event_log)), |
169 retransmission_rate_limiter_( | 169 retransmission_rate_limiter_( |
170 new RateLimiter(clock, kRetransmitWindowSizeMs)), | 170 new RateLimiter(clock, kRetransmitWindowSizeMs)), |
171 remote_estimator_proxy_(clock_, packet_router_.get()), | 171 remote_estimator_proxy_(clock_, packet_router_.get()), |
172 transport_feedback_adapter_(bitrate_controller_.get(), clock_), | 172 transport_feedback_adapter_(bitrate_controller_.get(), clock_), |
173 start_bitrate_bps_(0), | |
173 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), | 174 min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), |
174 max_bitrate_bps_(0), | 175 max_bitrate_bps_(0), |
175 last_reported_bitrate_bps_(0), | 176 last_reported_bitrate_bps_(0), |
176 last_reported_fraction_loss_(0), | 177 last_reported_fraction_loss_(0), |
177 last_reported_rtt_(0), | 178 last_reported_rtt_(0), |
178 network_state_(kNetworkUp) { | 179 network_state_(kNetworkUp) { |
179 Init(); | 180 Init(); |
180 } | 181 } |
181 | 182 |
182 CongestionController::CongestionController( | 183 CongestionController::CongestionController( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
221 } | 222 } |
222 | 223 |
223 void CongestionController::SetBweBitrates(int min_bitrate_bps, | 224 void CongestionController::SetBweBitrates(int min_bitrate_bps, |
224 int start_bitrate_bps, | 225 int start_bitrate_bps, |
225 int max_bitrate_bps) { | 226 int max_bitrate_bps) { |
226 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); | 227 ClampBitrates(&start_bitrate_bps, &min_bitrate_bps, &max_bitrate_bps); |
227 bitrate_controller_->SetBitrates(start_bitrate_bps, | 228 bitrate_controller_->SetBitrates(start_bitrate_bps, |
228 min_bitrate_bps, | 229 min_bitrate_bps, |
229 max_bitrate_bps); | 230 max_bitrate_bps); |
230 | 231 |
232 if (start_bitrate_bps > 0) | |
233 start_bitrate_bps_ = start_bitrate_bps; | |
231 { | 234 { |
232 // Only do probing if: | 235 // Only do probing if: |
233 // - we are mid-call, which we consider to be if | 236 // we are mid-call, which we consider to be if |
234 // |last_reported_bitrate_bps_| != 0, and | 237 // |last_reported_bitrate_bps_| is valid (> 0) and |
235 // - the current bitrate is lower than the new |max_bitrate_bps|, and | 238 // |last_reported_bitrate_bps_| != |start_bitrate_bps_|, and |
236 // - we actually want to increase the |max_bitrate_bps_|. | 239 // the current bitrate is lower than the new |max_bitrate_bps|, and |
240 // we actually want to increase the |max_bitrate_bps_|. | |
237 rtc::CritScope cs(&critsect_); | 241 rtc::CritScope cs(&critsect_); |
238 if (last_reported_bitrate_bps_ != 0 && | 242 if (last_reported_bitrate_bps_ && |
stefan-webrtc
2016/09/02 13:49:15
!= 0
Irfan
2016/09/06 20:32:12
Done.
| |
243 last_reported_bitrate_bps_ != | |
244 static_cast<uint32_t>(start_bitrate_bps_) && | |
stefan-webrtc
2016/09/02 13:49:15
Seems a bit arbitrary to not allow probing if the
Irfan
2016/09/06 20:32:12
Right, I mention this in the commit details.
The
stefan-webrtc
2016/09/07 13:42:01
So shouldn't this be triggered if initial_probing_
| |
239 last_reported_bitrate_bps_ < static_cast<uint32_t>(max_bitrate_bps) && | 245 last_reported_bitrate_bps_ < static_cast<uint32_t>(max_bitrate_bps) && |
240 max_bitrate_bps > max_bitrate_bps_) { | 246 max_bitrate_bps > max_bitrate_bps_) { |
241 pacer_->CreateProbeCluster(max_bitrate_bps, 5); | 247 pacer_->CreateProbeCluster(max_bitrate_bps, 5); |
242 } | 248 } |
243 } | 249 } |
244 max_bitrate_bps_ = max_bitrate_bps; | 250 max_bitrate_bps_ = max_bitrate_bps; |
245 | 251 |
246 if (remote_bitrate_estimator_) | 252 if (remote_bitrate_estimator_) |
247 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); | 253 remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); |
248 min_bitrate_bps_ = min_bitrate_bps; | 254 min_bitrate_bps_ = min_bitrate_bps; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
387 bool CongestionController::IsSendQueueFull() const { | 393 bool CongestionController::IsSendQueueFull() const { |
388 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 394 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
389 } | 395 } |
390 | 396 |
391 bool CongestionController::IsNetworkDown() const { | 397 bool CongestionController::IsNetworkDown() const { |
392 rtc::CritScope cs(&critsect_); | 398 rtc::CritScope cs(&critsect_); |
393 return network_state_ == kNetworkDown; | 399 return network_state_ == kNetworkDown; |
394 } | 400 } |
395 | 401 |
396 } // namespace webrtc | 402 } // namespace webrtc |
OLD | NEW |