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

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

Issue 2437503004: Set actual transport overhead in rtp_rtcp (Closed)
Patch Set: 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..b327ac1aa5a23f306971813388ae66b60bd12e2a 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
@@ -413,32 +413,15 @@ uint16_t ModuleRtpRtcpImpl::MaxDataPayloadLength() const {
}
int32_t ModuleRtpRtcpImpl::SetTransportOverhead(
the sun 2016/10/20 08:56:46 Remove the return value from this API - the result
michaelt 2016/10/20 09:38:05 Done.
- const bool tcp,
- const bool ipv6,
- const uint8_t authentication_overhead) {
- uint16_t packet_overhead = 0;
- if (ipv6) {
- packet_overhead = 40;
- } else {
- packet_overhead = 20;
- }
- if (tcp) {
- // TCP.
- packet_overhead += 20;
- } else {
- // UDP.
- packet_overhead += 8;
- }
- packet_overhead += authentication_overhead;
-
- if (packet_overhead == packet_overhead_) {
+ int transport_overhead_per_packet_byte) {
+ if (transport_overhead_per_packet_byte == packet_overhead_) {
// Ok same as before.
return 0;
}
size_t mtu = rtp_sender_.MaxPayloadLength() + packet_overhead_;
- size_t max_payload_length = mtu - packet_overhead;
- packet_overhead_ = 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);
return 0;

Powered by Google App Engine
This is Rietveld 408576698