Expose extra ICE params in RTCConfiguration on iOS
Bug: None
Change-Id: I16ca28055cd9ca371f1e21b5950cf759973da894
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/213421
Reviewed-by: Kári Helgason <kthelgason@webrtc.org>
Reviewed-by: Jonas Oreland <jonaso@webrtc.org>
Commit-Queue: Yura Yaroshevich <yura.yaroshevich@gmail.com>
Cr-Commit-Position: refs/heads/master@{#33628}
diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.h b/sdk/objc/api/peerconnection/RTCConfiguration.h
index af42c45..02461b0 100644
--- a/sdk/objc/api/peerconnection/RTCConfiguration.h
+++ b/sdk/objc/api/peerconnection/RTCConfiguration.h
@@ -233,6 +233,41 @@
*/
@property(nonatomic, assign) BOOL offerExtmapAllowMixed;
+/**
+ * Defines the interval applied to ALL candidate pairs
+ * when ICE is strongly connected, and it overrides the
+ * default value of this interval in the ICE implementation;
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceCheckIntervalStrongConnectivity;
+
+/**
+ * Defines the counterpart for ALL pairs when ICE is
+ * weakly connected, and it overrides the default value of
+ * this interval in the ICE implementation
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceCheckIntervalWeakConnectivity;
+
+/**
+ * The min time period for which a candidate pair must wait for response to
+ * connectivity checks before it becomes unwritable. This parameter
+ * overrides the default value in the ICE implementation if set.
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceUnwritableTimeout;
+
+/**
+ * The min number of connectivity checks that a candidate pair must sent
+ * without receiving response before it becomes unwritable. This parameter
+ * overrides the default value in the ICE implementation if set.
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceUnwritableMinChecks;
+
+/**
+ * The min time period for which a candidate pair must wait for response to
+ * connectivity checks it becomes inactive. This parameter overrides the
+ * default value in the ICE implementation if set.
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceInactiveTimeout;
+
- (instancetype)init;
@end
diff --git a/sdk/objc/api/peerconnection/RTCConfiguration.mm b/sdk/objc/api/peerconnection/RTCConfiguration.mm
index d003eed..fafcd0e 100644
--- a/sdk/objc/api/peerconnection/RTCConfiguration.mm
+++ b/sdk/objc/api/peerconnection/RTCConfiguration.mm
@@ -58,6 +58,11 @@
@synthesize rtcpVideoReportIntervalMs = _rtcpVideoReportIntervalMs;
@synthesize enableImplicitRollback = _enableImplicitRollback;
@synthesize offerExtmapAllowMixed = _offerExtmapAllowMixed;
+@synthesize iceCheckIntervalStrongConnectivity = _iceCheckIntervalStrongConnectivity;
+@synthesize iceCheckIntervalWeakConnectivity = _iceCheckIntervalWeakConnectivity;
+@synthesize iceUnwritableTimeout = _iceUnwritableTimeout;
+@synthesize iceUnwritableMinChecks = _iceUnwritableMinChecks;
+@synthesize iceInactiveTimeout = _iceInactiveTimeout;
- (instancetype)init {
// Copy defaults.
@@ -138,6 +143,22 @@
_allowCodecSwitching = config.allow_codec_switching.value_or(false);
_enableImplicitRollback = config.enable_implicit_rollback;
_offerExtmapAllowMixed = config.offer_extmap_allow_mixed;
+ _iceCheckIntervalStrongConnectivity =
+ config.ice_check_interval_strong_connectivity.has_value() ?
+ [NSNumber numberWithInt:*config.ice_check_interval_strong_connectivity] :
+ nil;
+ _iceCheckIntervalWeakConnectivity = config.ice_check_interval_weak_connectivity.has_value() ?
+ [NSNumber numberWithInt:*config.ice_check_interval_weak_connectivity] :
+ nil;
+ _iceUnwritableTimeout = config.ice_unwritable_timeout.has_value() ?
+ [NSNumber numberWithInt:*config.ice_unwritable_timeout] :
+ nil;
+ _iceUnwritableMinChecks = config.ice_unwritable_min_checks.has_value() ?
+ [NSNumber numberWithInt:*config.ice_unwritable_min_checks] :
+ nil;
+ _iceInactiveTimeout = config.ice_inactive_timeout.has_value() ?
+ [NSNumber numberWithInt:*config.ice_inactive_timeout] :
+ nil;
}
return self;
}
@@ -271,6 +292,23 @@
nativeConfig->allow_codec_switching = _allowCodecSwitching;
nativeConfig->enable_implicit_rollback = _enableImplicitRollback;
nativeConfig->offer_extmap_allow_mixed = _offerExtmapAllowMixed;
+ if (_iceCheckIntervalStrongConnectivity != nil) {
+ nativeConfig->ice_check_interval_strong_connectivity =
+ absl::optional<int>(_iceCheckIntervalStrongConnectivity.intValue);
+ }
+ if (_iceCheckIntervalWeakConnectivity != nil) {
+ nativeConfig->ice_check_interval_weak_connectivity =
+ absl::optional<int>(_iceCheckIntervalWeakConnectivity.intValue);
+ }
+ if (_iceUnwritableTimeout != nil) {
+ nativeConfig->ice_unwritable_timeout = absl::optional<int>(_iceUnwritableTimeout.intValue);
+ }
+ if (_iceUnwritableMinChecks != nil) {
+ nativeConfig->ice_unwritable_min_checks = absl::optional<int>(_iceUnwritableMinChecks.intValue);
+ }
+ if (_iceInactiveTimeout != nil) {
+ nativeConfig->ice_inactive_timeout = absl::optional<int>(_iceInactiveTimeout.intValue);
+ }
return nativeConfig.release();
}