blob: fcb62b94168ea5b67df4f2e3860d1ec12bdd0287 [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
11#import <Foundation/Foundation.h>
12
tkchin9eeb6242016-04-27 01:54:20 -070013#import <WebRTC/RTCMacros.h>
tkchin8b577ed2016-04-19 10:04:41 -070014
hjon6d49a8e2016-01-26 13:06:42 -080015@class RTCIceServer;
Steve Antond295e402017-07-14 16:06:41 -070016@class RTCIntervalRange;
hjon6d49a8e2016-01-26 13:06:42 -080017
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 */
22typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) {
23 RTCIceTransportPolicyNone,
24 RTCIceTransportPolicyRelay,
25 RTCIceTransportPolicyNoHost,
26 RTCIceTransportPolicyAll
27};
28
29/** Represents the bundle policy. */
30typedef NS_ENUM(NSInteger, RTCBundlePolicy) {
31 RTCBundlePolicyBalanced,
32 RTCBundlePolicyMaxCompat,
33 RTCBundlePolicyMaxBundle
34};
35
36/** Represents the rtcp mux policy. */
37typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) {
38 RTCRtcpMuxPolicyNegotiate,
39 RTCRtcpMuxPolicyRequire
40};
41
42/** Represents the tcp candidate policy. */
43typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
44 RTCTcpCandidatePolicyEnabled,
45 RTCTcpCandidatePolicyDisabled
46};
47
Honghai Zhang46007ae2016-06-03 16:31:32 -070048/** Represents the candidate network policy. */
49typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
50 RTCCandidateNetworkPolicyAll,
51 RTCCandidateNetworkPolicyLowCost
52};
53
Honghai Zhang3108fc92016-05-11 10:10:39 -070054/** Represents the continual gathering policy. */
55typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
56 RTCContinualGatheringPolicyGatherOnce,
57 RTCContinualGatheringPolicyGatherContinually
58};
59
tkchinab8f82f2016-01-27 17:50:11 -080060/** Represents the encryption key type. */
61typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
62 RTCEncryptionKeyTypeRSA,
63 RTCEncryptionKeyTypeECDSA,
64};
65
hjon6d49a8e2016-01-26 13:06:42 -080066NS_ASSUME_NONNULL_BEGIN
67
tkchin8b577ed2016-04-19 10:04:41 -070068RTC_EXPORT
hjon6d49a8e2016-01-26 13:06:42 -080069@interface RTCConfiguration : NSObject
70
71/** An array of Ice Servers available to be used by ICE. */
Jon Hjelle32e0c012016-03-08 16:04:46 -080072@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
hjon6d49a8e2016-01-26 13:06:42 -080073
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 Zhang46007ae2016-06-03 16:31:32 -070084@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
Honghai Zhang3108fc92016-05-11 10:10:39 -070085@property(nonatomic, assign)
86 RTCContinualGatheringPolicy continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070087
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
hjon6d49a8e2016-01-26 13:06:42 -080096@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -080097@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -080098@property(nonatomic, assign) int iceConnectionReceivingTimeout;
99@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
100
tkchinab8f82f2016-01-27 17:50:11 -0800101/** Key type used to generate SSL identity. Default is ECDSA. */
102@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800103
deadbeefbe0c96f2016-05-18 16:20:14 -0700104/** ICE candidate pool size as defined in JSEP. Default is 0. */
105@property(nonatomic, assign) int iceCandidatePoolSize;
106
honghaizaf6b6e02016-07-11 15:09:26 -0700107/** Prune turn ports on the same network to the same turn server.
108 * Default is NO.
109 */
110@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700111
honghaizaf6b6e02016-07-11 15:09:26 -0700112/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700113 * candidate pairs will succeed, even before a binding response is received.
114 */
honghaizaf6b6e02016-07-11 15:09:26 -0700115@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700116
skvlada5d94ff2017-02-02 13:02:30 -0800117/** 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 Antond295e402017-07-14 16:06:41 -0700122/** 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
jtteh4eeb5372017-04-03 15:06:37 -0700129- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800130
131@end
132
133NS_ASSUME_NONNULL_END