From fa67aef93f3020d33b2eba5543fbe37a3d15d594 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Wed, 8 Dec 2021 14:30:55 +0000 Subject: [PATCH] Declare Plan B DEPRECATED MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:11121 Change-Id: Id9b933a71a9bfd1d20ddd137f43459cdc8ed1896 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238780 Reviewed-by: Henrik Boström Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#35504} --- api/peer_connection_interface.h | 25 +++++++++++-------- pc/peer_connection.cc | 2 +- sdk/android/src/jni/pc/peer_connection.cc | 4 +-- .../api/peerconnection/RTCConfiguration.mm | 4 +-- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 678ece8762..6d42b848b6 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -168,7 +168,11 @@ class StatsObserver : public rtc::RefCountInterface { ~StatsObserver() override = default; }; -enum class SdpSemantics { kPlanB, kUnifiedPlan }; +enum class SdpSemantics { + kPlanB_DEPRECATED, + kPlanB [[deprecated]] = kPlanB_DEPRECATED, + kUnifiedPlan +}; class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { public: @@ -622,24 +626,23 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // 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 ignore all but the first m= section 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. This // will also cause PeerConnection 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 kPlanB. + // 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 ignore all but the first m= section of + // the same media type. + // + // For users who have to interwork with legacy WebRTC implementations, + // it is possible to specify kPlanB until the code is finally removed. // // For all other users, specify kUnifiedPlan. - SdpSemantics sdp_semantics = SdpSemantics::kPlanB; + SdpSemantics sdp_semantics = SdpSemantics::kPlanB_DEPRECATED; // TODO(bugs.webrtc.org/9891) - Move to crypto_options or remove. // Actively reset the SRTP parameters whenever the DTLS transports diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index c3cd87ef59..885f5573d5 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2540,7 +2540,7 @@ void PeerConnection::ReportSdpBundleUsage( } else { usage = kBundleUsageEmpty; } - } else if (configuration_.sdp_semantics == SdpSemantics::kPlanB) { + } else if (configuration_.sdp_semantics == SdpSemantics::kPlanB_DEPRECATED) { // In plan-b, simple/complex usage will not show up in the number of // m-lines or BUNDLE. usage = using_bundle ? kBundleUsageBundlePlanB : kBundleUsageNoBundlePlanB; diff --git a/sdk/android/src/jni/pc/peer_connection.cc b/sdk/android/src/jni/pc/peer_connection.cc index 7875fe9bfa..9c73b94000 100644 --- a/sdk/android/src/jni/pc/peer_connection.cc +++ b/sdk/android/src/jni/pc/peer_connection.cc @@ -112,13 +112,13 @@ SdpSemantics JavaToNativeSdpSemantics(JNIEnv* jni, std::string enum_name = GetJavaEnumName(jni, j_sdp_semantics); if (enum_name == "PLAN_B") - return SdpSemantics::kPlanB; + return SdpSemantics::kPlanB_DEPRECATED; if (enum_name == "UNIFIED_PLAN") return SdpSemantics::kUnifiedPlan; RTC_DCHECK_NOTREACHED(); - return SdpSemantics::kPlanB; + return SdpSemantics::kPlanB_DEPRECATED; } ScopedJavaLocalRef NativeToJavaCandidatePairChange( diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index 0f0239f93d..2b6e4ec848 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -520,7 +520,7 @@ + (webrtc::SdpSemantics)nativeSdpSemanticsForSdpSemantics:(RTCSdpSemantics)sdpSemantics { switch (sdpSemantics) { case RTCSdpSemanticsPlanB: - return webrtc::SdpSemantics::kPlanB; + return webrtc::SdpSemantics::kPlanB_DEPRECATED; case RTCSdpSemanticsUnifiedPlan: return webrtc::SdpSemantics::kUnifiedPlan; } @@ -528,7 +528,7 @@ + (RTCSdpSemantics)sdpSemanticsForNativeSdpSemantics:(webrtc::SdpSemantics)sdpSemantics { switch (sdpSemantics) { - case webrtc::SdpSemantics::kPlanB: + case webrtc::SdpSemantics::kPlanB_DEPRECATED: return RTCSdpSemanticsPlanB; case webrtc::SdpSemantics::kUnifiedPlan: return RTCSdpSemanticsUnifiedPlan;