blob: d274530ae24137f8f26059272b0ea19060baf662 [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. */
Yves Gerey665174f2018-06-19 15:03:05 +020037typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { RTCRtcpMuxPolicyNegotiate, RTCRtcpMuxPolicyRequire };
hjon6d49a8e2016-01-26 13:06:42 -080038
39/** Represents the tcp candidate policy. */
40typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
41 RTCTcpCandidatePolicyEnabled,
42 RTCTcpCandidatePolicyDisabled
43};
44
Honghai Zhang46007ae2016-06-03 16:31:32 -070045/** Represents the candidate network policy. */
46typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
47 RTCCandidateNetworkPolicyAll,
48 RTCCandidateNetworkPolicyLowCost
49};
50
Honghai Zhang3108fc92016-05-11 10:10:39 -070051/** Represents the continual gathering policy. */
52typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
53 RTCContinualGatheringPolicyGatherOnce,
54 RTCContinualGatheringPolicyGatherContinually
55};
56
tkchinab8f82f2016-01-27 17:50:11 -080057/** Represents the encryption key type. */
58typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
59 RTCEncryptionKeyTypeRSA,
60 RTCEncryptionKeyTypeECDSA,
61};
62
Steve Anton8cb344a2018-02-27 15:34:53 -080063/** Represents the chosen SDP semantics for the RTCPeerConnection. */
64typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
Steve Anton8cb344a2018-02-27 15:34:53 -080065 RTCSdpSemanticsPlanB,
66 RTCSdpSemanticsUnifiedPlan,
67};
68
hjon6d49a8e2016-01-26 13:06:42 -080069NS_ASSUME_NONNULL_BEGIN
70
tkchin8b577ed2016-04-19 10:04:41 -070071RTC_EXPORT
hjon6d49a8e2016-01-26 13:06:42 -080072@interface RTCConfiguration : NSObject
73
74/** An array of Ice Servers available to be used by ICE. */
Jon Hjelle32e0c012016-03-08 16:04:46 -080075@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
hjon6d49a8e2016-01-26 13:06:42 -080076
77/** Which candidates the ICE agent is allowed to use. The W3C calls it
78 * |iceTransportPolicy|, while in C++ it is called |type|. */
79@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
80
81/** The media-bundling policy to use when gathering ICE candidates. */
82@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;
83
84/** The rtcp-mux policy to use when gathering ICE candidates. */
85@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
86@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
Honghai Zhang46007ae2016-06-03 16:31:32 -070087@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
Yves Gerey665174f2018-06-19 15:03:05 +020088@property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070089
90/** By default, the PeerConnection will use a limited number of IPv6 network
91 * interfaces, in order to avoid too many ICE candidate pairs being created
92 * and delaying ICE completion.
93 *
94 * Can be set to INT_MAX to effectively disable the limit.
95 */
96@property(nonatomic, assign) int maxIPv6Networks;
97
Daniel Lazarenko2870b0a2018-01-25 10:30:22 +010098/** Exclude link-local network interfaces
99 * from considertaion for gathering ICE candidates.
100 * Defaults to NO.
101 */
102@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
103
hjon6d49a8e2016-01-26 13:06:42 -0800104@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800105@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -0800106@property(nonatomic, assign) int iceConnectionReceivingTimeout;
107@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
108
tkchinab8f82f2016-01-27 17:50:11 -0800109/** Key type used to generate SSL identity. Default is ECDSA. */
110@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800111
deadbeefbe0c96f2016-05-18 16:20:14 -0700112/** ICE candidate pool size as defined in JSEP. Default is 0. */
113@property(nonatomic, assign) int iceCandidatePoolSize;
114
honghaizaf6b6e02016-07-11 15:09:26 -0700115/** Prune turn ports on the same network to the same turn server.
116 * Default is NO.
117 */
118@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700119
honghaizaf6b6e02016-07-11 15:09:26 -0700120/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700121 * candidate pairs will succeed, even before a binding response is received.
122 */
honghaizaf6b6e02016-07-11 15:09:26 -0700123@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700124
skvlada5d94ff2017-02-02 13:02:30 -0800125/** If set to non-nil, controls the minimal interval between consecutive ICE
126 * check packets.
127 */
128@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
129
Steve Antond295e402017-07-14 16:06:41 -0700130/** ICE Periodic Regathering
131 * If set, WebRTC will periodically create and propose candidates without
132 * starting a new ICE generation. The regathering happens continuously with
133 * interval specified in milliseconds by the uniform distribution [a, b].
134 */
135@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
136
Steve Anton8cb344a2018-02-27 15:34:53 -0800137/** Configure the SDP semantics used by this PeerConnection. Note that the
138 * WebRTC 1.0 specification requires UnifiedPlan semantics. The
139 * RTCRtpTransceiver API is only available with UnifiedPlan semantics.
140 *
141 * PlanB will cause RTCPeerConnection to create offers and answers with at
142 * most one audio and one video m= section with multiple RTCRtpSenders and
143 * RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
144 * will also cause RTCPeerConnection to ignore all but the first m= section of
145 * the same media type.
146 *
147 * UnifiedPlan will cause RTCPeerConnection to create offers and answers with
148 * multiple m= sections where each m= section maps to one RTCRtpSender and one
149 * RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
150 * will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
151 * that form a Plan B stream.
152 *
Steve Anton8cb344a2018-02-27 15:34:53 -0800153 * For users who wish to send multiple audio/video streams and need to stay
Steve Anton3acffc32018-04-12 17:21:03 -0700154 * interoperable with legacy WebRTC implementations or use legacy APIs,
155 * specify PlanB.
Steve Anton8cb344a2018-02-27 15:34:53 -0800156 *
Steve Anton3acffc32018-04-12 17:21:03 -0700157 * For all other users, specify UnifiedPlan.
Steve Anton8cb344a2018-02-27 15:34:53 -0800158 */
159@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
160
Zhi Huangb57e1692018-06-12 11:41:11 -0700161/** Actively reset the SRTP parameters when the DTLS transports underneath are
162 * changed after offer/answer negotiation. This is only intended to be a
163 * workaround for crbug.com/835958
164 */
165@property(nonatomic, assign) BOOL activeResetSrtpParams;
166
jtteh4eeb5372017-04-03 15:06:37 -0700167- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800168
169@end
170
171NS_ASSUME_NONNULL_END