webrtc/modules/rtp_rtcp/source/mid_oracle.cc
Steve Anton 296a0ce4c7 Add MID sending to RTPSender
This CL adds the ability to configure RTPSender to include the
MID header extension when sending packets. The MID will be
included on every packet at the start of the stream until an RTCP
acknoledgment is received for that SSRC at which point it will
stop being included. The MID will be included on regular RTP
streams as well as RTX streams.

Bug: webrtc:4050
Change-Id: Ie27ebee1cd00a67f2b931f5363788f523e3e684f
Reviewed-on: https://webrtc-review.googlesource.com/60582
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22574}
2018-03-23 01:50:45 +00:00

32 lines
885 B
C++

/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/rtp_rtcp/source/mid_oracle.h"
namespace webrtc {
MidOracle::MidOracle(const std::string& mid) : mid_(mid) {}
MidOracle::~MidOracle() = default;
void MidOracle::OnReceivedRtcpReportBlocks(
const ReportBlockList& report_blocks) {
if (!send_mid_) {
return;
}
for (const RTCPReportBlock& report_block : report_blocks) {
if (report_block.source_ssrc == ssrc_) {
send_mid_ = false;
break;
}
}
}
} // namespace webrtc