blob: f3a8d3fc99a993c87cbcab0259bd2855d5177988 [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
Daniel Lazarenko2870b0a2018-01-25 10:30:22 +010096/** Exclude link-local network interfaces
97 * from considertaion for gathering ICE candidates.
98 * Defaults to NO.
99 */
100@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
101
hjon6d49a8e2016-01-26 13:06:42 -0800102@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800103@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -0800104@property(nonatomic, assign) int iceConnectionReceivingTimeout;
105@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
106
tkchinab8f82f2016-01-27 17:50:11 -0800107/** Key type used to generate SSL identity. Default is ECDSA. */
108@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800109
deadbeefbe0c96f2016-05-18 16:20:14 -0700110/** ICE candidate pool size as defined in JSEP. Default is 0. */
111@property(nonatomic, assign) int iceCandidatePoolSize;
112
honghaizaf6b6e02016-07-11 15:09:26 -0700113/** Prune turn ports on the same network to the same turn server.
114 * Default is NO.
115 */
116@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700117
honghaizaf6b6e02016-07-11 15:09:26 -0700118/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700119 * candidate pairs will succeed, even before a binding response is received.
120 */
honghaizaf6b6e02016-07-11 15:09:26 -0700121@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700122
skvlada5d94ff2017-02-02 13:02:30 -0800123/** If set to non-nil, controls the minimal interval between consecutive ICE
124 * check packets.
125 */
126@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
127
Steve Antond295e402017-07-14 16:06:41 -0700128/** ICE Periodic Regathering
129 * If set, WebRTC will periodically create and propose candidates without
130 * starting a new ICE generation. The regathering happens continuously with
131 * interval specified in milliseconds by the uniform distribution [a, b].
132 */
133@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
134
jtteh4eeb5372017-04-03 15:06:37 -0700135- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800136
137@end
138
139NS_ASSUME_NONNULL_END