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/pc/channel.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
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/channel.cc
diff --git a/webrtc/pc/channel.cc b/webrtc/pc/channel.cc
index f22bdc4ca41029155f2fe4fe511bb9c2765ee679..477c2deb19e297a8a71ae9643b83de28bc0bcb3e 100644
--- a/webrtc/pc/channel.cc
+++ b/webrtc/pc/channel.cc
@@ -585,7 +585,8 @@ void BaseChannel::OnSelectedCandidatePairChanged(
network_route = rtc::NetworkRoute(
ready_to_send, selected_candidate_pair->local_candidate().network_id(),
selected_candidate_pair->remote_candidate().network_id(),
- last_sent_packet_id);
+ last_sent_packet_id,
+ GetTransportOverheadPerPacket(*selected_candidate_pair));
}
invoker_.AsyncInvoke<void>(
RTC_FROM_HERE, worker_thread_,
@@ -1661,6 +1662,29 @@ void BaseChannel::UpdateMediaSendRecvState() {
Bind(&BaseChannel::UpdateMediaSendRecvState_w, this));
}
+int BaseChannel::GetTransportOverheadPerPacket(
+ const CandidatePairInterface& selected_candidate_pair) {
+ constexpr int kIpv4Overhaed = 20;
+ constexpr int kIpv6Overhaed = 40;
+ constexpr int kUdpOverhaed = 8;
+ constexpr int kTcpOverhaed = 20;
+ constexpr int kSrtpAuthOverhaed = 4;
stefan-webrtc 2016/10/26 15:08:41 kSrtpAuthOverhead I'm not sure about this, but I
honghaiz3 2016/10/26 17:44:56 In this site, it shows the srtp overhead is 12 byt
michaelt 2016/10/27 13:05:17 According to https://tools.ietf.org/html/rfc3711,
+
+ int ransport_overhead_per_packet = 0;
honghaiz3 2016/10/26 17:44:56 ransport... =>transport...
michaelt 2016/10/27 13:05:17 Done.
+ ransport_overhead_per_packet +=
+ selected_candidate_pair.local_candidate().protocol() == TCP_PROTOCOL_NAME
+ ? kTcpOverhaed
+ : kUdpOverhaed;
+ ransport_overhead_per_packet +=
+ selected_candidate_pair.local_candidate().address().family() == AF_INET
+ ? kIpv4Overhaed
+ : kIpv6Overhaed;
+ if (secure()) {
+ ransport_overhead_per_packet += kSrtpAuthOverhaed;
+ }
+ return ransport_overhead_per_packet;
+}
+
void VoiceChannel::UpdateMediaSendRecvState_w() {
// Render incoming data if we're the active call, and we have the local
// content. We receive data on the default channel and multiplexed streams.
« no previous file with comments | « webrtc/pc/channel.h ('k') | webrtc/pc/channel_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698