| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 } | 872 } |
| 871 | 873 |
| 872 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { | 874 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
| 873 if (first_packet_sent_ms_ == -1) | 875 if (first_packet_sent_ms_ == -1) |
| 874 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); | 876 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); |
| 875 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, | 877 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, |
| 876 clock_->TimeInMilliseconds()); | 878 clock_->TimeInMilliseconds()); |
| 877 congestion_controller_->OnSentPacket(sent_packet); | 879 congestion_controller_->OnSentPacket(sent_packet); |
| 878 } | 880 } |
| 879 | 881 |
| 880 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, | 882 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, |
| 881 int64_t rtt_ms) { | 883 uint8_t fraction_loss, |
| 884 int64_t rtt_ms, |
| 885 int64_t probing_interval_ms) { |
| 882 // TODO(perkj): Consider making sure CongestionController operates on | 886 // TODO(perkj): Consider making sure CongestionController operates on |
| 883 // |worker_queue_|. | 887 // |worker_queue_|. |
| 884 if (!worker_queue_.IsCurrent()) { | 888 if (!worker_queue_.IsCurrent()) { |
| 885 worker_queue_.PostTask([this, target_bitrate_bps, fraction_loss, rtt_ms] { | 889 worker_queue_.PostTask( |
| 886 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms); | 890 [this, target_bitrate_bps, fraction_loss, rtt_ms, probing_interval_ms] { |
| 887 }); | 891 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms, |
| 892 probing_interval_ms); |
| 893 }); |
| 888 return; | 894 return; |
| 889 } | 895 } |
| 890 RTC_DCHECK_RUN_ON(&worker_queue_); | 896 RTC_DCHECK_RUN_ON(&worker_queue_); |
| 891 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, | 897 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
| 892 rtt_ms); | 898 rtt_ms, probing_interval_ms); |
| 893 | 899 |
| 894 // Ignore updates if bitrate is zero (the aggregate network state is down). | 900 // Ignore updates if bitrate is zero (the aggregate network state is down). |
| 895 if (target_bitrate_bps == 0) { | 901 if (target_bitrate_bps == 0) { |
| 896 rtc::CritScope lock(&bitrate_crit_); | 902 rtc::CritScope lock(&bitrate_crit_); |
| 897 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); | 903 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); |
| 898 pacer_bitrate_kbps_counter_.ProcessAndPause(); | 904 pacer_bitrate_kbps_counter_.ProcessAndPause(); |
| 899 return; | 905 return; |
| 900 } | 906 } |
| 901 | 907 |
| 902 bool sending_video; | 908 bool sending_video; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 1106 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
| 1101 ReadLockScoped read_lock(*receive_crit_); | 1107 ReadLockScoped read_lock(*receive_crit_); |
| 1102 auto it = video_receive_ssrcs_.find(ssrc); | 1108 auto it = video_receive_ssrcs_.find(ssrc); |
| 1103 if (it == video_receive_ssrcs_.end()) | 1109 if (it == video_receive_ssrcs_.end()) |
| 1104 return false; | 1110 return false; |
| 1105 return it->second->OnRecoveredPacket(packet, length); | 1111 return it->second->OnRecoveredPacket(packet, length); |
| 1106 } | 1112 } |
| 1107 | 1113 |
| 1108 } // namespace internal | 1114 } // namespace internal |
| 1109 } // namespace webrtc | 1115 } // namespace webrtc |
| OLD | NEW |