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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } else { | 415 } else { |
416 remb_->RemoveRembSender(rtp_module); | 416 remb_->RemoveRembSender(rtp_module); |
417 } | 417 } |
418 if (receiver) { | 418 if (receiver) { |
419 remb_->AddReceiveChannel(rtp_module); | 419 remb_->AddReceiveChannel(rtp_module); |
420 } else { | 420 } else { |
421 remb_->RemoveReceiveChannel(rtp_module); | 421 remb_->RemoveReceiveChannel(rtp_module); |
422 } | 422 } |
423 } | 423 } |
424 | 424 |
| 425 void ChannelGroup::SignalNetworkState(NetworkState state) { |
| 426 if (state == kNetworkUp) { |
| 427 pacer_->Resume(); |
| 428 } else { |
| 429 pacer_->Pause(); |
| 430 } |
| 431 } |
| 432 |
425 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps, | 433 void ChannelGroup::OnNetworkChanged(uint32_t target_bitrate_bps, |
426 uint8_t fraction_loss, | 434 uint8_t fraction_loss, |
427 int64_t rtt) { | 435 int64_t rtt) { |
428 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt); | 436 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt); |
429 int pad_up_to_bitrate_bps = 0; | 437 int pad_up_to_bitrate_bps = 0; |
430 { | 438 { |
431 rtc::CritScope lock(&encoder_map_crit_); | 439 rtc::CritScope lock(&encoder_map_crit_); |
432 for (const auto& encoder : vie_encoder_map_) | 440 for (const auto& encoder : vie_encoder_map_) |
433 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps(); | 441 pad_up_to_bitrate_bps += encoder.second->GetPaddingNeededBps(); |
434 } | 442 } |
435 pacer_->UpdateBitrate( | 443 pacer_->UpdateBitrate( |
436 target_bitrate_bps / 1000, | 444 target_bitrate_bps / 1000, |
437 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, | 445 PacedSender::kDefaultPaceMultiplier * target_bitrate_bps / 1000, |
438 pad_up_to_bitrate_bps / 1000); | 446 pad_up_to_bitrate_bps / 1000); |
439 } | 447 } |
440 } // namespace webrtc | 448 } // namespace webrtc |
OLD | NEW |