blob: 17aed858aac0217f154c6ef5fa9887218ec7e17b [file] [log] [blame]
hjon6d49a8e2016-01-26 13:06:42 -08001/*
2 * Copyright 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
tkchin9eeb6242016-04-27 01:54:20 -070011#import "RTCConfiguration+Private.h"
hjon6d49a8e2016-01-26 13:06:42 -080012
jbauch555604a2016-04-26 03:13:22 -070013#include <memory>
14
tkchin9eeb6242016-04-27 01:54:20 -070015#import "RTCIceServer+Private.h"
Steve Antond295e402017-07-14 16:06:41 -070016#import "RTCIntervalRange+Private.h"
tkchin9eeb6242016-04-27 01:54:20 -070017#import "WebRTC/RTCLogging.h"
tkchinab8f82f2016-01-27 17:50:11 -080018
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020019#include "rtc_base/rtccertificategenerator.h"
20#include "rtc_base/sslidentity.h"
hjon6d49a8e2016-01-26 13:06:42 -080021
22@implementation RTCConfiguration
23
24@synthesize iceServers = _iceServers;
25@synthesize iceTransportPolicy = _iceTransportPolicy;
26@synthesize bundlePolicy = _bundlePolicy;
27@synthesize rtcpMuxPolicy = _rtcpMuxPolicy;
28@synthesize tcpCandidatePolicy = _tcpCandidatePolicy;
Honghai Zhang46007ae2016-06-03 16:31:32 -070029@synthesize candidateNetworkPolicy = _candidateNetworkPolicy;
Honghai Zhang3108fc92016-05-11 10:10:39 -070030@synthesize continualGatheringPolicy = _continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070031@synthesize maxIPv6Networks = _maxIPv6Networks;
hjon6d49a8e2016-01-26 13:06:42 -080032@synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -080033@synthesize audioJitterBufferFastAccelerate = _audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -080034@synthesize iceConnectionReceivingTimeout = _iceConnectionReceivingTimeout;
35@synthesize iceBackupCandidatePairPingInterval =
36 _iceBackupCandidatePairPingInterval;
tkchinab8f82f2016-01-27 17:50:11 -080037@synthesize keyType = _keyType;
deadbeefbe0c96f2016-05-18 16:20:14 -070038@synthesize iceCandidatePoolSize = _iceCandidatePoolSize;
honghaizaf6b6e02016-07-11 15:09:26 -070039@synthesize shouldPruneTurnPorts = _shouldPruneTurnPorts;
40@synthesize shouldPresumeWritableWhenFullyRelayed =
41 _shouldPresumeWritableWhenFullyRelayed;
skvlada5d94ff2017-02-02 13:02:30 -080042@synthesize iceCheckMinInterval = _iceCheckMinInterval;
Steve Antond295e402017-07-14 16:06:41 -070043@synthesize iceRegatherIntervalRange = _iceRegatherIntervalRange;
hjon6d49a8e2016-01-26 13:06:42 -080044
45- (instancetype)init {
jtteh4eeb5372017-04-03 15:06:37 -070046 // Copy defaults.
47 webrtc::PeerConnectionInterface::RTCConfiguration config(
48 webrtc::PeerConnectionInterface::RTCConfigurationType::kAggressive);
jtteh465faf02017-04-04 14:00:16 -070049 return [self initWithNativeConfiguration:config];
jtteh4eeb5372017-04-03 15:06:37 -070050}
51
52- (instancetype)initWithNativeConfiguration:
jtteh465faf02017-04-04 14:00:16 -070053 (const webrtc::PeerConnectionInterface::RTCConfiguration &)config {
hjon6d49a8e2016-01-26 13:06:42 -080054 if (self = [super init]) {
jtteh4eeb5372017-04-03 15:06:37 -070055 NSMutableArray *iceServers = [NSMutableArray array];
jtteh465faf02017-04-04 14:00:16 -070056 for (const webrtc::PeerConnectionInterface::IceServer& server : config.servers) {
jtteh4eeb5372017-04-03 15:06:37 -070057 RTCIceServer *iceServer = [[RTCIceServer alloc] initWithNativeServer:server];
58 [iceServers addObject:iceServer];
59 }
60 _iceServers = iceServers;
hjon6d49a8e2016-01-26 13:06:42 -080061 _iceTransportPolicy =
jtteh465faf02017-04-04 14:00:16 -070062 [[self class] transportPolicyForTransportsType:config.type];
hjon6d49a8e2016-01-26 13:06:42 -080063 _bundlePolicy =
jtteh465faf02017-04-04 14:00:16 -070064 [[self class] bundlePolicyForNativePolicy:config.bundle_policy];
hjon6d49a8e2016-01-26 13:06:42 -080065 _rtcpMuxPolicy =
jtteh465faf02017-04-04 14:00:16 -070066 [[self class] rtcpMuxPolicyForNativePolicy:config.rtcp_mux_policy];
hjon6d49a8e2016-01-26 13:06:42 -080067 _tcpCandidatePolicy = [[self class] tcpCandidatePolicyForNativePolicy:
jtteh465faf02017-04-04 14:00:16 -070068 config.tcp_candidate_policy];
Honghai Zhang46007ae2016-06-03 16:31:32 -070069 _candidateNetworkPolicy = [[self class]
jtteh465faf02017-04-04 14:00:16 -070070 candidateNetworkPolicyForNativePolicy:config.candidate_network_policy];
Honghai Zhang3108fc92016-05-11 10:10:39 -070071 webrtc::PeerConnectionInterface::ContinualGatheringPolicy nativePolicy =
jtteh465faf02017-04-04 14:00:16 -070072 config.continual_gathering_policy;
Honghai Zhang3108fc92016-05-11 10:10:39 -070073 _continualGatheringPolicy =
74 [[self class] continualGatheringPolicyForNativePolicy:nativePolicy];
deadbeef2059bb32017-07-26 18:25:43 -070075 _maxIPv6Networks = config.max_ipv6_networks;
jtteh465faf02017-04-04 14:00:16 -070076 _audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets;
77 _audioJitterBufferFastAccelerate = config.audio_jitter_buffer_fast_accelerate;
78 _iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout;
hjon6d49a8e2016-01-26 13:06:42 -080079 _iceBackupCandidatePairPingInterval =
jtteh465faf02017-04-04 14:00:16 -070080 config.ice_backup_candidate_pair_ping_interval;
tkchinab8f82f2016-01-27 17:50:11 -080081 _keyType = RTCEncryptionKeyTypeECDSA;
jtteh465faf02017-04-04 14:00:16 -070082 _iceCandidatePoolSize = config.ice_candidate_pool_size;
83 _shouldPruneTurnPorts = config.prune_turn_ports;
honghaizaf6b6e02016-07-11 15:09:26 -070084 _shouldPresumeWritableWhenFullyRelayed =
jtteh465faf02017-04-04 14:00:16 -070085 config.presume_writable_when_fully_relayed;
86 if (config.ice_check_min_interval) {
skvlada5d94ff2017-02-02 13:02:30 -080087 _iceCheckMinInterval =
jtteh465faf02017-04-04 14:00:16 -070088 [NSNumber numberWithInt:*config.ice_check_min_interval];
skvlada5d94ff2017-02-02 13:02:30 -080089 }
Steve Antond295e402017-07-14 16:06:41 -070090 if (config.ice_regather_interval_range) {
91 const rtc::IntervalRange &nativeIntervalRange = config.ice_regather_interval_range.value();
92 _iceRegatherIntervalRange =
93 [[RTCIntervalRange alloc] initWithNativeIntervalRange:nativeIntervalRange];
94 }
hjon6d49a8e2016-01-26 13:06:42 -080095 }
96 return self;
97}
98
99- (NSString *)description {
deadbeef2059bb32017-07-26 18:25:43 -0700100 return
101 [NSString stringWithFormat:
102 @"RTCConfiguration: "
103 @"{\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n%d\n%d\n%d\n%@\n%@\n%d\n}\n",
104 _iceServers,
105 [[self class] stringForTransportPolicy:_iceTransportPolicy],
106 [[self class] stringForBundlePolicy:_bundlePolicy],
107 [[self class] stringForRtcpMuxPolicy:_rtcpMuxPolicy],
108 [[self class] stringForTcpCandidatePolicy:_tcpCandidatePolicy],
109 [[self class] stringForCandidateNetworkPolicy:_candidateNetworkPolicy],
110 [[self class] stringForContinualGatheringPolicy:_continualGatheringPolicy],
111 _audioJitterBufferMaxPackets,
112 _audioJitterBufferFastAccelerate,
113 _iceConnectionReceivingTimeout,
114 _iceBackupCandidatePairPingInterval,
115 _iceCandidatePoolSize,
116 _shouldPruneTurnPorts,
117 _shouldPresumeWritableWhenFullyRelayed,
118 _iceCheckMinInterval,
119 _iceRegatherIntervalRange,
120 _maxIPv6Networks];
hjon6d49a8e2016-01-26 13:06:42 -0800121}
122
123#pragma mark - Private
124
hbosa73ca562016-05-17 03:28:58 -0700125- (webrtc::PeerConnectionInterface::RTCConfiguration *)
126 createNativeConfiguration {
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200127 std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration>
Honghai Zhangf7ddc062016-09-01 15:34:01 -0700128 nativeConfig(new webrtc::PeerConnectionInterface::RTCConfiguration(
129 webrtc::PeerConnectionInterface::RTCConfigurationType::kAggressive));
hjon6d49a8e2016-01-26 13:06:42 -0800130
131 for (RTCIceServer *iceServer in _iceServers) {
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200132 nativeConfig->servers.push_back(iceServer.nativeServer);
hjon6d49a8e2016-01-26 13:06:42 -0800133 }
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200134 nativeConfig->type =
hjon6d49a8e2016-01-26 13:06:42 -0800135 [[self class] nativeTransportsTypeForTransportPolicy:_iceTransportPolicy];
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200136 nativeConfig->bundle_policy =
hjon6d49a8e2016-01-26 13:06:42 -0800137 [[self class] nativeBundlePolicyForPolicy:_bundlePolicy];
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200138 nativeConfig->rtcp_mux_policy =
hjon6d49a8e2016-01-26 13:06:42 -0800139 [[self class] nativeRtcpMuxPolicyForPolicy:_rtcpMuxPolicy];
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200140 nativeConfig->tcp_candidate_policy =
hjon6d49a8e2016-01-26 13:06:42 -0800141 [[self class] nativeTcpCandidatePolicyForPolicy:_tcpCandidatePolicy];
Honghai Zhang46007ae2016-06-03 16:31:32 -0700142 nativeConfig->candidate_network_policy = [[self class]
143 nativeCandidateNetworkPolicyForPolicy:_candidateNetworkPolicy];
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200144 nativeConfig->continual_gathering_policy = [[self class]
Honghai Zhang3108fc92016-05-11 10:10:39 -0700145 nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy];
deadbeef2059bb32017-07-26 18:25:43 -0700146 nativeConfig->max_ipv6_networks = _maxIPv6Networks;
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200147 nativeConfig->audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800148 nativeConfig->audio_jitter_buffer_fast_accelerate =
149 _audioJitterBufferFastAccelerate ? true : false;
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200150 nativeConfig->ice_connection_receiving_timeout =
hjon6d49a8e2016-01-26 13:06:42 -0800151 _iceConnectionReceivingTimeout;
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200152 nativeConfig->ice_backup_candidate_pair_ping_interval =
hjon6d49a8e2016-01-26 13:06:42 -0800153 _iceBackupCandidatePairPingInterval;
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200154 rtc::KeyType keyType =
155 [[self class] nativeEncryptionKeyTypeForKeyType:_keyType];
156 // Generate non-default certificate.
157 if (keyType != rtc::KT_DEFAULT) {
158 rtc::scoped_refptr<rtc::RTCCertificate> certificate =
159 rtc::RTCCertificateGenerator::GenerateCertificate(
160 rtc::KeyParams(keyType), rtc::Optional<uint64_t>());
161 if (!certificate) {
hbosa73ca562016-05-17 03:28:58 -0700162 RTCLogError(@"Failed to generate certificate.");
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200163 return nullptr;
tkchinab8f82f2016-01-27 17:50:11 -0800164 }
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200165 nativeConfig->certificates.push_back(certificate);
tkchinab8f82f2016-01-27 17:50:11 -0800166 }
deadbeefbe0c96f2016-05-18 16:20:14 -0700167 nativeConfig->ice_candidate_pool_size = _iceCandidatePoolSize;
honghaizaf6b6e02016-07-11 15:09:26 -0700168 nativeConfig->prune_turn_ports = _shouldPruneTurnPorts ? true : false;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700169 nativeConfig->presume_writable_when_fully_relayed =
honghaizaf6b6e02016-07-11 15:09:26 -0700170 _shouldPresumeWritableWhenFullyRelayed ? true : false;
skvlada5d94ff2017-02-02 13:02:30 -0800171 if (_iceCheckMinInterval != nil) {
172 nativeConfig->ice_check_min_interval =
173 rtc::Optional<int>(_iceCheckMinInterval.intValue);
174 }
Steve Antond295e402017-07-14 16:06:41 -0700175 if (_iceRegatherIntervalRange != nil) {
176 std::unique_ptr<rtc::IntervalRange> nativeIntervalRange(
177 _iceRegatherIntervalRange.nativeIntervalRange);
178 nativeConfig->ice_regather_interval_range =
179 rtc::Optional<rtc::IntervalRange>(*nativeIntervalRange);
180 }
Henrik Boströme06c2dd2016-05-13 13:50:38 +0200181 return nativeConfig.release();
hjon6d49a8e2016-01-26 13:06:42 -0800182}
183
hjon6d49a8e2016-01-26 13:06:42 -0800184+ (webrtc::PeerConnectionInterface::IceTransportsType)
185 nativeTransportsTypeForTransportPolicy:(RTCIceTransportPolicy)policy {
186 switch (policy) {
187 case RTCIceTransportPolicyNone:
188 return webrtc::PeerConnectionInterface::kNone;
189 case RTCIceTransportPolicyRelay:
190 return webrtc::PeerConnectionInterface::kRelay;
191 case RTCIceTransportPolicyNoHost:
192 return webrtc::PeerConnectionInterface::kNoHost;
193 case RTCIceTransportPolicyAll:
194 return webrtc::PeerConnectionInterface::kAll;
195 }
196}
197
198+ (RTCIceTransportPolicy)transportPolicyForTransportsType:
199 (webrtc::PeerConnectionInterface::IceTransportsType)nativeType {
200 switch (nativeType) {
201 case webrtc::PeerConnectionInterface::kNone:
202 return RTCIceTransportPolicyNone;
203 case webrtc::PeerConnectionInterface::kRelay:
204 return RTCIceTransportPolicyRelay;
205 case webrtc::PeerConnectionInterface::kNoHost:
206 return RTCIceTransportPolicyNoHost;
207 case webrtc::PeerConnectionInterface::kAll:
208 return RTCIceTransportPolicyAll;
209 }
210}
211
212+ (NSString *)stringForTransportPolicy:(RTCIceTransportPolicy)policy {
213 switch (policy) {
214 case RTCIceTransportPolicyNone:
215 return @"NONE";
216 case RTCIceTransportPolicyRelay:
217 return @"RELAY";
218 case RTCIceTransportPolicyNoHost:
219 return @"NO_HOST";
220 case RTCIceTransportPolicyAll:
221 return @"ALL";
222 }
223}
224
225+ (webrtc::PeerConnectionInterface::BundlePolicy)nativeBundlePolicyForPolicy:
226 (RTCBundlePolicy)policy {
227 switch (policy) {
228 case RTCBundlePolicyBalanced:
229 return webrtc::PeerConnectionInterface::kBundlePolicyBalanced;
230 case RTCBundlePolicyMaxCompat:
231 return webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat;
232 case RTCBundlePolicyMaxBundle:
233 return webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle;
234 }
235}
236
237+ (RTCBundlePolicy)bundlePolicyForNativePolicy:
238 (webrtc::PeerConnectionInterface::BundlePolicy)nativePolicy {
239 switch (nativePolicy) {
240 case webrtc::PeerConnectionInterface::kBundlePolicyBalanced:
241 return RTCBundlePolicyBalanced;
242 case webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat:
243 return RTCBundlePolicyMaxCompat;
244 case webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle:
245 return RTCBundlePolicyMaxBundle;
246 }
247}
248
249+ (NSString *)stringForBundlePolicy:(RTCBundlePolicy)policy {
250 switch (policy) {
251 case RTCBundlePolicyBalanced:
252 return @"BALANCED";
253 case RTCBundlePolicyMaxCompat:
254 return @"MAX_COMPAT";
255 case RTCBundlePolicyMaxBundle:
256 return @"MAX_BUNDLE";
257 }
258}
259
260+ (webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativeRtcpMuxPolicyForPolicy:
261 (RTCRtcpMuxPolicy)policy {
262 switch (policy) {
263 case RTCRtcpMuxPolicyNegotiate:
264 return webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate;
265 case RTCRtcpMuxPolicyRequire:
266 return webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire;
267 }
268}
269
270+ (RTCRtcpMuxPolicy)rtcpMuxPolicyForNativePolicy:
271 (webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativePolicy {
272 switch (nativePolicy) {
273 case webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate:
274 return RTCRtcpMuxPolicyNegotiate;
275 case webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire:
276 return RTCRtcpMuxPolicyRequire;
277 }
278}
279
280+ (NSString *)stringForRtcpMuxPolicy:(RTCRtcpMuxPolicy)policy {
281 switch (policy) {
282 case RTCRtcpMuxPolicyNegotiate:
283 return @"NEGOTIATE";
284 case RTCRtcpMuxPolicyRequire:
285 return @"REQUIRE";
286 }
287}
288
289+ (webrtc::PeerConnectionInterface::TcpCandidatePolicy)
290 nativeTcpCandidatePolicyForPolicy:(RTCTcpCandidatePolicy)policy {
291 switch (policy) {
292 case RTCTcpCandidatePolicyEnabled:
293 return webrtc::PeerConnectionInterface::kTcpCandidatePolicyEnabled;
294 case RTCTcpCandidatePolicyDisabled:
295 return webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled;
296 }
297}
298
Honghai Zhang46007ae2016-06-03 16:31:32 -0700299+ (webrtc::PeerConnectionInterface::CandidateNetworkPolicy)
300 nativeCandidateNetworkPolicyForPolicy:(RTCCandidateNetworkPolicy)policy {
301 switch (policy) {
302 case RTCCandidateNetworkPolicyAll:
303 return webrtc::PeerConnectionInterface::kCandidateNetworkPolicyAll;
304 case RTCCandidateNetworkPolicyLowCost:
305 return webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost;
306 }
307}
308
hjon6d49a8e2016-01-26 13:06:42 -0800309+ (RTCTcpCandidatePolicy)tcpCandidatePolicyForNativePolicy:
310 (webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativePolicy {
311 switch (nativePolicy) {
312 case webrtc::PeerConnectionInterface::kTcpCandidatePolicyEnabled:
313 return RTCTcpCandidatePolicyEnabled;
314 case webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled:
315 return RTCTcpCandidatePolicyDisabled;
316 }
317}
318
319+ (NSString *)stringForTcpCandidatePolicy:(RTCTcpCandidatePolicy)policy {
320 switch (policy) {
321 case RTCTcpCandidatePolicyEnabled:
322 return @"TCP_ENABLED";
323 case RTCTcpCandidatePolicyDisabled:
324 return @"TCP_DISABLED";
325 }
326}
327
Honghai Zhang46007ae2016-06-03 16:31:32 -0700328+ (RTCCandidateNetworkPolicy)candidateNetworkPolicyForNativePolicy:
329 (webrtc::PeerConnectionInterface::CandidateNetworkPolicy)nativePolicy {
330 switch (nativePolicy) {
331 case webrtc::PeerConnectionInterface::kCandidateNetworkPolicyAll:
332 return RTCCandidateNetworkPolicyAll;
333 case webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost:
334 return RTCCandidateNetworkPolicyLowCost;
335 }
336}
337
338+ (NSString *)stringForCandidateNetworkPolicy:
339 (RTCCandidateNetworkPolicy)policy {
340 switch (policy) {
341 case RTCCandidateNetworkPolicyAll:
342 return @"CANDIDATE_ALL_NETWORKS";
343 case RTCCandidateNetworkPolicyLowCost:
344 return @"CANDIDATE_LOW_COST_NETWORKS";
345 }
346}
347
Honghai Zhang3108fc92016-05-11 10:10:39 -0700348+ (webrtc::PeerConnectionInterface::ContinualGatheringPolicy)
349 nativeContinualGatheringPolicyForPolicy:
350 (RTCContinualGatheringPolicy)policy {
351 switch (policy) {
352 case RTCContinualGatheringPolicyGatherOnce:
353 return webrtc::PeerConnectionInterface::GATHER_ONCE;
354 case RTCContinualGatheringPolicyGatherContinually:
355 return webrtc::PeerConnectionInterface::GATHER_CONTINUALLY;
356 }
357}
358
359+ (RTCContinualGatheringPolicy)continualGatheringPolicyForNativePolicy:
360 (webrtc::PeerConnectionInterface::ContinualGatheringPolicy)nativePolicy {
361 switch (nativePolicy) {
362 case webrtc::PeerConnectionInterface::GATHER_ONCE:
363 return RTCContinualGatheringPolicyGatherOnce;
364 case webrtc::PeerConnectionInterface::GATHER_CONTINUALLY:
365 return RTCContinualGatheringPolicyGatherContinually;
366 }
367}
368
369+ (NSString *)stringForContinualGatheringPolicy:
370 (RTCContinualGatheringPolicy)policy {
371 switch (policy) {
372 case RTCContinualGatheringPolicyGatherOnce:
373 return @"GATHER_ONCE";
374 case RTCContinualGatheringPolicyGatherContinually:
375 return @"GATHER_CONTINUALLY";
376 }
377}
378
hbosf9da44d2016-06-09 03:18:28 -0700379+ (rtc::KeyType)nativeEncryptionKeyTypeForKeyType:
380 (RTCEncryptionKeyType)keyType {
381 switch (keyType) {
382 case RTCEncryptionKeyTypeRSA:
383 return rtc::KT_RSA;
384 case RTCEncryptionKeyTypeECDSA:
385 return rtc::KT_ECDSA;
386 }
387}
388
hjon6d49a8e2016-01-26 13:06:42 -0800389@end