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

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..5348ff6586f186802d4d0f5df763b62fb13f0a7a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -444,6 +444,20 @@ int32_t ModuleRtpRtcpImpl::SetTransportOverhead(
return 0;
}
+void ModuleRtpRtcpImpl::SetTransportOverhead(
+ int transport_overhead_per_packet_byte) {
+ if (transport_overhead_per_packet_byte == packet_overhead_) {
+ // Ok same as before.
+ return;
+ }
+
+ size_t mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_;
+ 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