Add SDP semantics option to RTCConfiguration

This setting allows the user of PeerConnection to choose whether
to use Plan B (current) or Unified Plan (future) semantics.
Unified Plan semantics are not yet supported.

Bug: chromium:465349
Change-Id: I77a5c376c83f335f734488e11e619582a314bffe
Reviewed-on: https://webrtc-review.googlesource.com/22766
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Peter Thatcher <pthatcher@webrtc.org>
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Zhi Huang <zhihuang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20806}
This commit is contained in:
Steve Anton
2017-11-20 10:25:56 -08:00
committed by Commit Bot
parent 03fdc1042f
commit 79e7960152
5 changed files with 61 additions and 5 deletions

View File

@ -141,6 +141,10 @@ class StatsObserver : public rtc::RefCountInterface {
virtual ~StatsObserver() {}
};
// For now, kDefault is interpreted as kPlanB.
// TODO(bugs.webrtc.org/8530): Switch default to kUnifiedPlan.
enum class SdpSemantics { kDefault, kPlanB, kUnifiedPlan };
class PeerConnectionInterface : public rtc::RefCountInterface {
public:
// See http://dev.w3.org/2011/webrtc/editor/webrtc.html#state-definitions .
@ -476,6 +480,34 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
// called.
webrtc::TurnCustomizer* turn_customizer = nullptr;
// Configure the SDP semantics used by this PeerConnection. Note that the
// WebRTC 1.0 specification requires kUnifiedPlan semantics. The
// RtpTransceiver API is only available with kUnifiedPlan semantics.
//
// kPlanB will cause PeerConnection to create offers and answers with at
// most one audio and one video m= section with multiple RtpSenders and
// RtpReceivers specified as multiple a=ssrc lines within the section. This
// will also cause PeerConnection to reject offers/answers with multiple m=
// sections of the same media type.
//
// kUnifiedPlan will cause PeerConnection to create offers and answers with
// multiple m= sections where each m= section maps to one RtpSender and one
// RtpReceiver (an RtpTransceiver), either both audio or both video. Plan B
// style offers or answers will be rejected in calls to SetLocalDescription
// or SetRemoteDescription.
//
// For users who only send at most one audio and one video track, this
// choice does not matter and should be left as kDefault.
//
// For users who wish to send multiple audio/video streams and need to stay
// interoperable with legacy WebRTC implementations, specify kPlanB.
//
// For users who wish to send multiple audio/video streams and/or wish to
// use the new RtpTransceiver API, specify kUnifiedPlan.
//
// TODO(steveanton): Implement support for kUnifiedPlan.
SdpSemantics sdp_semantics = SdpSemantics::kDefault;
//
// Don't forget to update operator== if adding something.
//