Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(924)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: respond to comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
index c219cb1e001bb793e0461399e774dfcbc9aeade1..a22e0b197808c633ece95a9f2c9d3c8239ea5b26 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -444,6 +444,17 @@ int32_t ModuleRtpRtcpImpl::SetTransportOverhead(
return 0;
}
+void ModuleRtpRtcpImpl::SetTransportOverhead(
+ int transport_overhead_per_packet_byte) {
+ RTC_DCHECK_GT(transport_overhead_per_packet_byte, 0);
+ int mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_;
+ RTC_DCHECK_LT(transport_overhead_per_packet_byte, mtu);
+ size_t max_payload_length = mtu - transport_overhead_per_packet_byte;
+ packet_overhead_ = transport_overhead_per_packet_byte;
+ rtcp_sender_.SetMaxPayloadLength(max_payload_length);
+ rtp_sender_.SetMaxPayloadLength(max_payload_length);
+}
+
int32_t ModuleRtpRtcpImpl::SetMaxTransferUnit(uint16_t mtu) {
RTC_DCHECK_LE(mtu, IP_PACKET_SIZE) << "MTU too large: " << mtu;
RTC_DCHECK_GT(mtu, packet_overhead_) << "MTU too small: " << mtu;

Powered by Google App Engine
This is Rietveld 408576698