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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 int min_send_bitrate_bps, | 270 int min_send_bitrate_bps, |
271 int max_padding_bitrate_bps) { | 271 int max_padding_bitrate_bps) { |
272 pacer_->SetSendBitrateLimits(min_send_bitrate_bps, max_padding_bitrate_bps); | 272 pacer_->SetSendBitrateLimits(min_send_bitrate_bps, max_padding_bitrate_bps); |
273 } | 273 } |
274 | 274 |
275 int64_t CongestionController::GetPacerQueuingDelayMs() const { | 275 int64_t CongestionController::GetPacerQueuingDelayMs() const { |
276 return pacer_->QueueInMs(); | 276 return pacer_->QueueInMs(); |
277 } | 277 } |
278 | 278 |
279 void CongestionController::SignalNetworkState(NetworkState state) { | 279 void CongestionController::SignalNetworkState(NetworkState state) { |
| 280 LOG(LS_INFO) << "SignalNetworkState " |
| 281 << (state == kNetworkUp ? "Up" : "Down"); |
280 if (state == kNetworkUp) { | 282 if (state == kNetworkUp) { |
281 pacer_->Resume(); | 283 pacer_->Resume(); |
282 } else { | 284 } else { |
283 pacer_->Pause(); | 285 pacer_->Pause(); |
284 } | 286 } |
285 { | 287 { |
286 rtc::CritScope cs(&critsect_); | 288 rtc::CritScope cs(&critsect_); |
287 network_state_ = state; | 289 network_state_ = state; |
288 } | 290 } |
289 MaybeTriggerOnNetworkChanged(); | 291 MaybeTriggerOnNetworkChanged(); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 335 |
334 bool CongestionController::HasNetworkParametersToReportChanged( | 336 bool CongestionController::HasNetworkParametersToReportChanged( |
335 uint32_t bitrate_bps, | 337 uint32_t bitrate_bps, |
336 uint8_t fraction_loss, | 338 uint8_t fraction_loss, |
337 int64_t rtt) { | 339 int64_t rtt) { |
338 rtc::CritScope cs(&critsect_); | 340 rtc::CritScope cs(&critsect_); |
339 bool changed = | 341 bool changed = |
340 last_reported_bitrate_bps_ != bitrate_bps || | 342 last_reported_bitrate_bps_ != bitrate_bps || |
341 (bitrate_bps > 0 && (last_reported_fraction_loss_ != fraction_loss || | 343 (bitrate_bps > 0 && (last_reported_fraction_loss_ != fraction_loss || |
342 last_reported_rtt_ != rtt)); | 344 last_reported_rtt_ != rtt)); |
| 345 if (changed && (last_reported_bitrate_bps_ == 0 || bitrate_bps == 0)) { |
| 346 LOG(LS_INFO) << "Bitrate estimate state changed, BWE: " << bitrate_bps |
| 347 << " bps."; |
| 348 } |
343 last_reported_bitrate_bps_ = bitrate_bps; | 349 last_reported_bitrate_bps_ = bitrate_bps; |
344 last_reported_fraction_loss_ = fraction_loss; | 350 last_reported_fraction_loss_ = fraction_loss; |
345 last_reported_rtt_ = rtt; | 351 last_reported_rtt_ = rtt; |
346 return changed; | 352 return changed; |
347 } | 353 } |
348 | 354 |
349 bool CongestionController::IsSendQueueFull() const { | 355 bool CongestionController::IsSendQueueFull() const { |
350 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 356 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
351 } | 357 } |
352 | 358 |
353 bool CongestionController::IsNetworkDown() const { | 359 bool CongestionController::IsNetworkDown() const { |
354 rtc::CritScope cs(&critsect_); | 360 rtc::CritScope cs(&critsect_); |
355 return network_state_ == kNetworkDown; | 361 return network_state_ == kNetworkDown; |
356 } | 362 } |
357 | 363 |
358 } // namespace webrtc | 364 } // namespace webrtc |
OLD | NEW |