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