diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index 4356b8d494..c7a20533a3 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -63,8 +63,15 @@ typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) { /** Represents the chosen SDP semantics for the RTCPeerConnection. */ typedef NS_ENUM(NSInteger, RTCSdpSemantics) { + // TODO(https://crbug.com/webrtc/13528): Remove support for Plan B. RTCSdpSemanticsPlanB, RTCSdpSemanticsUnifiedPlan, + // The default sdpSemantics value is about to change to Unified Plan. During + // a short transition period, NotSpecified is used to ensure clients that + // don't set sdpSemantics are aware of the change by CHECK-crashing. + // TODO(https://crbug.com/webrtc/11121): When the default has changed to + // UnifiedPlan, delete NotSpecified. + RTCSdpSemanticsNotSpecified, }; NS_ASSUME_NONNULL_BEGIN @@ -161,9 +168,10 @@ RTC_OBJC_EXPORT */ @property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval; -/** 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. +/** Configure the SDP semantics used by this PeerConnection. The WebRTC 1.0 + * specification requires RTCSdpSemanticsUnifiedPlan semantics and the + * RtpTransceiver API is only available in Unified Plan. RTCSdpSemanticsPlanB + * is being deprecated and will be removed at a future date. * * PlanB will cause RTCPeerConnection to create offers and answers with at * most one audio and one video m= section with multiple RTCRtpSenders and @@ -174,14 +182,18 @@ RTC_OBJC_EXPORT * 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. + * video. This will also cause RTCPeerConnection) to ignore all but the first + * a=ssrc lines that form a Plan B stream. * - * For users who wish to send multiple audio/video streams and need to stay - * interoperable with legacy WebRTC implementations or use legacy APIs, - * specify PlanB. + * For users who have to interwork with legacy WebRTC implementations, it + * is possible to specify PlanB until the code is finally removed + * (https://crbug.com/webrtc/13528). * - * For all other users, specify UnifiedPlan. + * The default SdpSemantics value is about to change to UnifiedPlan. During a + * short transition period, NotSpecified is used to ensure clients that don't + * set SdpSemantics are aware of the change by CHECK-crashing. + * TODO(https://crbug.com/webrtc/11121): When the default has changed to + * UnifiedPlan, delete NotSpecified. */ @property(nonatomic, assign) RTCSdpSemantics sdpSemantics; diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index 0885e96f4e..9e9bca7745 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -68,7 +68,7 @@ - (instancetype)init { // Copy defaults. webrtc::PeerConnectionInterface::RTCConfiguration config; - config.sdp_semantics = webrtc::SdpSemantics::kPlanB_DEPRECATED; + config.sdp_semantics = webrtc::SdpSemantics::kNotSpecified; return [self initWithNativeConfiguration:config]; } @@ -525,6 +525,8 @@ return webrtc::SdpSemantics::kPlanB_DEPRECATED; case RTCSdpSemanticsUnifiedPlan: return webrtc::SdpSemantics::kUnifiedPlan; + case RTCSdpSemanticsNotSpecified: + return webrtc::SdpSemantics::kNotSpecified; } } @@ -535,8 +537,7 @@ case webrtc::SdpSemantics::kUnifiedPlan: return RTCSdpSemanticsUnifiedPlan; case webrtc::SdpSemantics::kNotSpecified: - RTC_DCHECK_NOTREACHED(); - return RTCSdpSemanticsUnifiedPlan; + return RTCSdpSemanticsNotSpecified; } } @@ -546,6 +547,8 @@ return @"PLAN_B"; case RTCSdpSemanticsUnifiedPlan: return @"UNIFIED_PLAN"; + case RTCSdpSemanticsNotSpecified: + return @"NOT_SPECIFIED"; } } diff --git a/sdk/objc/unittests/RTCPeerConnectionTest.mm b/sdk/objc/unittests/RTCPeerConnectionTest.mm index 19b3c8e69f..8ebe6271ab 100644 --- a/sdk/objc/unittests/RTCPeerConnectionTest.mm +++ b/sdk/objc/unittests/RTCPeerConnectionTest.mm @@ -42,6 +42,7 @@ [[RTC_OBJC_TYPE(RTCIceServer) alloc] initWithURLStrings:urlStrings]; RTC_OBJC_TYPE(RTCConfiguration) *config = [[RTC_OBJC_TYPE(RTCConfiguration) alloc] init]; + config.sdpSemantics = RTCSdpSemanticsUnifiedPlan; config.iceServers = @[ server ]; config.iceTransportPolicy = RTCIceTransportPolicyRelay; config.bundlePolicy = RTCBundlePolicyMaxBundle; @@ -121,6 +122,7 @@ [[RTC_OBJC_TYPE(RTCIceServer) alloc] initWithURLStrings:urlStrings]; RTC_OBJC_TYPE(RTCConfiguration) *config = [[RTC_OBJC_TYPE(RTCConfiguration) alloc] init]; + config.sdpSemantics = RTCSdpSemanticsUnifiedPlan; config.iceServers = @[ server ]; RTC_OBJC_TYPE(RTCMediaConstraints) *contraints = [[RTC_OBJC_TYPE(RTCMediaConstraints) alloc] initWithMandatoryConstraints:@{} @@ -145,6 +147,7 @@ [[RTC_OBJC_TYPE(RTCPeerConnectionFactory) alloc] init]; RTC_OBJC_TYPE(RTCConfiguration) *config = [[RTC_OBJC_TYPE(RTCConfiguration) alloc] init]; + config.sdpSemantics = RTCSdpSemanticsUnifiedPlan; RTC_OBJC_TYPE(RTCMediaConstraints) *contraints = [[RTC_OBJC_TYPE(RTCMediaConstraints) alloc] initWithMandatoryConstraints:@{} optionalConstraints:nil]; @@ -175,6 +178,7 @@ [[RTC_OBJC_TYPE(RTCPeerConnectionFactory) alloc] init]; RTC_OBJC_TYPE(RTCConfiguration) *config = [[RTC_OBJC_TYPE(RTCConfiguration) alloc] init]; + config.sdpSemantics = RTCSdpSemanticsUnifiedPlan; RTC_OBJC_TYPE(RTCMediaConstraints) *contraints = [[RTC_OBJC_TYPE(RTCMediaConstraints) alloc] initWithMandatoryConstraints:@{} optionalConstraints:nil];