Reinstate "iOS - Add iceRegatherIntervalRange."

This reverts commit 93adc3209b5ff10adaba54d5eab6b53bc2780685.

Reverted originally because it depended on a CL which was reverted.
That CL has been reinstated in:

https: //chromium-review.googlesource.com/#/c/572070/
Bug: webrtc:7969
Change-Id: I608bbeaaba02e84908433c8260cf236df0307a97
Reviewed-on: https://chromium-review.googlesource.com/572405
Reviewed-by: Zeke Chin <tkchin@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#19035}
This commit is contained in:
Steve Anton
2017-07-14 16:06:41 -07:00
parent 038834f40c
commit d295e407da
9 changed files with 198 additions and 2 deletions

View File

@ -13,6 +13,7 @@
#include <memory>
#import "RTCIceServer+Private.h"
#import "RTCIntervalRange+Private.h"
#import "WebRTC/RTCLogging.h"
#include "webrtc/rtc_base/rtccertificategenerator.h"
@ -38,6 +39,7 @@
@synthesize shouldPresumeWritableWhenFullyRelayed =
_shouldPresumeWritableWhenFullyRelayed;
@synthesize iceCheckMinInterval = _iceCheckMinInterval;
@synthesize iceRegatherIntervalRange = _iceRegatherIntervalRange;
- (instancetype)init {
// Copy defaults.
@ -83,13 +85,18 @@
_iceCheckMinInterval =
[NSNumber numberWithInt:*config.ice_check_min_interval];
}
if (config.ice_regather_interval_range) {
const rtc::IntervalRange &nativeIntervalRange = config.ice_regather_interval_range.value();
_iceRegatherIntervalRange =
[[RTCIntervalRange alloc] initWithNativeIntervalRange:nativeIntervalRange];
}
}
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}\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}\n",
_iceServers,
[[self class] stringForTransportPolicy:_iceTransportPolicy],
[[self class] stringForBundlePolicy:_bundlePolicy],
@ -105,7 +112,8 @@
_iceCandidatePoolSize,
_shouldPruneTurnPorts,
_shouldPresumeWritableWhenFullyRelayed,
_iceCheckMinInterval];
_iceCheckMinInterval,
_iceRegatherIntervalRange];
}
#pragma mark - Private
@ -159,6 +167,12 @@
nativeConfig->ice_check_min_interval =
rtc::Optional<int>(_iceCheckMinInterval.intValue);
}
if (_iceRegatherIntervalRange != nil) {
std::unique_ptr<rtc::IntervalRange> nativeIntervalRange(
_iceRegatherIntervalRange.nativeIntervalRange);
nativeConfig->ice_regather_interval_range =
rtc::Optional<rtc::IntervalRange>(*nativeIntervalRange);
}
return nativeConfig.release();
}