Add config continualGatheringPolicy to the IOS RTCConfiguration.
BUG= R=tkchin@webrtc.org Review URL: https://codereview.webrtc.org/1971563002 . Cr-Commit-Position: refs/heads/master@{#12689}
This commit is contained in:
@ -24,6 +24,7 @@
|
||||
@synthesize bundlePolicy = _bundlePolicy;
|
||||
@synthesize rtcpMuxPolicy = _rtcpMuxPolicy;
|
||||
@synthesize tcpCandidatePolicy = _tcpCandidatePolicy;
|
||||
@synthesize continualGatheringPolicy = _continualGatheringPolicy;
|
||||
@synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets;
|
||||
@synthesize iceConnectionReceivingTimeout = _iceConnectionReceivingTimeout;
|
||||
@synthesize iceBackupCandidatePairPingInterval =
|
||||
@ -43,6 +44,10 @@
|
||||
[[self class] rtcpMuxPolicyForNativePolicy:config.rtcp_mux_policy];
|
||||
_tcpCandidatePolicy = [[self class] tcpCandidatePolicyForNativePolicy:
|
||||
config.tcp_candidate_policy];
|
||||
webrtc::PeerConnectionInterface::ContinualGatheringPolicy nativePolicy =
|
||||
config.continual_gathering_policy;
|
||||
_continualGatheringPolicy =
|
||||
[[self class] continualGatheringPolicyForNativePolicy:nativePolicy];
|
||||
_audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets;
|
||||
_iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout;
|
||||
_iceBackupCandidatePairPingInterval =
|
||||
@ -54,12 +59,14 @@
|
||||
|
||||
- (NSString *)description {
|
||||
return [NSString stringWithFormat:
|
||||
@"RTCConfiguration: {\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n}\n",
|
||||
@"RTCConfiguration: {\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n}\n",
|
||||
_iceServers,
|
||||
[[self class] stringForTransportPolicy:_iceTransportPolicy],
|
||||
[[self class] stringForBundlePolicy:_bundlePolicy],
|
||||
[[self class] stringForRtcpMuxPolicy:_rtcpMuxPolicy],
|
||||
[[self class] stringForTcpCandidatePolicy:_tcpCandidatePolicy],
|
||||
[[self class]
|
||||
stringForContinualGatheringPolicy:_continualGatheringPolicy],
|
||||
_audioJitterBufferMaxPackets,
|
||||
_iceConnectionReceivingTimeout,
|
||||
_iceBackupCandidatePairPingInterval];
|
||||
@ -81,6 +88,8 @@
|
||||
[[self class] nativeRtcpMuxPolicyForPolicy:_rtcpMuxPolicy];
|
||||
nativeConfig.tcp_candidate_policy =
|
||||
[[self class] nativeTcpCandidatePolicyForPolicy:_tcpCandidatePolicy];
|
||||
nativeConfig.continual_gathering_policy = [[self class]
|
||||
nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy];
|
||||
nativeConfig.audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets;
|
||||
nativeConfig.ice_connection_receiving_timeout =
|
||||
_iceConnectionReceivingTimeout;
|
||||
@ -234,4 +243,35 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ (webrtc::PeerConnectionInterface::ContinualGatheringPolicy)
|
||||
nativeContinualGatheringPolicyForPolicy:
|
||||
(RTCContinualGatheringPolicy)policy {
|
||||
switch (policy) {
|
||||
case RTCContinualGatheringPolicyGatherOnce:
|
||||
return webrtc::PeerConnectionInterface::GATHER_ONCE;
|
||||
case RTCContinualGatheringPolicyGatherContinually:
|
||||
return webrtc::PeerConnectionInterface::GATHER_CONTINUALLY;
|
||||
}
|
||||
}
|
||||
|
||||
+ (RTCContinualGatheringPolicy)continualGatheringPolicyForNativePolicy:
|
||||
(webrtc::PeerConnectionInterface::ContinualGatheringPolicy)nativePolicy {
|
||||
switch (nativePolicy) {
|
||||
case webrtc::PeerConnectionInterface::GATHER_ONCE:
|
||||
return RTCContinualGatheringPolicyGatherOnce;
|
||||
case webrtc::PeerConnectionInterface::GATHER_CONTINUALLY:
|
||||
return RTCContinualGatheringPolicyGatherContinually;
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString *)stringForContinualGatheringPolicy:
|
||||
(RTCContinualGatheringPolicy)policy {
|
||||
switch (policy) {
|
||||
case RTCContinualGatheringPolicyGatherOnce:
|
||||
return @"GATHER_ONCE";
|
||||
case RTCContinualGatheringPolicyGatherContinually:
|
||||
return @"GATHER_CONTINUALLY";
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -44,6 +44,12 @@ typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
|
||||
RTCTcpCandidatePolicyDisabled
|
||||
};
|
||||
|
||||
/** Represents the continual gathering policy. */
|
||||
typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
|
||||
RTCContinualGatheringPolicyGatherOnce,
|
||||
RTCContinualGatheringPolicyGatherContinually
|
||||
};
|
||||
|
||||
/** Represents the encryption key type. */
|
||||
typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
|
||||
RTCEncryptionKeyTypeRSA,
|
||||
@ -68,6 +74,8 @@ RTC_EXPORT
|
||||
/** The rtcp-mux policy to use when gathering ICE candidates. */
|
||||
@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
|
||||
@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
|
||||
@property(nonatomic, assign)
|
||||
RTCContinualGatheringPolicy continualGatheringPolicy;
|
||||
@property(nonatomic, assign) int audioJitterBufferMaxPackets;
|
||||
@property(nonatomic, assign) int iceConnectionReceivingTimeout;
|
||||
@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
|
||||
|
||||
@ -41,6 +41,8 @@
|
||||
config.audioJitterBufferMaxPackets = maxPackets;
|
||||
config.iceConnectionReceivingTimeout = timeout;
|
||||
config.iceBackupCandidatePairPingInterval = interval;
|
||||
config.continualGatheringPolicy =
|
||||
RTCContinualGatheringPolicyGatherContinually;
|
||||
|
||||
webrtc::PeerConnectionInterface::RTCConfiguration nativeConfig =
|
||||
config.nativeConfiguration;
|
||||
@ -60,6 +62,8 @@
|
||||
EXPECT_EQ(maxPackets, nativeConfig.audio_jitter_buffer_max_packets);
|
||||
EXPECT_EQ(timeout, nativeConfig.ice_connection_receiving_timeout);
|
||||
EXPECT_EQ(interval, nativeConfig.ice_backup_candidate_pair_ping_interval);
|
||||
EXPECT_EQ(webrtc::PeerConnectionInterface::GATHER_CONTINUALLY,
|
||||
nativeConfig.continual_gathering_policy);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user