Don't check MIDs when demuxing RTP packets in Call
The MID header extension is handled by the RtpTransport
which lives above Call and takes care of demuxing to SSRC.
Bug: webrtc:4050
Change-Id: I27135e296ae9c7b15e926ba17547c26c75684ad6
Reviewed-on: https://webrtc-review.googlesource.com/65025
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22682}
diff --git a/call/rtp_demuxer.cc b/call/rtp_demuxer.cc
index 6a9cae8..a8944b5 100644
--- a/call/rtp_demuxer.cc
+++ b/call/rtp_demuxer.cc
@@ -168,7 +168,7 @@
// RSID and RRID are routed to the same sinks. If an RSID is specified on a
// repair packet, it should be ignored and the RRID should be used.
std::string packet_mid, packet_rsid;
- bool has_mid = packet.GetExtension<RtpMid>(&packet_mid);
+ bool has_mid = use_mid_ && packet.GetExtension<RtpMid>(&packet_mid);
bool has_rsid = packet.GetExtension<RepairedRtpStreamId>(&packet_rsid);
if (!has_rsid) {
has_rsid = packet.GetExtension<RtpStreamId>(&packet_rsid);
diff --git a/call/rtp_demuxer.h b/call/rtp_demuxer.h
index 971c151..0a8acc2 100644
--- a/call/rtp_demuxer.h
+++ b/call/rtp_demuxer.h
@@ -137,6 +137,10 @@
// Deprecated: Use the above method.
void DeregisterRsidResolutionObserver(const SsrcBindingObserver* observer);
+ // Configure whether to look at the MID header extension when demuxing
+ // incoming RTP packets. By default this is enabled.
+ void set_use_mid(bool use_mid) { use_mid_ = use_mid; }
+
private:
// Returns true if adding a sink with the given criteria would cause conflicts
// with the existing criteria and should be rejected.
@@ -197,6 +201,8 @@
// Observers which will be notified when an RSID association to an SSRC is
// resolved by this object.
std::vector<SsrcBindingObserver*> ssrc_binding_observers_;
+
+ bool use_mid_ = true;
};
} // namespace webrtc
diff --git a/call/rtp_stream_receiver_controller.cc b/call/rtp_stream_receiver_controller.cc
index a5d73f5..da58e59 100644
--- a/call/rtp_stream_receiver_controller.cc
+++ b/call/rtp_stream_receiver_controller.cc
@@ -35,7 +35,12 @@
controller_->RemoveSink(sink_);
}
-RtpStreamReceiverController::RtpStreamReceiverController() = default;
+RtpStreamReceiverController::RtpStreamReceiverController() {
+ // At this level the demuxer is only configured to demux by SSRC, so don't
+ // worry about MIDs (MIDs are handled by upper layers).
+ demuxer_.set_use_mid(false);
+}
+
RtpStreamReceiverController::~RtpStreamReceiverController() = default;
std::unique_ptr<RtpStreamReceiverInterface>