blob: 11ea6a35479bca0c3eb71497e726a25411b5f727 [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
Michael Iedemaccee56b2018-07-05 15:28:24 +020013#import <WebRTC/RTCCertificate.h>
tkchin9eeb6242016-04-27 01:54:20 -070014#import <WebRTC/RTCMacros.h>
tkchin8b577ed2016-04-19 10:04:41 -070015
hjon6d49a8e2016-01-26 13:06:42 -080016@class RTCIceServer;
Steve Antond295e402017-07-14 16:06:41 -070017@class RTCIntervalRange;
hjon6d49a8e2016-01-26 13:06:42 -080018
19/**
20 * Represents the ice transport policy. This exposes the same states in C++,
21 * which include one more state than what exists in the W3C spec.
22 */
23typedef NS_ENUM(NSInteger, RTCIceTransportPolicy) {
24 RTCIceTransportPolicyNone,
25 RTCIceTransportPolicyRelay,
26 RTCIceTransportPolicyNoHost,
27 RTCIceTransportPolicyAll
28};
29
30/** Represents the bundle policy. */
31typedef NS_ENUM(NSInteger, RTCBundlePolicy) {
32 RTCBundlePolicyBalanced,
33 RTCBundlePolicyMaxCompat,
34 RTCBundlePolicyMaxBundle
35};
36
37/** Represents the rtcp mux policy. */
Yves Gerey665174f2018-06-19 15:03:05 +020038typedef NS_ENUM(NSInteger, RTCRtcpMuxPolicy) { RTCRtcpMuxPolicyNegotiate, RTCRtcpMuxPolicyRequire };
hjon6d49a8e2016-01-26 13:06:42 -080039
40/** Represents the tcp candidate policy. */
41typedef NS_ENUM(NSInteger, RTCTcpCandidatePolicy) {
42 RTCTcpCandidatePolicyEnabled,
43 RTCTcpCandidatePolicyDisabled
44};
45
Honghai Zhang46007ae2016-06-03 16:31:32 -070046/** Represents the candidate network policy. */
47typedef NS_ENUM(NSInteger, RTCCandidateNetworkPolicy) {
48 RTCCandidateNetworkPolicyAll,
49 RTCCandidateNetworkPolicyLowCost
50};
51
Honghai Zhang3108fc92016-05-11 10:10:39 -070052/** Represents the continual gathering policy. */
53typedef NS_ENUM(NSInteger, RTCContinualGatheringPolicy) {
54 RTCContinualGatheringPolicyGatherOnce,
55 RTCContinualGatheringPolicyGatherContinually
56};
57
tkchinab8f82f2016-01-27 17:50:11 -080058/** Represents the encryption key type. */
59typedef NS_ENUM(NSInteger, RTCEncryptionKeyType) {
60 RTCEncryptionKeyTypeRSA,
61 RTCEncryptionKeyTypeECDSA,
62};
63
Steve Anton8cb344a2018-02-27 15:34:53 -080064/** Represents the chosen SDP semantics for the RTCPeerConnection. */
65typedef NS_ENUM(NSInteger, RTCSdpSemantics) {
Steve Anton8cb344a2018-02-27 15:34:53 -080066 RTCSdpSemanticsPlanB,
67 RTCSdpSemanticsUnifiedPlan,
68};
69
hjon6d49a8e2016-01-26 13:06:42 -080070NS_ASSUME_NONNULL_BEGIN
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
Michael Iedemaccee56b2018-07-05 15:28:24 +020077/** An RTCCertificate for 're' use. */
78@property(nonatomic, nullable) RTCCertificate *certificate;
79
hjon6d49a8e2016-01-26 13:06:42 -080080/** 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;
Yves Gerey665174f2018-06-19 15:03:05 +020091@property(nonatomic, assign) RTCContinualGatheringPolicy continualGatheringPolicy;
deadbeef2059bb32017-07-26 18:25:43 -070092
93/** By default, the PeerConnection will use a limited number of IPv6 network
94 * interfaces, in order to avoid too many ICE candidate pairs being created
95 * and delaying ICE completion.
96 *
97 * Can be set to INT_MAX to effectively disable the limit.
98 */
99@property(nonatomic, assign) int maxIPv6Networks;
100
Daniel Lazarenko2870b0a2018-01-25 10:30:22 +0100101/** Exclude link-local network interfaces
102 * from considertaion for gathering ICE candidates.
103 * Defaults to NO.
104 */
105@property(nonatomic, assign) BOOL disableLinkLocalNetworks;
106
hjon6d49a8e2016-01-26 13:06:42 -0800107@property(nonatomic, assign) int audioJitterBufferMaxPackets;
hayscc9f95002016-12-05 14:24:32 -0800108@property(nonatomic, assign) BOOL audioJitterBufferFastAccelerate;
hjon6d49a8e2016-01-26 13:06:42 -0800109@property(nonatomic, assign) int iceConnectionReceivingTimeout;
110@property(nonatomic, assign) int iceBackupCandidatePairPingInterval;
111
tkchinab8f82f2016-01-27 17:50:11 -0800112/** Key type used to generate SSL identity. Default is ECDSA. */
113@property(nonatomic, assign) RTCEncryptionKeyType keyType;
hjon6d49a8e2016-01-26 13:06:42 -0800114
deadbeefbe0c96f2016-05-18 16:20:14 -0700115/** ICE candidate pool size as defined in JSEP. Default is 0. */
116@property(nonatomic, assign) int iceCandidatePoolSize;
117
honghaizaf6b6e02016-07-11 15:09:26 -0700118/** Prune turn ports on the same network to the same turn server.
119 * Default is NO.
120 */
121@property(nonatomic, assign) BOOL shouldPruneTurnPorts;
Honghai Zhange2e35ca2016-07-01 14:22:17 -0700122
honghaizaf6b6e02016-07-11 15:09:26 -0700123/** If set to YES, this means the ICE transport should presume TURN-to-TURN
Taylor Brandstettere9851112016-07-01 11:11:13 -0700124 * candidate pairs will succeed, even before a binding response is received.
125 */
honghaizaf6b6e02016-07-11 15:09:26 -0700126@property(nonatomic, assign) BOOL shouldPresumeWritableWhenFullyRelayed;
Taylor Brandstettere9851112016-07-01 11:11:13 -0700127
skvlada5d94ff2017-02-02 13:02:30 -0800128/** If set to non-nil, controls the minimal interval between consecutive ICE
129 * check packets.
130 */
131@property(nonatomic, copy, nullable) NSNumber *iceCheckMinInterval;
132
Steve Antond295e402017-07-14 16:06:41 -0700133/** ICE Periodic Regathering
134 * If set, WebRTC will periodically create and propose candidates without
135 * starting a new ICE generation. The regathering happens continuously with
136 * interval specified in milliseconds by the uniform distribution [a, b].
137 */
138@property(nonatomic, strong, nullable) RTCIntervalRange *iceRegatherIntervalRange;
139
Steve Anton8cb344a2018-02-27 15:34:53 -0800140/** Configure the SDP semantics used by this PeerConnection. Note that the
141 * WebRTC 1.0 specification requires UnifiedPlan semantics. The
142 * RTCRtpTransceiver API is only available with UnifiedPlan semantics.
143 *
144 * PlanB will cause RTCPeerConnection to create offers and answers with at
145 * most one audio and one video m= section with multiple RTCRtpSenders and
146 * RTCRtpReceivers specified as multiple a=ssrc lines within the section. This
147 * will also cause RTCPeerConnection to ignore all but the first m= section of
148 * the same media type.
149 *
150 * UnifiedPlan will cause RTCPeerConnection to create offers and answers with
151 * multiple m= sections where each m= section maps to one RTCRtpSender and one
152 * RTCRtpReceiver (an RTCRtpTransceiver), either both audio or both video. This
153 * will also cause RTCPeerConnection to ignore all but the first a=ssrc lines
154 * that form a Plan B stream.
155 *
Steve Anton8cb344a2018-02-27 15:34:53 -0800156 * For users who wish to send multiple audio/video streams and need to stay
Steve Anton3acffc32018-04-12 17:21:03 -0700157 * interoperable with legacy WebRTC implementations or use legacy APIs,
158 * specify PlanB.
Steve Anton8cb344a2018-02-27 15:34:53 -0800159 *
Steve Anton3acffc32018-04-12 17:21:03 -0700160 * For all other users, specify UnifiedPlan.
Steve Anton8cb344a2018-02-27 15:34:53 -0800161 */
162@property(nonatomic, assign) RTCSdpSemantics sdpSemantics;
163
Zhi Huangb57e1692018-06-12 11:41:11 -0700164/** Actively reset the SRTP parameters when the DTLS transports underneath are
165 * changed after offer/answer negotiation. This is only intended to be a
166 * workaround for crbug.com/835958
167 */
168@property(nonatomic, assign) BOOL activeResetSrtpParams;
169
jtteh4eeb5372017-04-03 15:06:37 -0700170- (instancetype)init;
hjon6d49a8e2016-01-26 13:06:42 -0800171
172@end
173
174NS_ASSUME_NONNULL_END