OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 } | 437 } |
438 | 438 |
439 size_t mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_; | 439 size_t mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_; |
440 size_t max_payload_length = mtu - packet_overhead; | 440 size_t max_payload_length = mtu - packet_overhead; |
441 packet_overhead_ = packet_overhead; | 441 packet_overhead_ = packet_overhead; |
442 rtcp_sender_.SetMaxPayloadLength(max_payload_length); | 442 rtcp_sender_.SetMaxPayloadLength(max_payload_length); |
443 rtp_sender_.SetMaxPayloadLength(max_payload_length); | 443 rtp_sender_.SetMaxPayloadLength(max_payload_length); |
444 return 0; | 444 return 0; |
445 } | 445 } |
446 | 446 |
| 447 void ModuleRtpRtcpImpl::SetTransportOverhead( |
| 448 int transport_overhead_per_packet) { |
| 449 RTC_DCHECK_GT(transport_overhead_per_packet, 0); |
| 450 int mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_; |
| 451 RTC_DCHECK_LT(transport_overhead_per_packet, mtu); |
| 452 size_t max_payload_length = mtu - transport_overhead_per_packet; |
| 453 packet_overhead_ = transport_overhead_per_packet; |
| 454 rtcp_sender_.SetMaxPayloadLength(max_payload_length); |
| 455 rtp_sender_.SetMaxPayloadLength(max_payload_length); |
| 456 } |
| 457 |
447 int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(uint16_t mtu) { | 458 int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(uint16_t mtu) { |
448 RTC_DCHECK_LE(mtu, IP_PACKET_SIZE) << "MTU too large: " << mtu; | 459 RTC_DCHECK_LE(mtu, IP_PACKET_SIZE) << "MTU too large: " << mtu; |
449 RTC_DCHECK_GT(mtu, packet_overhead_) << "MTU too small: " << mtu; | 460 RTC_DCHECK_GT(mtu, packet_overhead_) << "MTU too small: " << mtu; |
450 size_t max_payload_length = mtu - packet_overhead_; | 461 size_t max_payload_length = mtu - packet_overhead_; |
451 rtcp_sender_.SetMaxPayloadLength(max_payload_length); | 462 rtcp_sender_.SetMaxPayloadLength(max_payload_length); |
452 rtp_sender_.SetMaxPayloadLength(max_payload_length); | 463 rtp_sender_.SetMaxPayloadLength(max_payload_length); |
453 return 0; | 464 return 0; |
454 } | 465 } |
455 | 466 |
456 RtcpMode ModuleRtpRtcpImpl::RTCP() const { | 467 RtcpMode ModuleRtpRtcpImpl::RTCP() const { |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 944 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
934 StreamDataCountersCallback* callback) { | 945 StreamDataCountersCallback* callback) { |
935 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 946 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
936 } | 947 } |
937 | 948 |
938 StreamDataCountersCallback* | 949 StreamDataCountersCallback* |
939 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 950 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
940 return rtp_sender_.GetRtpStatisticsCallback(); | 951 return rtp_sender_.GetRtpStatisticsCallback(); |
941 } | 952 } |
942 } // namespace webrtc | 953 } // namespace webrtc |
OLD | NEW |