[Unified Plan] Support legacy endpoints that do not use a=mid
These legacy endpoints were supported with Plan B since the SDP
parser would fill in default MID values if a=mid was absent that
happened to match the default offered MIDs.
With Unified Plan, these default MIDs changed so the autofilled
MIDs do not match any more.
This CL adds information to the SessionDescription struct to
indicate whether or not a=mid was present and modified
PeerConnection::SetRemoteDescription to copy MIDs from the local
description if the a=mid lines are not present.
Bug: webrtc:9540
Change-Id: Ibf923b4ad59edb0facd06ddbd01cc10c62fc48e6
Reviewed-on: https://webrtc-review.googlesource.com/c/114820
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Amit Hilbuch <amithi@webrtc.org>
Reviewed-by: Seth Hampson <shampson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26054}
diff --git a/pc/peerconnection.h b/pc/peerconnection.h
index 3105b2f..7529543 100644
--- a/pc/peerconnection.h
+++ b/pc/peerconnection.h
@@ -652,6 +652,12 @@
return configuration_.sdp_semantics == SdpSemantics::kUnifiedPlan;
}
+ // The offer/answer machinery assumes the media section MID is present and
+ // unique. To support legacy end points that do not supply a=mid lines, this
+ // method will modify the session description to add MIDs generated according
+ // to the SDP semantics.
+ void FillInMissingRemoteMids(cricket::SessionDescription* remote_description);
+
// Is there an RtpSender of the given type?
bool HasRtpSender(cricket::MediaType type) const;