Add new PeerConnection APIs to the ObjC SDK
This CL adds wrappers for the following PeerConnection native
APIs to the Objective C API:
- SdpSemantics enum added to the RTCConfiguration
- RTCRtpTransceiver
- RTCPeerConnection.addTrack
- RTCPeerConnection.removeTrack
- RTCPeerConnection.addTransceiver
- RTCPeerConnection.transceivers
Bug: webrtc:8870
Change-Id: I9449df9742a59e90894712dc7749ca30b569d94b
Reviewed-on: https://webrtc-review.googlesource.com/54780
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22214}
diff --git a/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h b/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
index f3a8d3f..97cc5a4 100644
--- a/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
+++ b/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
@@ -63,6 +63,13 @@
RTCEncryptionKeyTypeECDSA,
};
+/** Represents the chosen SDP semantics for the RTCPeerConnection. */
+typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
+ RTCSdpSemanticsDefault,
+ RTCSdpSemanticsPlanB,
+ RTCSdpSemanticsUnifiedPlan,
+};
+
NS_ASSUME_NONNULL_BEGIN
RTC_EXPORT
@@ -132,6 +139,33 @@
*/
@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
+/** Configure the SDP semantics used by this PeerConnection. Note that the
+ * WebRTC 1.0 specification requires UnifiedPlan semantics. The
+ * RTCRtpTransceiver API is only available with UnifiedPlan semantics.
+ *
+ * PlanB will cause RTCPeerConnection to create offers and answers with at
+ * most one audio and one video m= section with multiple RTCRtpSenders and
+ * RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
+ * will also cause RTCPeerConnection to ignore all but the first m= section of
+ * the same media type.
+ *
+ * UnifiedPlan will cause RTCPeerConnection to create offers and answers with
+ * multiple m= sections where each m= section maps to one RTCRtpSender and one
+ * RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
+ * will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
+ * that form a Plan B stream.
+ *
+ * For users who only send at most one audio and one video track, this
+ * choice does not matter and should be left as Default.
+ *
+ * For users who wish to send multiple audio/video streams and need to stay
+ * interoperable with legacy WebRTC implementations, specify PlanB.
+ *
+ * For users who wish to send multiple audio/video streams and/or wish to
+ * use the new RTCRtpTransceiver API, specify UnifiedPlan.
+ */
+@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
+
- (instancetype)init;
@end