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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void SignalChannelNetworkState(MediaType media, NetworkState state) override; | 112 void SignalChannelNetworkState(MediaType media, NetworkState state) override; |
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 |
| 123 // TODO(minyue): remove this when old OnNetworkChanged is deprecated. See |
| 124 // https://bugs.chromium.org/p/webrtc/issues/detail?id=6796 |
| 125 using CongestionController::Observer::OnNetworkChanged; |
| 126 |
122 // Implements BitrateObserver. | 127 // Implements BitrateObserver. |
123 void OnNetworkChanged(uint32_t bitrate_bps, uint8_t fraction_loss, | 128 void OnNetworkChanged(uint32_t bitrate_bps, |
124 int64_t rtt_ms) override; | 129 uint8_t fraction_loss, |
| 130 int64_t rtt_ms, |
| 131 int64_t probing_interval_ms) override; |
125 | 132 |
126 // Implements BitrateAllocator::LimitObserver. | 133 // Implements BitrateAllocator::LimitObserver. |
127 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, | 134 void OnAllocationLimitsChanged(uint32_t min_send_bitrate_bps, |
128 uint32_t max_padding_bitrate_bps) override; | 135 uint32_t max_padding_bitrate_bps) override; |
129 | 136 |
130 private: | 137 private: |
131 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, | 138 DeliveryStatus DeliverRtcp(MediaType media_type, const uint8_t* packet, |
132 size_t length); | 139 size_t length); |
133 DeliveryStatus DeliverRtp(MediaType media_type, | 140 DeliveryStatus DeliverRtp(MediaType media_type, |
134 const uint8_t* packet, | 141 const uint8_t* packet, |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 } | 888 } |
882 | 889 |
883 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { | 890 void Call::OnSentPacket(const rtc::SentPacket& sent_packet) { |
884 if (first_packet_sent_ms_ == -1) | 891 if (first_packet_sent_ms_ == -1) |
885 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); | 892 first_packet_sent_ms_ = clock_->TimeInMilliseconds(); |
886 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, | 893 video_send_delay_stats_->OnSentPacket(sent_packet.packet_id, |
887 clock_->TimeInMilliseconds()); | 894 clock_->TimeInMilliseconds()); |
888 congestion_controller_->OnSentPacket(sent_packet); | 895 congestion_controller_->OnSentPacket(sent_packet); |
889 } | 896 } |
890 | 897 |
891 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, uint8_t fraction_loss, | 898 void Call::OnNetworkChanged(uint32_t target_bitrate_bps, |
892 int64_t rtt_ms) { | 899 uint8_t fraction_loss, |
| 900 int64_t rtt_ms, |
| 901 int64_t probing_interval_ms) { |
893 // TODO(perkj): Consider making sure CongestionController operates on | 902 // TODO(perkj): Consider making sure CongestionController operates on |
894 // |worker_queue_|. | 903 // |worker_queue_|. |
895 if (!worker_queue_.IsCurrent()) { | 904 if (!worker_queue_.IsCurrent()) { |
896 worker_queue_.PostTask([this, target_bitrate_bps, fraction_loss, rtt_ms] { | 905 worker_queue_.PostTask( |
897 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms); | 906 [this, target_bitrate_bps, fraction_loss, rtt_ms, probing_interval_ms] { |
898 }); | 907 OnNetworkChanged(target_bitrate_bps, fraction_loss, rtt_ms, |
| 908 probing_interval_ms); |
| 909 }); |
899 return; | 910 return; |
900 } | 911 } |
901 RTC_DCHECK_RUN_ON(&worker_queue_); | 912 RTC_DCHECK_RUN_ON(&worker_queue_); |
902 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, | 913 bitrate_allocator_->OnNetworkChanged(target_bitrate_bps, fraction_loss, |
903 rtt_ms); | 914 rtt_ms, probing_interval_ms); |
904 | 915 |
905 // Ignore updates if bitrate is zero (the aggregate network state is down). | 916 // Ignore updates if bitrate is zero (the aggregate network state is down). |
906 if (target_bitrate_bps == 0) { | 917 if (target_bitrate_bps == 0) { |
907 rtc::CritScope lock(&bitrate_crit_); | 918 rtc::CritScope lock(&bitrate_crit_); |
908 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); | 919 estimated_send_bitrate_kbps_counter_.ProcessAndPause(); |
909 pacer_bitrate_kbps_counter_.ProcessAndPause(); | 920 pacer_bitrate_kbps_counter_.ProcessAndPause(); |
910 return; | 921 return; |
911 } | 922 } |
912 | 923 |
913 bool sending_video; | 924 bool sending_video; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1111 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); | 1122 uint32_t ssrc = ByteReader<uint32_t>::ReadBigEndian(&packet[8]); |
1112 ReadLockScoped read_lock(*receive_crit_); | 1123 ReadLockScoped read_lock(*receive_crit_); |
1113 auto it = video_receive_ssrcs_.find(ssrc); | 1124 auto it = video_receive_ssrcs_.find(ssrc); |
1114 if (it == video_receive_ssrcs_.end()) | 1125 if (it == video_receive_ssrcs_.end()) |
1115 return false; | 1126 return false; |
1116 return it->second->OnRecoveredPacket(packet, length); | 1127 return it->second->OnRecoveredPacket(packet, length); |
1117 } | 1128 } |
1118 | 1129 |
1119 } // namespace internal | 1130 } // namespace internal |
1120 } // namespace webrtc | 1131 } // namespace webrtc |
OLD | NEW |