Objective-C API to set the ICE check rate through RTCConfiguration.
This is the Objective-C counterpart to
https://codereview.webrtc.org/2670053002/. Allows applications to
control the maximum ICE check rate to match bandwidth constraints.
BUG=webrtc:7082
Review-Url: https://codereview.webrtc.org/2674663002
Cr-Commit-Position: refs/heads/master@{#16423}
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
index bf602d7..ae37fc1 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCConfiguration.mm
@@ -37,6 +37,7 @@
@synthesize shouldPruneTurnPorts = _shouldPruneTurnPorts;
@synthesize shouldPresumeWritableWhenFullyRelayed =
_shouldPresumeWritableWhenFullyRelayed;
+@synthesize iceCheckMinInterval = _iceCheckMinInterval;
- (instancetype)init {
if (self = [super init]) {
@@ -68,13 +69,17 @@
_shouldPruneTurnPorts = config.prune_turn_ports;
_shouldPresumeWritableWhenFullyRelayed =
config.presume_writable_when_fully_relayed;
+ if (config.ice_check_min_interval) {
+ _iceCheckMinInterval =
+ [NSNumber numberWithInt:*config.ice_check_min_interval];
+ }
}
return self;
}
- (NSString *)description {
return [NSString stringWithFormat:
- @"RTCConfiguration: {\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n}\n",
+ @"RTCConfiguration: {\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%@\n}\n",
_iceServers,
[[self class] stringForTransportPolicy:_iceTransportPolicy],
[[self class] stringForBundlePolicy:_bundlePolicy],
@@ -89,7 +94,8 @@
_iceBackupCandidatePairPingInterval,
_iceCandidatePoolSize,
_shouldPruneTurnPorts,
- _shouldPresumeWritableWhenFullyRelayed];
+ _shouldPresumeWritableWhenFullyRelayed,
+ _iceCheckMinInterval];
}
#pragma mark - Private
@@ -139,6 +145,10 @@
nativeConfig->prune_turn_ports = _shouldPruneTurnPorts ? true : false;
nativeConfig->presume_writable_when_fully_relayed =
_shouldPresumeWritableWhenFullyRelayed ? true : false;
+ if (_iceCheckMinInterval != nil) {
+ nativeConfig->ice_check_min_interval =
+ rtc::Optional<int>(_iceCheckMinInterval.intValue);
+ }
return nativeConfig.release();
}
diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
index b729080..c516240 100644
--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
+++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCConfiguration.h
@@ -104,6 +104,11 @@
*/
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
+/** If set to non-nil, controls the minimal interval between consecutive ICE
+ * check packets.
+ */
+@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
+
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end