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}
This commit is contained in:
@ -37,6 +37,7 @@
|
|||||||
@synthesize shouldPruneTurnPorts = _shouldPruneTurnPorts;
|
@synthesize shouldPruneTurnPorts = _shouldPruneTurnPorts;
|
||||||
@synthesize shouldPresumeWritableWhenFullyRelayed =
|
@synthesize shouldPresumeWritableWhenFullyRelayed =
|
||||||
_shouldPresumeWritableWhenFullyRelayed;
|
_shouldPresumeWritableWhenFullyRelayed;
|
||||||
|
@synthesize iceCheckMinInterval = _iceCheckMinInterval;
|
||||||
|
|
||||||
- (instancetype)init {
|
- (instancetype)init {
|
||||||
if (self = [super init]) {
|
if (self = [super init]) {
|
||||||
@ -68,13 +69,17 @@
|
|||||||
_shouldPruneTurnPorts = config.prune_turn_ports;
|
_shouldPruneTurnPorts = config.prune_turn_ports;
|
||||||
_shouldPresumeWritableWhenFullyRelayed =
|
_shouldPresumeWritableWhenFullyRelayed =
|
||||||
config.presume_writable_when_fully_relayed;
|
config.presume_writable_when_fully_relayed;
|
||||||
|
if (config.ice_check_min_interval) {
|
||||||
|
_iceCheckMinInterval =
|
||||||
|
[NSNumber numberWithInt:*config.ice_check_min_interval];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *)description {
|
- (NSString *)description {
|
||||||
return [NSString stringWithFormat:
|
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,
|
_iceServers,
|
||||||
[[self class] stringForTransportPolicy:_iceTransportPolicy],
|
[[self class] stringForTransportPolicy:_iceTransportPolicy],
|
||||||
[[self class] stringForBundlePolicy:_bundlePolicy],
|
[[self class] stringForBundlePolicy:_bundlePolicy],
|
||||||
@ -89,7 +94,8 @@
|
|||||||
_iceBackupCandidatePairPingInterval,
|
_iceBackupCandidatePairPingInterval,
|
||||||
_iceCandidatePoolSize,
|
_iceCandidatePoolSize,
|
||||||
_shouldPruneTurnPorts,
|
_shouldPruneTurnPorts,
|
||||||
_shouldPresumeWritableWhenFullyRelayed];
|
_shouldPresumeWritableWhenFullyRelayed,
|
||||||
|
_iceCheckMinInterval];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - Private
|
#pragma mark - Private
|
||||||
@ -139,6 +145,10 @@
|
|||||||
nativeConfig->prune_turn_ports = _shouldPruneTurnPorts ? true : false;
|
nativeConfig->prune_turn_ports = _shouldPruneTurnPorts ? true : false;
|
||||||
nativeConfig->presume_writable_when_fully_relayed =
|
nativeConfig->presume_writable_when_fully_relayed =
|
||||||
_shouldPresumeWritableWhenFullyRelayed ? true : false;
|
_shouldPresumeWritableWhenFullyRelayed ? true : false;
|
||||||
|
if (_iceCheckMinInterval != nil) {
|
||||||
|
nativeConfig->ice_check_min_interval =
|
||||||
|
rtc::Optional<int>(_iceCheckMinInterval.intValue);
|
||||||
|
}
|
||||||
|
|
||||||
return nativeConfig.release();
|
return nativeConfig.release();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -104,6 +104,11 @@ RTC_EXPORT
|
|||||||
*/
|
*/
|
||||||
@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
|
@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;
|
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user