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 | |
| 11 | #import <Foundation/Foundation.h> |
| 12 | |
tkchin | 9eeb624 | 2016-04-27 01:54:20 -0700 | [diff] [blame] | 13 | #import <WebRTC/RTCMacros.h> |
tkchin | 8b577ed | 2016-04-19 10:04:41 -0700 | [diff] [blame] | 14 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 15 | @class RTCIceServer; |
Steve Anton | d295e40 | 2017-07-14 16:06:41 -0700 | [diff] [blame] | 16 | @class RTCIntervalRange; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 17 | |
| 18 | /** |
| 19 | * Represents the ice transport policy. This exposes the same states in C++, |
| 20 | * which include one more state than what exists in the W3C spec. |
| 21 | */ |
| 22 | typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) { |
| 23 | RTCIceTransportPolicyNone, |
| 24 | RTCIceTransportPolicyRelay, |
| 25 | RTCIceTransportPolicyNoHost, |
| 26 | RTCIceTransportPolicyAll |
| 27 | }; |
| 28 | |
| 29 | /** Represents the bundle policy. */ |
| 30 | typedef NS_ENUM(NSInteger, RTCBundlePolicy) { |
| 31 | RTCBundlePolicyBalanced, |
| 32 | RTCBundlePolicyMaxCompat, |
| 33 | RTCBundlePolicyMaxBundle |
| 34 | }; |
| 35 | |
| 36 | /** Represents the rtcp mux policy. */ |
| 37 | typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { |
| 38 | RTCRtcpMuxPolicyNegotiate, |
| 39 | RTCRtcpMuxPolicyRequire |
| 40 | }; |
| 41 | |
| 42 | /** Represents the tcp candidate policy. */ |
| 43 | typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) { |
| 44 | RTCTcpCandidatePolicyEnabled, |
| 45 | RTCTcpCandidatePolicyDisabled |
| 46 | }; |
| 47 | |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 48 | /** Represents the candidate network policy. */ |
| 49 | typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) { |
| 50 | RTCCandidateNetworkPolicyAll, |
| 51 | RTCCandidateNetworkPolicyLowCost |
| 52 | }; |
| 53 | |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 54 | /** Represents the continual gathering policy. */ |
| 55 | typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) { |
| 56 | RTCContinualGatheringPolicyGatherOnce, |
| 57 | RTCContinualGatheringPolicyGatherContinually |
| 58 | }; |
| 59 | |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 60 | /** Represents the encryption key type. */ |
| 61 | typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) { |
| 62 | RTCEncryptionKeyTypeRSA, |
| 63 | RTCEncryptionKeyTypeECDSA, |
| 64 | }; |
| 65 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 66 | NS_ASSUME_NONNULL_BEGIN |
| 67 | |
tkchin | 8b577ed | 2016-04-19 10:04:41 -0700 | [diff] [blame] | 68 | RTC_EXPORT |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 69 | @interface RTCConfiguration : NSObject |
| 70 | |
| 71 | /** An array of Ice Servers available to be used by ICE. */ |
Jon Hjelle | 32e0c01 | 2016-03-08 16:04:46 -0800 | [diff] [blame] | 72 | @property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 73 | |
| 74 | /** Which candidates the ICE agent is allowed to use. The W3C calls it |
| 75 | * |iceTransportPolicy|, while in C++ it is called |type|. */ |
| 76 | @property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy; |
| 77 | |
| 78 | /** The media-bundling policy to use when gathering ICE candidates. */ |
| 79 | @property(nonatomic, assign) RTCBundlePolicy bundlePolicy; |
| 80 | |
| 81 | /** The rtcp-mux policy to use when gathering ICE candidates. */ |
| 82 | @property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy; |
| 83 | @property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy; |
Honghai Zhang | 46007ae | 2016-06-03 16:31:32 -0700 | [diff] [blame] | 84 | @property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy; |
Honghai Zhang | 3108fc9 | 2016-05-11 10:10:39 -0700 | [diff] [blame] | 85 | @property(nonatomic, assign) |
| 86 | RTCContinualGatheringPolicy continualGatheringPolicy; |
deadbeef | 2059bb3 | 2017-07-26 18:25:43 -0700 | [diff] [blame] | 87 | |
| 88 | /** By default, the PeerConnection will use a limited number of IPv6 network |
| 89 | * interfaces, in order to avoid too many ICE candidate pairs being created |
| 90 | * and delaying ICE completion. |
| 91 | * |
| 92 | * Can be set to INT_MAX to effectively disable the limit. |
| 93 | */ |
| 94 | @property(nonatomic, assign) int maxIPv6Networks; |
| 95 | |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 96 | @property(nonatomic, assign) int audioJitterBufferMaxPackets; |
haysc | c9f9500 | 2016-12-05 14:24:32 -0800 | [diff] [blame] | 97 | @property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 98 | @property(nonatomic, assign) int iceConnectionReceivingTimeout; |
| 99 | @property(nonatomic, assign) int iceBackupCandidatePairPingInterval; |
| 100 | |
tkchin | ab8f82f | 2016-01-27 17:50:11 -0800 | [diff] [blame] | 101 | /** Key type used to generate SSL identity. Default is ECDSA. */ |
| 102 | @property(nonatomic, assign) RTCEncryptionKeyType keyType; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 103 | |
deadbeef | be0c96f | 2016-05-18 16:20:14 -0700 | [diff] [blame] | 104 | /** ICE candidate pool size as defined in JSEP. Default is 0. */ |
| 105 | @property(nonatomic, assign) int iceCandidatePoolSize; |
| 106 | |
honghaiz | af6b6e0 | 2016-07-11 15:09:26 -0700 | [diff] [blame] | 107 | /** Prune turn ports on the same network to the same turn server. |
| 108 | * Default is NO. |
| 109 | */ |
| 110 | @property(nonatomic, assign) BOOL shouldPruneTurnPorts; |
Honghai Zhang | e2e35ca | 2016-07-01 14:22:17 -0700 | [diff] [blame] | 111 | |
honghaiz | af6b6e0 | 2016-07-11 15:09:26 -0700 | [diff] [blame] | 112 | /** If set to YES, this means the ICE transport should presume TURN-to-TURN |
Taylor Brandstetter | e985111 | 2016-07-01 11:11:13 -0700 | [diff] [blame] | 113 | * candidate pairs will succeed, even before a binding response is received. |
| 114 | */ |
honghaiz | af6b6e0 | 2016-07-11 15:09:26 -0700 | [diff] [blame] | 115 | @property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed; |
Taylor Brandstetter | e985111 | 2016-07-01 11:11:13 -0700 | [diff] [blame] | 116 | |
skvlad | a5d94ff | 2017-02-02 13:02:30 -0800 | [diff] [blame] | 117 | /** If set to non-nil, controls the minimal interval between consecutive ICE |
| 118 | * check packets. |
| 119 | */ |
| 120 | @property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval; |
| 121 | |
Steve Anton | d295e40 | 2017-07-14 16:06:41 -0700 | [diff] [blame] | 122 | /** ICE Periodic Regathering |
| 123 | * If set, WebRTC will periodically create and propose candidates without |
| 124 | * starting a new ICE generation. The regathering happens continuously with |
| 125 | * interval specified in milliseconds by the uniform distribution [a, b]. |
| 126 | */ |
| 127 | @property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange; |
| 128 | |
jtteh | 4eeb537 | 2017-04-03 15:06:37 -0700 | [diff] [blame] | 129 | - (instancetype)init; |
hjon | 6d49a8e | 2016-01-26 13:06:42 -0800 | [diff] [blame] | 130 | |
| 131 | @end |
| 132 | |
| 133 | NS_ASSUME_NONNULL_END |