hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 11 | #import "RTCConfiguration+Private.h" |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 12 | |
jbauch | 555604a | 2016-04-26 03:13:22 -0700 | [diff] [blame] | 13 | #include <memory> |
| 14 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 15 | #import "RTCIceServer+Private.h" |
| 16 | #import "WebRTC/RTCLogging.h" |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 17 | |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 18 | #include "webrtc/base/rtccertificategenerator.h" |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 19 | #include "webrtc/base/sslidentity.h" |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 20 | |
| 21 | @implementation RTCConfiguration |
| 22 | |
| 23 | @synthesize iceServers = _iceServers; |
| 24 | @synthesize iceTransportPolicy = _iceTransportPolicy; |
| 25 | @synthesize bundlePolicy = _bundlePolicy; |
| 26 | @synthesize rtcpMuxPolicy = _rtcpMuxPolicy; |
| 27 | @synthesize tcpCandidatePolicy = _tcpCandidatePolicy; |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 28 | @synthesize candidateNetworkPolicy = _candidateNetworkPolicy; |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 29 | @synthesize continualGatheringPolicy = _continualGatheringPolicy; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 30 | @synthesize audioJitterBufferMaxPackets = _audioJitterBufferMaxPackets; |
| 31 | @synthesize iceConnectionReceivingTimeout = _iceConnectionReceivingTimeout; |
| 32 | @synthesize iceBackupCandidatePairPingInterval = |
| 33 | _iceBackupCandidatePairPingInterval; |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 34 | @synthesize keyType = _keyType; |
deadbeef | be0c96f | 2016-05-18 16:20:14 -0700 | [diff] [blame] | 35 | @synthesize iceCandidatePoolSize = _iceCandidatePoolSize; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 36 | |
| 37 | - (instancetype)init { |
| 38 | if (self = [super init]) { |
| 39 | _iceServers = [NSMutableArray array]; |
| 40 | // Copy defaults. |
| 41 | webrtc::PeerConnectionInterface::RTCConfiguration config; |
| 42 | _iceTransportPolicy = |
| 43 | [[self class] transportPolicyForTransportsType:config.type]; |
| 44 | _bundlePolicy = |
| 45 | [[self class] bundlePolicyForNativePolicy:config.bundle_policy]; |
| 46 | _rtcpMuxPolicy = |
| 47 | [[self class] rtcpMuxPolicyForNativePolicy:config.rtcp_mux_policy]; |
| 48 | _tcpCandidatePolicy = [[self class] tcpCandidatePolicyForNativePolicy: |
| 49 | config.tcp_candidate_policy]; |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 50 | _candidateNetworkPolicy = [[self class] |
| 51 | candidateNetworkPolicyForNativePolicy:config.candidate_network_policy]; |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 52 | webrtc::PeerConnectionInterface::ContinualGatheringPolicy nativePolicy = |
| 53 | config.continual_gathering_policy; |
| 54 | _continualGatheringPolicy = |
| 55 | [[self class] continualGatheringPolicyForNativePolicy:nativePolicy]; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 56 | _audioJitterBufferMaxPackets = config.audio_jitter_buffer_max_packets; |
| 57 | _iceConnectionReceivingTimeout = config.ice_connection_receiving_timeout; |
| 58 | _iceBackupCandidatePairPingInterval = |
| 59 | config.ice_backup_candidate_pair_ping_interval; |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 60 | _keyType = RTCEncryptionKeyTypeECDSA; |
deadbeef | be0c96f | 2016-05-18 16:20:14 -0700 | [diff] [blame] | 61 | _iceCandidatePoolSize = config.ice_candidate_pool_size; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 62 | } |
| 63 | return self; |
| 64 | } |
| 65 | |
| 66 | - (NSString *)description { |
| 67 | return [NSString stringWithFormat: |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 68 | @"RTCConfiguration: {\n%@\n%@\n%@\n%@\n%@\n%@\n%@\n%d\n%d\n%d\n%d\n}\n", |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 69 | _iceServers, |
| 70 | [[self class] stringForTransportPolicy:_iceTransportPolicy], |
| 71 | [[self class] stringForBundlePolicy:_bundlePolicy], |
| 72 | [[self class] stringForRtcpMuxPolicy:_rtcpMuxPolicy], |
| 73 | [[self class] stringForTcpCandidatePolicy:_tcpCandidatePolicy], |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 74 | [[self class] stringForCandidateNetworkPolicy:_candidateNetworkPolicy], |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 75 | [[self class] |
| 76 | stringForContinualGatheringPolicy:_continualGatheringPolicy], |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 77 | _audioJitterBufferMaxPackets, |
| 78 | _iceConnectionReceivingTimeout, |
deadbeef | be0c96f | 2016-05-18 16:20:14 -0700 | [diff] [blame] | 79 | _iceBackupCandidatePairPingInterval, |
| 80 | _iceCandidatePoolSize]; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | #pragma mark - Private |
| 84 | |
hbos | a73ca56 | 2016-05-17 03:28:58 -0700 | [diff] [blame] | 85 | - (webrtc::PeerConnectionInterface::RTCConfiguration *) |
| 86 | createNativeConfiguration { |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 87 | std::unique_ptr<webrtc::PeerConnectionInterface::RTCConfiguration> |
| 88 | nativeConfig(new webrtc::PeerConnectionInterface::RTCConfiguration()); |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 89 | |
| 90 | for (RTCIceServer *iceServer in _iceServers) { |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 91 | nativeConfig->servers.push_back(iceServer.nativeServer); |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 92 | } |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 93 | nativeConfig->type = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 94 | [[self class] nativeTransportsTypeForTransportPolicy:_iceTransportPolicy]; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 95 | nativeConfig->bundle_policy = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 96 | [[self class] nativeBundlePolicyForPolicy:_bundlePolicy]; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 97 | nativeConfig->rtcp_mux_policy = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 98 | [[self class] nativeRtcpMuxPolicyForPolicy:_rtcpMuxPolicy]; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 99 | nativeConfig->tcp_candidate_policy = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 100 | [[self class] nativeTcpCandidatePolicyForPolicy:_tcpCandidatePolicy]; |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 101 | nativeConfig->candidate_network_policy = [[self class] |
| 102 | nativeCandidateNetworkPolicyForPolicy:_candidateNetworkPolicy]; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 103 | nativeConfig->continual_gathering_policy = [[self class] |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 104 | nativeContinualGatheringPolicyForPolicy:_continualGatheringPolicy]; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 105 | nativeConfig->audio_jitter_buffer_max_packets = _audioJitterBufferMaxPackets; |
| 106 | nativeConfig->ice_connection_receiving_timeout = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 107 | _iceConnectionReceivingTimeout; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 108 | nativeConfig->ice_backup_candidate_pair_ping_interval = |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 109 | _iceBackupCandidatePairPingInterval; |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 110 | rtc::KeyType keyType = |
| 111 | [[self class] nativeEncryptionKeyTypeForKeyType:_keyType]; |
| 112 | // Generate non-default certificate. |
| 113 | if (keyType != rtc::KT_DEFAULT) { |
| 114 | rtc::scoped_refptr<rtc::RTCCertificate> certificate = |
| 115 | rtc::RTCCertificateGenerator::GenerateCertificate( |
| 116 | rtc::KeyParams(keyType), rtc::Optional<uint64_t>()); |
| 117 | if (!certificate) { |
hbos | a73ca56 | 2016-05-17 03:28:58 -0700 | [diff] [blame] | 118 | RTCLogError(@"Failed to generate certificate."); |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 119 | return nullptr; |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 120 | } |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 121 | nativeConfig->certificates.push_back(certificate); |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 122 | } |
deadbeef | be0c96f | 2016-05-18 16:20:14 -0700 | [diff] [blame] | 123 | nativeConfig->ice_candidate_pool_size = _iceCandidatePoolSize; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 124 | |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 125 | return nativeConfig.release(); |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 126 | } |
| 127 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 128 | + (webrtc::PeerConnectionInterface::IceTransportsType) |
| 129 | nativeTransportsTypeForTransportPolicy:(RTCIceTransportPolicy)policy { |
| 130 | switch (policy) { |
| 131 | case RTCIceTransportPolicyNone: |
| 132 | return webrtc::PeerConnectionInterface::kNone; |
| 133 | case RTCIceTransportPolicyRelay: |
| 134 | return webrtc::PeerConnectionInterface::kRelay; |
| 135 | case RTCIceTransportPolicyNoHost: |
| 136 | return webrtc::PeerConnectionInterface::kNoHost; |
| 137 | case RTCIceTransportPolicyAll: |
| 138 | return webrtc::PeerConnectionInterface::kAll; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | + (RTCIceTransportPolicy)transportPolicyForTransportsType: |
| 143 | (webrtc::PeerConnectionInterface::IceTransportsType)nativeType { |
| 144 | switch (nativeType) { |
| 145 | case webrtc::PeerConnectionInterface::kNone: |
| 146 | return RTCIceTransportPolicyNone; |
| 147 | case webrtc::PeerConnectionInterface::kRelay: |
| 148 | return RTCIceTransportPolicyRelay; |
| 149 | case webrtc::PeerConnectionInterface::kNoHost: |
| 150 | return RTCIceTransportPolicyNoHost; |
| 151 | case webrtc::PeerConnectionInterface::kAll: |
| 152 | return RTCIceTransportPolicyAll; |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | + (NSString *)stringForTransportPolicy:(RTCIceTransportPolicy)policy { |
| 157 | switch (policy) { |
| 158 | case RTCIceTransportPolicyNone: |
| 159 | return @"NONE"; |
| 160 | case RTCIceTransportPolicyRelay: |
| 161 | return @"RELAY"; |
| 162 | case RTCIceTransportPolicyNoHost: |
| 163 | return @"NO_HOST"; |
| 164 | case RTCIceTransportPolicyAll: |
| 165 | return @"ALL"; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | + (webrtc::PeerConnectionInterface::BundlePolicy)nativeBundlePolicyForPolicy: |
| 170 | (RTCBundlePolicy)policy { |
| 171 | switch (policy) { |
| 172 | case RTCBundlePolicyBalanced: |
| 173 | return webrtc::PeerConnectionInterface::kBundlePolicyBalanced; |
| 174 | case RTCBundlePolicyMaxCompat: |
| 175 | return webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat; |
| 176 | case RTCBundlePolicyMaxBundle: |
| 177 | return webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | + (RTCBundlePolicy)bundlePolicyForNativePolicy: |
| 182 | (webrtc::PeerConnectionInterface::BundlePolicy)nativePolicy { |
| 183 | switch (nativePolicy) { |
| 184 | case webrtc::PeerConnectionInterface::kBundlePolicyBalanced: |
| 185 | return RTCBundlePolicyBalanced; |
| 186 | case webrtc::PeerConnectionInterface::kBundlePolicyMaxCompat: |
| 187 | return RTCBundlePolicyMaxCompat; |
| 188 | case webrtc::PeerConnectionInterface::kBundlePolicyMaxBundle: |
| 189 | return RTCBundlePolicyMaxBundle; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | + (NSString *)stringForBundlePolicy:(RTCBundlePolicy)policy { |
| 194 | switch (policy) { |
| 195 | case RTCBundlePolicyBalanced: |
| 196 | return @"BALANCED"; |
| 197 | case RTCBundlePolicyMaxCompat: |
| 198 | return @"MAX_COMPAT"; |
| 199 | case RTCBundlePolicyMaxBundle: |
| 200 | return @"MAX_BUNDLE"; |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | + (webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativeRtcpMuxPolicyForPolicy: |
| 205 | (RTCRtcpMuxPolicy)policy { |
| 206 | switch (policy) { |
| 207 | case RTCRtcpMuxPolicyNegotiate: |
| 208 | return webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate; |
| 209 | case RTCRtcpMuxPolicyRequire: |
| 210 | return webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | + (RTCRtcpMuxPolicy)rtcpMuxPolicyForNativePolicy: |
| 215 | (webrtc::PeerConnectionInterface::RtcpMuxPolicy)nativePolicy { |
| 216 | switch (nativePolicy) { |
| 217 | case webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate: |
| 218 | return RTCRtcpMuxPolicyNegotiate; |
| 219 | case webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire: |
| 220 | return RTCRtcpMuxPolicyRequire; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | + (NSString *)stringForRtcpMuxPolicy:(RTCRtcpMuxPolicy)policy { |
| 225 | switch (policy) { |
| 226 | case RTCRtcpMuxPolicyNegotiate: |
| 227 | return @"NEGOTIATE"; |
| 228 | case RTCRtcpMuxPolicyRequire: |
| 229 | return @"REQUIRE"; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | + (webrtc::PeerConnectionInterface::TcpCandidatePolicy) |
| 234 | nativeTcpCandidatePolicyForPolicy:(RTCTcpCandidatePolicy)policy { |
| 235 | switch (policy) { |
| 236 | case RTCTcpCandidatePolicyEnabled: |
| 237 | return webrtc::PeerConnectionInterface::kTcpCandidatePolicyEnabled; |
| 238 | case RTCTcpCandidatePolicyDisabled: |
| 239 | return webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled; |
| 240 | } |
| 241 | } |
| 242 | |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 243 | + (webrtc::PeerConnectionInterface::CandidateNetworkPolicy) |
| 244 | nativeCandidateNetworkPolicyForPolicy:(RTCCandidateNetworkPolicy)policy { |
| 245 | switch (policy) { |
| 246 | case RTCCandidateNetworkPolicyAll: |
| 247 | return webrtc::PeerConnectionInterface::kCandidateNetworkPolicyAll; |
| 248 | case RTCCandidateNetworkPolicyLowCost: |
| 249 | return webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost; |
| 250 | } |
| 251 | } |
| 252 | |
Henrik Boström | e06c2dd | 2016-05-13 13:50:38 +0200 | [diff] [blame] | 253 | + (rtc::KeyType)nativeEncryptionKeyTypeForKeyType: |
| 254 | (RTCEncryptionKeyType)keyType { |
| 255 | switch (keyType) { |
| 256 | case RTCEncryptionKeyTypeRSA: |
| 257 | return rtc::KT_RSA; |
| 258 | case RTCEncryptionKeyTypeECDSA: |
| 259 | return rtc::KT_ECDSA; |
| 260 | } |
| 261 | } |
| 262 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 263 | + (RTCTcpCandidatePolicy)tcpCandidatePolicyForNativePolicy: |
| 264 | (webrtc::PeerConnectionInterface::TcpCandidatePolicy)nativePolicy { |
| 265 | switch (nativePolicy) { |
| 266 | case webrtc::PeerConnectionInterface::kTcpCandidatePolicyEnabled: |
| 267 | return RTCTcpCandidatePolicyEnabled; |
| 268 | case webrtc::PeerConnectionInterface::kTcpCandidatePolicyDisabled: |
| 269 | return RTCTcpCandidatePolicyDisabled; |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | + (NSString *)stringForTcpCandidatePolicy:(RTCTcpCandidatePolicy)policy { |
| 274 | switch (policy) { |
| 275 | case RTCTcpCandidatePolicyEnabled: |
| 276 | return @"TCP_ENABLED"; |
| 277 | case RTCTcpCandidatePolicyDisabled: |
| 278 | return @"TCP_DISABLED"; |
| 279 | } |
| 280 | } |
| 281 | |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 282 | + (RTCCandidateNetworkPolicy)candidateNetworkPolicyForNativePolicy: |
| 283 | (webrtc::PeerConnectionInterface::CandidateNetworkPolicy)nativePolicy { |
| 284 | switch (nativePolicy) { |
| 285 | case webrtc::PeerConnectionInterface::kCandidateNetworkPolicyAll: |
| 286 | return RTCCandidateNetworkPolicyAll; |
| 287 | case webrtc::PeerConnectionInterface::kCandidateNetworkPolicyLowCost: |
| 288 | return RTCCandidateNetworkPolicyLowCost; |
| 289 | } |
| 290 | } |
| 291 | |
| 292 | + (NSString *)stringForCandidateNetworkPolicy: |
| 293 | (RTCCandidateNetworkPolicy)policy { |
| 294 | switch (policy) { |
| 295 | case RTCCandidateNetworkPolicyAll: |
| 296 | return @"CANDIDATE_ALL_NETWORKS"; |
| 297 | case RTCCandidateNetworkPolicyLowCost: |
| 298 | return @"CANDIDATE_LOW_COST_NETWORKS"; |
| 299 | } |
| 300 | } |
| 301 | |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 302 | + (webrtc::PeerConnectionInterface::ContinualGatheringPolicy) |
| 303 | nativeContinualGatheringPolicyForPolicy: |
| 304 | (RTCContinualGatheringPolicy)policy { |
| 305 | switch (policy) { |
| 306 | case RTCContinualGatheringPolicyGatherOnce: |
| 307 | return webrtc::PeerConnectionInterface::GATHER_ONCE; |
| 308 | case RTCContinualGatheringPolicyGatherContinually: |
| 309 | return webrtc::PeerConnectionInterface::GATHER_CONTINUALLY; |
| 310 | } |
| 311 | } |
| 312 | |
| 313 | + (RTCContinualGatheringPolicy)continualGatheringPolicyForNativePolicy: |
| 314 | (webrtc::PeerConnectionInterface::ContinualGatheringPolicy)nativePolicy { |
| 315 | switch (nativePolicy) { |
| 316 | case webrtc::PeerConnectionInterface::GATHER_ONCE: |
| 317 | return RTCContinualGatheringPolicyGatherOnce; |
| 318 | case webrtc::PeerConnectionInterface::GATHER_CONTINUALLY: |
| 319 | return RTCContinualGatheringPolicyGatherContinually; |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | + (NSString *)stringForContinualGatheringPolicy: |
| 324 | (RTCContinualGatheringPolicy)policy { |
| 325 | switch (policy) { |
| 326 | case RTCContinualGatheringPolicyGatherOnce: |
| 327 | return @"GATHER_ONCE"; |
| 328 | case RTCContinualGatheringPolicyGatherContinually: |
| 329 | return @"GATHER_CONTINUALLY"; |
| 330 | } |
| 331 | } |
| 332 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 333 | @end |