blob: 97cc5a49465bfa8a151feb8bce4bc08475500e9a [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
Steve Anton8cb344a2018-02-27 15:34:53 -080066/** Represents the chosen SDP semantics for the RTCPeerConnection. */
67typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
68 RTCSdpSemanticsDefault,
69 RTCSdpSemanticsPlanB,
70 RTCSdpSemanticsUnifiedPlan,
71};
72
hjon6d49a8e2016-01-26 13:06:42 -080073NS_ASSUME_NONNULL_BEGIN
74
tkchin8b577ed2016-04-19 10:04:41 -070075RTC_EXPORT
hjon6d49a8e2016-01-26 13:06:42 -080076@interface RTCConfiguration : NSObject
77
78/** An array of Ice Servers available to be used by ICE. */
Jon Hjelle32e0c012016-03-08 16:04:46 -080079@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
hjon6d49a8e2016-01-26 13:06:42 -080080
81/** Which candidates the ICE agent is allowed to use. The W3C calls it
82 * |iceTransportPolicy|, while in C++ it is called |type|. */
83@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
84
85/** The media-bundling policy to use when gathering ICE candidates. */
86@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;
87
88/** The rtcp-mux policy to use when gathering ICE candidates. */
89@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
90@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
Honghai Zhang46007ae2016-06-03 16:31:32 -070091@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
Honghai Zhang3108fc92016-05-11 10:10:39 -070092@property(nonatomic, assign)
93 RTCContinualGatheringPolicy continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070094
95/** By default, the PeerConnection will use a limited number of IPv6 network
96 * interfaces, in order to avoid too many ICE candidate pairs being created
97 * and delaying ICE completion.
98 *
99 * Can be set to INT_MAX to effectively disable the limit.
100 */
101@property(nonatomic, assign) int maxIPv6Networks;
102
Daniel Lazarenko2870b0a2018-01-25 10:30:22 +0100103/** Exclude link-local network interfaces
104 * from considertaion for gathering ICE candidates.
105 * Defaults to NO.
106 */
107@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
108
hjon6d49a8e2016-01-26 13:06:42 -0800109@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800110@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -0800111@property(nonatomic, assign) int iceConnectionReceivingTimeout;
112@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
113
tkchinab8f82f2016-01-27 17:50:11 -0800114/** Key type used to generate SSL identity. Default is ECDSA. */
115@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800116
deadbeefbe0c96f2016-05-18 16:20:14 -0700117/** ICE candidate pool size as defined in JSEP. Default is 0. */
118@property(nonatomic, assign) int iceCandidatePoolSize;
119
honghaizaf6b6e02016-07-11 15:09:26 -0700120/** Prune turn ports on the same network to the same turn server.
121 * Default is NO.
122 */
123@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700124
honghaizaf6b6e02016-07-11 15:09:26 -0700125/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700126 * candidate pairs will succeed, even before a binding response is received.
127 */
honghaizaf6b6e02016-07-11 15:09:26 -0700128@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700129
skvlada5d94ff2017-02-02 13:02:30 -0800130/** If set to non-nil, controls the minimal interval between consecutive ICE
131 * check packets.
132 */
133@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
134
Steve Antond295e402017-07-14 16:06:41 -0700135/** ICE Periodic Regathering
136 * If set, WebRTC will periodically create and propose candidates without
137 * starting a new ICE generation. The regathering happens continuously with
138 * interval specified in milliseconds by the uniform distribution [a, b].
139 */
140@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
141
Steve Anton8cb344a2018-02-27 15:34:53 -0800142/** Configure the SDP semantics used by this PeerConnection. Note that the
143 * WebRTC 1.0 specification requires UnifiedPlan semantics. The
144 * RTCRtpTransceiver API is only available with UnifiedPlan semantics.
145 *
146 * PlanB will cause RTCPeerConnection to create offers and answers with at
147 * most one audio and one video m= section with multiple RTCRtpSenders and
148 * RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
149 * will also cause RTCPeerConnection to ignore all but the first m= section of
150 * the same media type.
151 *
152 * UnifiedPlan will cause RTCPeerConnection to create offers and answers with
153 * multiple m= sections where each m= section maps to one RTCRtpSender and one
154 * RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
155 * will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
156 * that form a Plan B stream.
157 *
158 * For users who only send at most one audio and one video track, this
159 * choice does not matter and should be left as Default.
160 *
161 * For users who wish to send multiple audio/video streams and need to stay
162 * interoperable with legacy WebRTC implementations, specify PlanB.
163 *
164 * For users who wish to send multiple audio/video streams and/or wish to
165 * use the new RTCRtpTransceiver API, specify UnifiedPlan.
166 */
167@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
168
jtteh4eeb5372017-04-03 15:06:37 -0700169- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800170
171@end
172
173NS_ASSUME_NONNULL_END