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 #include "webrtc/video/video_send_stream.h" | 10 #include "webrtc/video/video_send_stream.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 | 326 |
327 void SetTransportOverhead(int transport_overhead_per_packet); | 327 void SetTransportOverhead(int transport_overhead_per_packet); |
328 | 328 |
329 private: | 329 private: |
330 class CheckEncoderActivityTask; | 330 class CheckEncoderActivityTask; |
331 class EncoderReconfiguredTask; | 331 class EncoderReconfiguredTask; |
332 | 332 |
333 // Implements BitrateAllocatorObserver. | 333 // Implements BitrateAllocatorObserver. |
334 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, | 334 uint32_t OnBitrateUpdated(uint32_t bitrate_bps, |
335 uint8_t fraction_loss, | 335 uint8_t fraction_loss, |
336 int64_t rtt) override; | 336 int64_t rtt, |
| 337 int64_t probing_interval_ms) override; |
337 | 338 |
338 // Implements webrtc::VCMProtectionCallback. | 339 // Implements webrtc::VCMProtectionCallback. |
339 int ProtectionRequest(const FecProtectionParams* delta_params, | 340 int ProtectionRequest(const FecProtectionParams* delta_params, |
340 const FecProtectionParams* key_params, | 341 const FecProtectionParams* key_params, |
341 uint32_t* sent_video_rate_bps, | 342 uint32_t* sent_video_rate_bps, |
342 uint32_t* sent_nack_rate_bps, | 343 uint32_t* sent_nack_rate_bps, |
343 uint32_t* sent_fec_rate_bps) override; | 344 uint32_t* sent_fec_rate_bps) override; |
344 | 345 |
345 // Implements OverheadObserver. | 346 // Implements OverheadObserver. |
346 void OnOverheadChanged(size_t overhead_bytes_per_packet) override; | 347 void OnOverheadChanged(size_t overhead_bytes_per_packet) override; |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 void VideoSendStreamImpl::SignalNetworkState(NetworkState state) { | 1164 void VideoSendStreamImpl::SignalNetworkState(NetworkState state) { |
1164 RTC_DCHECK_RUN_ON(worker_queue_); | 1165 RTC_DCHECK_RUN_ON(worker_queue_); |
1165 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1166 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
1166 rtp_rtcp->SetRTCPStatus(state == kNetworkUp ? config_->rtp.rtcp_mode | 1167 rtp_rtcp->SetRTCPStatus(state == kNetworkUp ? config_->rtp.rtcp_mode |
1167 : RtcpMode::kOff); | 1168 : RtcpMode::kOff); |
1168 } | 1169 } |
1169 } | 1170 } |
1170 | 1171 |
1171 uint32_t VideoSendStreamImpl::OnBitrateUpdated(uint32_t bitrate_bps, | 1172 uint32_t VideoSendStreamImpl::OnBitrateUpdated(uint32_t bitrate_bps, |
1172 uint8_t fraction_loss, | 1173 uint8_t fraction_loss, |
1173 int64_t rtt) { | 1174 int64_t rtt, |
| 1175 int64_t probing_interval_ms) { |
1174 RTC_DCHECK_RUN_ON(worker_queue_); | 1176 RTC_DCHECK_RUN_ON(worker_queue_); |
1175 RTC_DCHECK(payload_router_.active()) | 1177 RTC_DCHECK(payload_router_.active()) |
1176 << "VideoSendStream::Start has not been called."; | 1178 << "VideoSendStream::Start has not been called."; |
1177 | 1179 |
1178 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == | 1180 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe-WithOverhead") == |
1179 "Enabled") { | 1181 "Enabled") { |
1180 // Substract overhead from bitrate. | 1182 // Substract overhead from bitrate. |
1181 rtc::CritScope lock(&overhead_bytes_per_packet_crit_); | 1183 rtc::CritScope lock(&overhead_bytes_per_packet_crit_); |
1182 int packets_per_second = | 1184 int packets_per_second = |
1183 std::ceil(bitrate_bps / (8 * (config_->rtp.max_packet_size + | 1185 std::ceil(bitrate_bps / (8 * (config_->rtp.max_packet_size + |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1259 const uint16_t mtu = static_cast<uint16_t>( | 1261 const uint16_t mtu = static_cast<uint16_t>( |
1260 config_->rtp.max_packet_size + transport_overhead_bytes_per_packet); | 1262 config_->rtp.max_packet_size + transport_overhead_bytes_per_packet); |
1261 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { | 1263 for (RtpRtcp* rtp_rtcp : rtp_rtcp_modules_) { |
1262 rtp_rtcp->SetTransportOverhead(transport_overhead_bytes_per_packet); | 1264 rtp_rtcp->SetTransportOverhead(transport_overhead_bytes_per_packet); |
1263 rtp_rtcp->SetMaxTransferUnit(mtu); | 1265 rtp_rtcp->SetMaxTransferUnit(mtu); |
1264 } | 1266 } |
1265 } | 1267 } |
1266 | 1268 |
1267 } // namespace internal | 1269 } // namespace internal |
1268 } // namespace webrtc | 1270 } // namespace webrtc |
OLD | NEW |