Change default sdp_semantics to kNotSpecified.
In preparation for switching the default from kPlanB to kUnifiedPlan,
which could cause subtle bugs for those not prepared for it, we change
the default to kNotSpecified. The only purpose of kNotSpecified is to
crash, forcing any dependencies to explicitly set their sdp_semantics
value.
Tests are updated to explicitly set sdp_semantics when necessary, and
where the test does not care we update to kUnifiedPlan.
If this change lands without getting reverted we can let it sit for a
few weeks, after which we should change the default to kUnifiedPlan and
delete kNotSpecified.
Bug: webrtc:11121
Change-Id: I19b669b0735d78e269e19eaae86c2d7d95a91141
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/242968
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Henrik Boström <hbos@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35651}
diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h
index c367fae..d40d7a4 100644
--- a/api/peer_connection_interface.h
+++ b/api/peer_connection_interface.h
@@ -169,9 +169,16 @@
};
enum class SdpSemantics {
+ // TODO(https://crbug.com/webrtc/13528): Remove support for kPlanB.
kPlanB_DEPRECATED,
kPlanB [[deprecated]] = kPlanB_DEPRECATED,
- kUnifiedPlan
+ kUnifiedPlan,
+ // The default SdpSemantics value is about to change to kUnifiedPlan. During a
+ // short transition period, kNotSpecified 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
+ // kUnifiedPlan, delete kNotSpecified.
+ kNotSpecified
};
class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
@@ -639,10 +646,17 @@
// 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.
+ // it is possible to specify kPlanB until the code is finally removed
+ // (https://crbug.com/webrtc/13528).
//
// For all other users, specify kUnifiedPlan.
- SdpSemantics sdp_semantics = SdpSemantics::kPlanB_DEPRECATED;
+ //
+ // The default SdpSemantics value is about to change to kUnifiedPlan. During
+ // a short transition period, kNotSpecified 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
+ // kUnifiedPlan, delete kNotSpecified.
+ SdpSemantics sdp_semantics = SdpSemantics::kNotSpecified;
// TODO(bugs.webrtc.org/9891) - Move to crypto_options or remove.
// Actively reset the SRTP parameters whenever the DTLS transports