| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, | 703 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, |
| 704 clock_->TimeInMilliseconds()); | 704 clock_->TimeInMilliseconds()); |
| 705 congestion_controller_->OnSentPacket(sent_packet); | 705 congestion_controller_->OnSentPacket(sent_packet); |
| 706 } | 706 } |
| 707 | 707 |
| 708 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, | 708 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, |
| 709 int64_t rtt_ms) { | 709 int64_t rtt_ms) { |
| 710 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, | 710 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
| 711 rtt_ms); | 711 rtt_ms); |
| 712 | 712 |
| 713 { | 713 // Ignore updates where the bitrate is zero because the aggregate network |
| 714 // state is down. |
| 715 if (target_bitrate_bps > 0) { |
| 714 rtc::CritScope lock(&bitrate_crit_); | 716 rtc::CritScope lock(&bitrate_crit_); |
| 715 // We only update these stats if we have send streams, and assume that | 717 // We only update these stats if we have send streams, and assume that |
| 716 // OnNetworkChanged is called roughly with a fixed frequency. | 718 // OnNetworkChanged is called roughly with a fixed frequency. |
| 717 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; | 719 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; |
| 718 // Pacer bitrate might be higher than bitrate estimate if enforcing min | 720 // Pacer bitrate might be higher than bitrate estimate if enforcing min |
| 719 // bitrate. | 721 // bitrate. |
| 720 uint32_t pacer_bitrate_bps = | 722 uint32_t pacer_bitrate_bps = |
| 721 std::max(target_bitrate_bps, min_allocated_send_bitrate_bps_); | 723 std::max(target_bitrate_bps, min_allocated_send_bitrate_bps_); |
| 722 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; | 724 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; |
| 723 ++num_bitrate_updates_; | 725 ++num_bitrate_updates_; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 // thread. Then this check can be enabled. | 879 // thread. Then this check can be enabled. |
| 878 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 880 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 879 if (RtpHeaderParser::IsRtcp(packet, length)) | 881 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 880 return DeliverRtcp(media_type, packet, length); | 882 return DeliverRtcp(media_type, packet, length); |
| 881 | 883 |
| 882 return DeliverRtp(media_type, packet, length, packet_time); | 884 return DeliverRtp(media_type, packet, length, packet_time); |
| 883 } | 885 } |
| 884 | 886 |
| 885 } // namespace internal | 887 } // namespace internal |
| 886 } // namespace webrtc | 888 } // namespace webrtc |
| OLD | NEW |