| 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;
|
| +
|
| + int ransport_overhead_per_packet = 0;
|
| + 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.
|
|
|