Declare Plan B DEPRECATED

Bug: webrtc:11121
Change-Id: Id9b933a71a9bfd1d20ddd137f43459cdc8ed1896
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/238780
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Commit-Queue: Harald Alvestrand <hta@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35504}
This commit is contained in:
Harald Alvestrand
2021-12-08 14:30:55 +00:00
committed by WebRTC LUCI CQ
parent 7c1461fcb7
commit fa67aef93f
4 changed files with 19 additions and 16 deletions

View File

@ -168,7 +168,11 @@ class StatsObserver : public rtc::RefCountInterface {
~StatsObserver() override = default; ~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 { class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
public: public:
@ -622,24 +626,23 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
// WebRTC 1.0 specification requires kUnifiedPlan semantics. The // WebRTC 1.0 specification requires kUnifiedPlan semantics. The
// RtpTransceiver API is only available with kUnifiedPlan semantics. // 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 // kUnifiedPlan will cause PeerConnection to create offers and answers with
// multiple m= sections where each m= section maps to one RtpSender and one // multiple m= sections where each m= section maps to one RtpSender and one
// RtpReceiver (an RtpTransceiver), either both audio or both video. This // RtpReceiver (an RtpTransceiver), either both audio or both video. This
// will also cause PeerConnection to ignore all but the first a=ssrc lines // will also cause PeerConnection to ignore all but the first a=ssrc lines
// that form a Plan B stream. // that form a Plan B stream.
// //
// For users who wish to send multiple audio/video streams and need to stay // kPlanB will cause PeerConnection to create offers and answers with at
// interoperable with legacy WebRTC implementations or use legacy APIs, // most one audio and one video m= section with multiple RtpSenders and
// specify kPlanB. // 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. // 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. // TODO(bugs.webrtc.org/9891) - Move to crypto_options or remove.
// Actively reset the SRTP parameters whenever the DTLS transports // Actively reset the SRTP parameters whenever the DTLS transports

View File

@ -2540,7 +2540,7 @@ void PeerConnection::ReportSdpBundleUsage(
} else { } else {
usage = kBundleUsageEmpty; 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 // In plan-b, simple/complex usage will not show up in the number of
// m-lines or BUNDLE. // m-lines or BUNDLE.
usage = using_bundle ? kBundleUsageBundlePlanB : kBundleUsageNoBundlePlanB; usage = using_bundle ? kBundleUsageBundlePlanB : kBundleUsageNoBundlePlanB;

View File

@ -112,13 +112,13 @@ SdpSemantics JavaToNativeSdpSemantics(JNIEnv* jni,
std::string enum_name = GetJavaEnumName(jni, j_sdp_semantics); std::string enum_name = GetJavaEnumName(jni, j_sdp_semantics);
if (enum_name == "PLAN_B") if (enum_name == "PLAN_B")
return SdpSemantics::kPlanB; return SdpSemantics::kPlanB_DEPRECATED;
if (enum_name == "UNIFIED_PLAN") if (enum_name == "UNIFIED_PLAN")
return SdpSemantics::kUnifiedPlan; return SdpSemantics::kUnifiedPlan;
RTC_DCHECK_NOTREACHED(); RTC_DCHECK_NOTREACHED();
return SdpSemantics::kPlanB; return SdpSemantics::kPlanB_DEPRECATED;
} }
ScopedJavaLocalRef<jobject> NativeToJavaCandidatePairChange( ScopedJavaLocalRef<jobject> NativeToJavaCandidatePairChange(

View File

@ -520,7 +520,7 @@
+ (webrtc::SdpSemantics)nativeSdpSemanticsForSdpSemantics:(RTCSdpSemantics)sdpSemantics { + (webrtc::SdpSemantics)nativeSdpSemanticsForSdpSemantics:(RTCSdpSemantics)sdpSemantics {
switch (sdpSemantics) { switch (sdpSemantics) {
case RTCSdpSemanticsPlanB: case RTCSdpSemanticsPlanB:
return webrtc::SdpSemantics::kPlanB; return webrtc::SdpSemantics::kPlanB_DEPRECATED;
case RTCSdpSemanticsUnifiedPlan: case RTCSdpSemanticsUnifiedPlan:
return webrtc::SdpSemantics::kUnifiedPlan; return webrtc::SdpSemantics::kUnifiedPlan;
} }
@ -528,7 +528,7 @@
+ (RTCSdpSemantics)sdpSemanticsForNativeSdpSemantics:(webrtc::SdpSemantics)sdpSemantics { + (RTCSdpSemantics)sdpSemanticsForNativeSdpSemantics:(webrtc::SdpSemantics)sdpSemantics {
switch (sdpSemantics) { switch (sdpSemantics) {
case webrtc::SdpSemantics::kPlanB: case webrtc::SdpSemantics::kPlanB_DEPRECATED:
return RTCSdpSemanticsPlanB; return RTCSdpSemanticsPlanB;
case webrtc::SdpSemantics::kUnifiedPlan: case webrtc::SdpSemantics::kUnifiedPlan:
return RTCSdpSemanticsUnifiedPlan; return RTCSdpSemanticsUnifiedPlan;