| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void OnTransportOverheadChanged(MediaType media, | 114 void OnTransportOverheadChanged(MediaType media, |
| 115 int transport_overhead_per_packet) override; | 115 int transport_overhead_per_packet) override; |
| 116 | 116 |
| 117 void OnNetworkRouteChanged(const std::string& transport_name, | 117 void OnNetworkRouteChanged(const std::string& transport_name, |
| 118 const rtc::NetworkRoute& network_route) override; | 118 const rtc::NetworkRoute& network_route) override; |
| 119 | 119 |
| 120 void OnSentPacket(const rtc::SentPacket& sent_packet) override; | 120 void OnSentPacket(const rtc::SentPacket& sent_packet) override; |
| 121 | 121 |
| 122 // Implements BitrateObserver. | 122 // Implements BitrateObserver. |
| 123 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, | 123 void OnNetworkChanged(uint32_t bitrate_bps, |
| 124 int64_t rtt_ms) override; | 124 uint8_t fraction_loss, |
| 125 int64_t rtt_ms, |
| 126 int64_t probing_interval_ms) override; |
| 125 | 127 |
| 126 // Implements BitrateAllocator::LimitObserver. | 128 // Implements BitrateAllocator::LimitObserver. |
| 127 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, | 129 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, |
| 128 uint32_t max_padding_bitrate_bps) override; | 130 uint32_t max_padding_bitrate_bps) override; |
| 129 | 131 |
| 130 private: | 132 private: |
| 131 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, | 133 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, |
| 132 size_t length); | 134 size_t length); |
| 133 DeliveryStatus DeliverRtp(MediaType media_type, | 135 DeliveryStatus DeliverRtp(MediaType media_type, |
| 134 const uint8_t* packet, | 136 const uint8_t* packet, |
| (...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 } | 871 } |
| 870 | 872 |
| 871 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { | 873 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| 872 if (first_packet_sent_ms_ == -1) | 874 if (first_packet_sent_ms_ == -1) |
| 873 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); | 875 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); |
| 874 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, | 876 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, |
| 875 clock_->TimeInMilliseconds()); | 877 clock_->TimeInMilliseconds()); |
| 876 congestion_controller_->OnSentPacket(sent_packet); | 878 congestion_controller_->OnSentPacket(sent_packet); |
| 877 } | 879 } |
| 878 | 880 |
| 879 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, | 881 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, |
| 880 int64_t rtt_ms) { | 882 uint8_t fraction_loss, |
| 883 int64_t rtt_ms, |
| 884 int64_t probing_interval_ms) { |
| 881 // TODO(perkj): Consider making sure CongestionController operates on | 885 // TODO(perkj): Consider making sure CongestionController operates on |
| 882 // |worker_queue_|. | 886 // |worker_queue_|. |
| 883 if (!worker_queue_.IsCurrent()) { | 887 if (!worker_queue_.IsCurrent()) { |
| 884 worker_queue_.PostTask([this, target_bitrate_bps, fraction_loss, rtt_ms] { | 888 worker_queue_.PostTask( |
| 885 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms); | 889 [this, target_bitrate_bps, fraction_loss, rtt_ms, probing_interval_ms] { |
| 886 }); | 890 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms, |
| 891 probing_interval_ms); |
| 892 }); |
| 887 return; | 893 return; |
| 888 } | 894 } |
| 889 RTC_DCHECK_RUN_ON(&worker_queue_); | 895 RTC_DCHECK_RUN_ON(&worker_queue_); |
| 890 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, | 896 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
| 891 rtt_ms); | 897 rtt_ms, probing_interval_ms); |
| 892 | 898 |
| 893 // Ignore updates if bitrate is zero (the aggregate network state is down). | 899 // Ignore updates if bitrate is zero (the aggregate network state is down). |
| 894 if (target_bitrate_bps == 0) { | 900 if (target_bitrate_bps == 0) { |
| 895 rtc::CritScope lock(&bitrate_crit_); | 901 rtc::CritScope lock(&bitrate_crit_); |
| 896 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); | 902 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); |
| 897 pacer_bitrate_kbps_counter_.ProcessAndPause(); | 903 pacer_bitrate_kbps_counter_.ProcessAndPause(); |
| 898 return; | 904 return; |
| 899 } | 905 } |
| 900 | 906 |
| 901 bool sending_video; | 907 bool sending_video; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 1105 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| 1100 ReadLockScoped read_lock(*receive_crit_); | 1106 ReadLockScoped read_lock(*receive_crit_); |
| 1101 auto it = video_receive_ssrcs_.find(ssrc); | 1107 auto it = video_receive_ssrcs_.find(ssrc); |
| 1102 if (it == video_receive_ssrcs_.end()) | 1108 if (it == video_receive_ssrcs_.end()) |
| 1103 return false; | 1109 return false; |
| 1104 return it->second->OnRecoveredPacket(packet, length); | 1110 return it->second->OnRecoveredPacket(packet, length); |
| 1105 } | 1111 } |
| 1106 | 1112 |
| 1107 } // namespace internal | 1113 } // namespace internal |
| 1108 } // namespace webrtc | 1114 } // namespace webrtc |
| OLD | NEW |