From 3a15ba6fbf01e849d8097871f68dff76fcae0adb Mon Sep 17 00:00:00 2001 From: Tomas Gunnarsson Date: Tue, 21 Nov 2023 15:50:34 +0000 Subject: [PATCH] Reland^2 "Reland: Remove unsupported configuration value, `allow_codec_switching`" This reverts commit 117d847901ea231cd86ca152b359b88619b9de20. Reason for revert: Downstream error has been corrected. Original change's description: > Revert "Reland: Remove unsupported configuration value, `allow_codec_switching`" > > This reverts commit 23501a2aa656b94e26d4c67b8b9393258551560f. > > Reason for revert: Breaks downstream features > > Original change's description: > > Reland: Remove unsupported configuration value, `allow_codec_switching` > > > > This reverts commit 6b0c5babe0700f12493cf659e1b35c58d2327995. > > > > Reason for revert: Relanding once downstream issues have been addressed > > > > Original change's description: > > > Revert "Remove unsupported configuration value, `allow_codec_switching`" > > > > > > This reverts commit 8f7a17f80f43a47ce3801a3cfd2afda3575c8023. > > > > > > Reason for revert: breaks downstream > > > > > > Original change's description: > > > > Remove unsupported configuration value, `allow_codec_switching` > > > > > > > > Bug: webrtc:11341 > > > > Change-Id: I8ff598848996bd63ccc572e11f8f69c892a4a459 > > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324284 > > > > Reviewed-by: Philip Eliasson > > > > Commit-Queue: Tomas Gunnarsson > > > > Cr-Commit-Position: refs/heads/main@{#40995} > > > > > > Bug: webrtc:11341 > > > Change-Id: I784fd95062fc71f8dcc139b05121985f60709004 > > > No-Presubmit: true > > > No-Tree-Checks: true > > > No-Try: true > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324780 > > > Owners-Override: Philip Eliasson > > > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com > > > Commit-Queue: Philip Eliasson > > > Cr-Commit-Position: refs/heads/main@{#40998} > > > > Bug: webrtc:11341 > > Change-Id: I3cb3e699fd76942c51f0f42a99bcb19ac607632e > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/324782 > > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com > > Commit-Queue: Tomas Gunnarsson > > Cr-Commit-Position: refs/heads/main@{#41032} > > Bug: webrtc:11341 > Change-Id: I0eb8e6a464a8a51e6359caf8f43231dc275c4f20 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/327382 > Commit-Queue: Mirko Bonadei > Auto-Submit: Tomas Gunnarsson > Reviewed-by: Mirko Bonadei > Commit-Queue: Tomas Gunnarsson > Cr-Commit-Position: refs/heads/main@{#41161} Bug: webrtc:11341 Change-Id: I4a5390a3b8c5e665b742fc564709847ad8853ba9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328160 Reviewed-by: Harald Alvestrand Commit-Queue: Tomas Gunnarsson Reviewed-by: Philip Eliasson Bot-Commit: rubber-stamper@appspot.gserviceaccount.com Cr-Commit-Position: refs/heads/main@{#41213} --- api/peer_connection_interface.h | 4 ---- pc/peer_connection.cc | 3 --- sdk/android/api/org/webrtc/PeerConnection.java | 12 ------------ sdk/android/src/jni/pc/peer_connection.cc | 4 ---- sdk/objc/api/peerconnection/RTCConfiguration.h | 6 ------ sdk/objc/api/peerconnection/RTCConfiguration.mm | 3 --- 6 files changed, 32 deletions(-) diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 2d0abd8156..8977137f65 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -666,10 +666,6 @@ class RTC_EXPORT PeerConnectionInterface : public webrtc::RefCountInterface { // Added to be able to control rollout of this feature. bool enable_implicit_rollback = false; - // Whether network condition based codec switching is allowed. - // TODO(bugs.webrtc.org/11341): Remove this unsupported config value. - absl::optional allow_codec_switching; - // The delay before doing a usage histogram report for long-lived // PeerConnections. Used for testing only. absl::optional report_usage_pattern_delay_ms; diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 8cb0825336..48cdce2e3d 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -329,7 +329,6 @@ RTCErrorOr ApplyConfiguration( modified_config.active_reset_srtp_params = configuration.active_reset_srtp_params; modified_config.turn_logging_id = configuration.turn_logging_id; - modified_config.allow_codec_switching = configuration.allow_codec_switching; modified_config.stable_writable_connection_ping_interval_ms = configuration.stable_writable_connection_ping_interval_ms; if (configuration != modified_config) { @@ -458,7 +457,6 @@ bool PeerConnectionInterface::RTCConfiguration::operator==( bool offer_extmap_allow_mixed; std::string turn_logging_id; bool enable_implicit_rollback; - absl::optional allow_codec_switching; absl::optional report_usage_pattern_delay_ms; absl::optional stable_writable_connection_ping_interval_ms; VpnPreference vpn_preference; @@ -522,7 +520,6 @@ bool PeerConnectionInterface::RTCConfiguration::operator==( offer_extmap_allow_mixed == o.offer_extmap_allow_mixed && turn_logging_id == o.turn_logging_id && enable_implicit_rollback == o.enable_implicit_rollback && - allow_codec_switching == o.allow_codec_switching && report_usage_pattern_delay_ms == o.report_usage_pattern_delay_ms && stable_writable_connection_ping_interval_ms == o.stable_writable_connection_ping_interval_ms && diff --git a/sdk/android/api/org/webrtc/PeerConnection.java b/sdk/android/api/org/webrtc/PeerConnection.java index 5c87fe3ea3..d530bc2c0c 100644 --- a/sdk/android/api/org/webrtc/PeerConnection.java +++ b/sdk/android/api/org/webrtc/PeerConnection.java @@ -540,11 +540,6 @@ public class PeerConnection { // every offer/answer negotiation.This is only intended to be a workaround for crbug.com/835958 public boolean activeResetSrtpParams; - // Whether this client is allowed to switch encoding codec mid-stream. This is a workaround for - // a WebRTC bug where the receiver could get confussed if a codec switch happened mid-call. - // Null indicates no change to currently configured value. - @Nullable public Boolean allowCodecSwitching; - /** * Defines advanced optional cryptographic settings related to SRTP and * frame encryption for native WebRTC. Setting this will overwrite any @@ -611,7 +606,6 @@ public class PeerConnection { activeResetSrtpParams = false; cryptoOptions = null; turnLoggingId = null; - allowCodecSwitching = null; enableImplicitRollback = false; offerExtmapAllowMixed = true; } @@ -801,12 +795,6 @@ public class PeerConnection { return activeResetSrtpParams; } - @Nullable - @CalledByNative("RTCConfiguration") - Boolean getAllowCodecSwitching() { - return allowCodecSwitching; - } - @Nullable @CalledByNative("RTCConfiguration") CryptoOptions getCryptoOptions() { diff --git a/sdk/android/src/jni/pc/peer_connection.cc b/sdk/android/src/jni/pc/peer_connection.cc index a063804ac8..e5fb11e3b4 100644 --- a/sdk/android/src/jni/pc/peer_connection.cc +++ b/sdk/android/src/jni/pc/peer_connection.cc @@ -267,10 +267,6 @@ void JavaToNativeRTCConfiguration( Java_RTCConfiguration_getActiveResetSrtpParams(jni, j_rtc_config); rtc_config->crypto_options = JavaToNativeOptionalCryptoOptions(jni, j_crypto_options); - - rtc_config->allow_codec_switching = JavaToNativeOptionalBool( - jni, Java_RTCConfiguration_getAllowCodecSwitching(jni, j_rtc_config)); - rtc_config->offer_extmap_allow_mixed = Java_RTCConfiguration_getOfferExtmapAllowMixed(jni, j_rtc_config); rtc_config->enable_implicit_rollback = diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h index 1b0d14baf1..011eaa613d 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.h +++ b/sdk/objc/api/peerconnection/RTCConfiguration.h @@ -184,12 +184,6 @@ RTC_OBJC_EXPORT */ @property(nonatomic, assign) BOOL activeResetSrtpParams; -/** If the remote side support mid-stream codec switches then allow encoder - * switching to be performed. - */ - -@property(nonatomic, assign) BOOL allowCodecSwitching; - /** * Defines advanced optional cryptographic settings related to SRTP and * frame encryption for native WebRTC. Setting this will overwrite any diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm index 8e42cb2a82..86ecbabf8d 100644 --- a/sdk/objc/api/peerconnection/RTCConfiguration.mm +++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm @@ -51,7 +51,6 @@ @synthesize sdpSemantics = _sdpSemantics; @synthesize turnCustomizer = _turnCustomizer; @synthesize activeResetSrtpParams = _activeResetSrtpParams; -@synthesize allowCodecSwitching = _allowCodecSwitching; @synthesize cryptoOptions = _cryptoOptions; @synthesize turnLoggingId = _turnLoggingId; @synthesize rtcpAudioReportIntervalMs = _rtcpAudioReportIntervalMs; @@ -139,7 +138,6 @@ _turnLoggingId = [NSString stringWithUTF8String:config.turn_logging_id.c_str()]; _rtcpAudioReportIntervalMs = config.audio_rtcp_report_interval_ms(); _rtcpVideoReportIntervalMs = config.video_rtcp_report_interval_ms(); - _allowCodecSwitching = config.allow_codec_switching.value_or(false); _enableImplicitRollback = config.enable_implicit_rollback; _offerExtmapAllowMixed = config.offer_extmap_allow_mixed; _iceCheckIntervalStrongConnectivity = @@ -286,7 +284,6 @@ nativeConfig->turn_logging_id = [_turnLoggingId UTF8String]; nativeConfig->set_audio_rtcp_report_interval_ms(_rtcpAudioReportIntervalMs); nativeConfig->set_video_rtcp_report_interval_ms(_rtcpVideoReportIntervalMs); - nativeConfig->allow_codec_switching = _allowCodecSwitching; nativeConfig->enable_implicit_rollback = _enableImplicitRollback; nativeConfig->offer_extmap_allow_mixed = _offerExtmapAllowMixed; if (_iceCheckIntervalStrongConnectivity != nil) {