Optimize sending the MID and (R)RID header extensions

These RTP header extensions are used for Unified Plan SDP / BUNDLE and
replace SSRC signaling.

Previously, the RTPSender would attach these header extensions to every
packet when configured. Now, the header extensions will be attached to
every packet until the an RTCP RR is received on that SSRC which
indicates the receiver knows what MID/RID the SSRC is associated with.

This should reduce overhead by 2-4 bytes per packet when the MID header
extension is used and by 4-8 bytes when both header extensions are used.

Bug: webrtc:10078
Change-Id: I5fa3ce28a75224adf11d2792bf4ff8dc76e46d99
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/146480
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#28685}
This commit is contained in:
Steve Anton
2019-07-21 15:04:21 -04:00
committed by Commit Bot
parent 9c32ad1f4b
commit 2bac7da134
5 changed files with 278 additions and 58 deletions

View File

@ -733,11 +733,20 @@ void ModuleRtpRtcpImpl::OnReceivedRtcpReportBlocks(
const ReportBlockList& report_blocks) {
if (ack_observer_) {
uint32_t ssrc = SSRC();
absl::optional<uint32_t> rtx_ssrc;
if (rtp_sender_->RtxStatus() != kRtxOff) {
rtx_ssrc = rtp_sender_->RtxSsrc();
}
for (const RTCPReportBlock& report_block : report_blocks) {
if (ssrc == report_block.source_ssrc) {
rtp_sender_->OnReceivedAckOnSsrc(
report_block.extended_highest_sequence_number);
ack_observer_->OnReceivedAck(
report_block.extended_highest_sequence_number);
} else if (rtx_ssrc && *rtx_ssrc == report_block.source_ssrc) {
rtp_sender_->OnReceivedAckOnRtxSsrc(
report_block.extended_highest_sequence_number);
}
}
}