| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 void SendSideCongestionController::SetAllocatedSendBitrateLimits( | 170 void SendSideCongestionController::SetAllocatedSendBitrateLimits( |
| 171 int min_send_bitrate_bps, | 171 int min_send_bitrate_bps, |
| 172 int max_padding_bitrate_bps) { | 172 int max_padding_bitrate_bps) { |
| 173 pacer_->SetSendBitrateLimits(min_send_bitrate_bps, max_padding_bitrate_bps); | 173 pacer_->SetSendBitrateLimits(min_send_bitrate_bps, max_padding_bitrate_bps); |
| 174 } | 174 } |
| 175 | 175 |
| 176 int64_t SendSideCongestionController::GetPacerQueuingDelayMs() const { | 176 int64_t SendSideCongestionController::GetPacerQueuingDelayMs() const { |
| 177 return IsNetworkDown() ? 0 : pacer_->QueueInMs(); | 177 return IsNetworkDown() ? 0 : pacer_->QueueInMs(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 int64_t SendSideCongestionController::GetFirstPacketTimeMs() const { |
| 181 return pacer_->FirstSentPacketTimeMs(); |
| 182 } |
| 183 |
| 180 void SendSideCongestionController::SignalNetworkState(NetworkState state) { | 184 void SendSideCongestionController::SignalNetworkState(NetworkState state) { |
| 181 LOG(LS_INFO) << "SignalNetworkState " | 185 LOG(LS_INFO) << "SignalNetworkState " |
| 182 << (state == kNetworkUp ? "Up" : "Down"); | 186 << (state == kNetworkUp ? "Up" : "Down"); |
| 183 if (state == kNetworkUp) { | 187 if (state == kNetworkUp) { |
| 184 pacer_->Resume(); | 188 pacer_->Resume(); |
| 185 } else { | 189 } else { |
| 186 pacer_->Pause(); | 190 pacer_->Pause(); |
| 187 } | 191 } |
| 188 { | 192 { |
| 189 rtc::CritScope cs(&network_state_lock_); | 193 rtc::CritScope cs(&network_state_lock_); |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 bool SendSideCongestionController::IsSendQueueFull() const { | 313 bool SendSideCongestionController::IsSendQueueFull() const { |
| 310 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; | 314 return pacer_->ExpectedQueueTimeMs() > PacedSender::kMaxQueueLengthMs; |
| 311 } | 315 } |
| 312 | 316 |
| 313 bool SendSideCongestionController::IsNetworkDown() const { | 317 bool SendSideCongestionController::IsNetworkDown() const { |
| 314 rtc::CritScope cs(&network_state_lock_); | 318 rtc::CritScope cs(&network_state_lock_); |
| 315 return network_state_ == kNetworkDown; | 319 return network_state_ == kNetworkDown; |
| 316 } | 320 } |
| 317 | 321 |
| 318 } // namespace webrtc | 322 } // namespace webrtc |
| OLD | NEW |