blob: dd8f364cbd221e25bad4d9fc85705b3edc18303d [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) {
Steve Anton8cb344a2018-02-27 15:34:53 -080068 RTCSdpSemanticsPlanB,
69 RTCSdpSemanticsUnifiedPlan,
70};
71
hjon6d49a8e2016-01-26 13:06:42 -080072NS_ASSUME_NONNULL_BEGIN
73
tkchin8b577ed2016-04-19 10:04:41 -070074RTC_EXPORT
hjon6d49a8e2016-01-26 13:06:42 -080075@interface RTCConfiguration : NSObject
76
77/** An array of Ice Servers available to be used by ICE. */
Jon Hjelle32e0c012016-03-08 16:04:46 -080078@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
hjon6d49a8e2016-01-26 13:06:42 -080079
80/** Which candidates the ICE agent is allowed to use. The W3C calls it
81 * |iceTransportPolicy|, while in C++ it is called |type|. */
82@property(nonatomic, assign) RTCIceTransportPolicy iceTransportPolicy;
83
84/** The media-bundling policy to use when gathering ICE candidates. */
85@property(nonatomic, assign) RTCBundlePolicy bundlePolicy;
86
87/** The rtcp-mux policy to use when gathering ICE candidates. */
88@property(nonatomic, assign) RTCRtcpMuxPolicy rtcpMuxPolicy;
89@property(nonatomic, assign) RTCTcpCandidatePolicy tcpCandidatePolicy;
Honghai Zhang46007ae2016-06-03 16:31:32 -070090@property(nonatomic, assign) RTCCandidateNetworkPolicy candidateNetworkPolicy;
Honghai Zhang3108fc92016-05-11 10:10:39 -070091@property(nonatomic, assign)
92 RTCContinualGatheringPolicy continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070093
94/** By default, the PeerConnection will use a limited number of IPv6 network
95 * interfaces, in order to avoid too many ICE candidate pairs being created
96 * and delaying ICE completion.
97 *
98 * Can be set to INT_MAX to effectively disable the limit.
99 */
100@property(nonatomic, assign) int maxIPv6Networks;
101
Daniel Lazarenko2870b0a2018-01-25 10:30:22 +0100102/** Exclude link-local network interfaces
103 * from considertaion for gathering ICE candidates.
104 * Defaults to NO.
105 */
106@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
107
hjon6d49a8e2016-01-26 13:06:42 -0800108@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800109@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -0800110@property(nonatomic, assign) int iceConnectionReceivingTimeout;
111@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
112
tkchinab8f82f2016-01-27 17:50:11 -0800113/** Key type used to generate SSL identity. Default is ECDSA. */
114@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800115
deadbeefbe0c96f2016-05-18 16:20:14 -0700116/** ICE candidate pool size as defined in JSEP. Default is 0. */
117@property(nonatomic, assign) int iceCandidatePoolSize;
118
honghaizaf6b6e02016-07-11 15:09:26 -0700119/** Prune turn ports on the same network to the same turn server.
120 * Default is NO.
121 */
122@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700123
honghaizaf6b6e02016-07-11 15:09:26 -0700124/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700125 * candidate pairs will succeed, even before a binding response is received.
126 */
honghaizaf6b6e02016-07-11 15:09:26 -0700127@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700128
skvlada5d94ff2017-02-02 13:02:30 -0800129/** If set to non-nil, controls the minimal interval between consecutive ICE
130 * check packets.
131 */
132@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
133
Steve Antond295e402017-07-14 16:06:41 -0700134/** ICE Periodic Regathering
135 * If set, WebRTC will periodically create and propose candidates without
136 * starting a new ICE generation. The regathering happens continuously with
137 * interval specified in milliseconds by the uniform distribution [a, b].
138 */
139@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
140
Steve Anton8cb344a2018-02-27 15:34:53 -0800141/** Configure the SDP semantics used by this PeerConnection. Note that the
142 * WebRTC 1.0 specification requires UnifiedPlan semantics. The
143 * RTCRtpTransceiver API is only available with UnifiedPlan semantics.
144 *
145 * PlanB will cause RTCPeerConnection to create offers and answers with at
146 * most one audio and one video m= section with multiple RTCRtpSenders and
147 * RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
148 * will also cause RTCPeerConnection to ignore all but the first m= section of
149 * the same media type.
150 *
151 * UnifiedPlan will cause RTCPeerConnection to create offers and answers with
152 * multiple m= sections where each m= section maps to one RTCRtpSender and one
153 * RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
154 * will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
155 * that form a Plan B stream.
156 *
Steve Anton8cb344a2018-02-27 15:34:53 -0800157 * For users who wish to send multiple audio/video streams and need to stay
Steve Anton3acffc32018-04-12 17:21:03 -0700158 * interoperable with legacy WebRTC implementations or use legacy APIs,
159 * specify PlanB.
Steve Anton8cb344a2018-02-27 15:34:53 -0800160 *
Steve Anton3acffc32018-04-12 17:21:03 -0700161 * For all other users, specify UnifiedPlan.
Steve Anton8cb344a2018-02-27 15:34:53 -0800162 */
163@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
164
jtteh4eeb5372017-04-03 15:06:37 -0700165- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800166
167@end
168
169NS_ASSUME_NONNULL_END