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

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

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: Rename SignalTransportOverheadChanged to UpdateTransportOverhead. Created 4 years, 1 month 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
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 664bf3acd1a38d36e77f6610d6fed9903fcb8cae..72a1f11f42641cfa427991dbf4dc3458ecb04737 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -452,6 +452,17 @@ int32_t ModuleRtpRtcpImpl::SetTransportOverhead(
return 0;
}
+void ModuleRtpRtcpImpl::SetTransportOverhead(
+ int transport_overhead_per_packet) {
+ RTC_DCHECK_GT(transport_overhead_per_packet, 0);
+ int mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_;
+ RTC_DCHECK_LT(transport_overhead_per_packet, mtu);
+ size_t max_payload_length = mtu - transport_overhead_per_packet;
+ packet_overhead_ = transport_overhead_per_packet;
+ 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;
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.h ('k') | webrtc/modules/rtp_rtcp/test/testAPI/test_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698