| 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 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 } | 728 } |
| 729 | 729 |
| 730 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, | 730 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, |
| 731 int64_t rtt_ms) { | 731 int64_t rtt_ms) { |
| 732 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, | 732 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
| 733 rtt_ms); | 733 rtt_ms); |
| 734 | 734 |
| 735 // Ignore updates where the bitrate is zero because the aggregate network | 735 // Ignore updates where the bitrate is zero because the aggregate network |
| 736 // state is down. | 736 // state is down. |
| 737 if (target_bitrate_bps > 0) { | 737 if (target_bitrate_bps > 0) { |
| 738 { |
| 739 ReadLockScoped read_lock(*send_crit_); |
| 740 // Do not update the stats if we are not sending video. |
| 741 if (video_send_streams_.empty()) |
| 742 return; |
| 743 } |
| 738 rtc::CritScope lock(&bitrate_crit_); | 744 rtc::CritScope lock(&bitrate_crit_); |
| 739 // We only update these stats if we have send streams, and assume that | 745 // We only update these stats if we have send streams, and assume that |
| 740 // OnNetworkChanged is called roughly with a fixed frequency. | 746 // OnNetworkChanged is called roughly with a fixed frequency. |
| 741 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; | 747 estimated_send_bitrate_sum_kbits_ += target_bitrate_bps / 1000; |
| 742 // Pacer bitrate might be higher than bitrate estimate if enforcing min | 748 // Pacer bitrate might be higher than bitrate estimate if enforcing min |
| 743 // bitrate. | 749 // bitrate. |
| 744 uint32_t pacer_bitrate_bps = | 750 uint32_t pacer_bitrate_bps = |
| 745 std::max(target_bitrate_bps, min_allocated_send_bitrate_bps_); | 751 std::max(target_bitrate_bps, min_allocated_send_bitrate_bps_); |
| 746 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; | 752 pacer_bitrate_sum_kbits_ += pacer_bitrate_bps / 1000; |
| 747 ++num_bitrate_updates_; | 753 ++num_bitrate_updates_; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 // thread. Then this check can be enabled. | 907 // thread. Then this check can be enabled. |
| 902 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); | 908 // RTC_DCHECK(!configuration_thread_checker_.CalledOnValidThread()); |
| 903 if (RtpHeaderParser::IsRtcp(packet, length)) | 909 if (RtpHeaderParser::IsRtcp(packet, length)) |
| 904 return DeliverRtcp(media_type, packet, length); | 910 return DeliverRtcp(media_type, packet, length); |
| 905 | 911 |
| 906 return DeliverRtp(media_type, packet, length, packet_time); | 912 return DeliverRtp(media_type, packet, length, packet_time); |
| 907 } | 913 } |
| 908 | 914 |
| 909 } // namespace internal | 915 } // namespace internal |
| 910 } // namespace webrtc | 916 } // namespace webrtc |
| OLD | NEW |