MillicastSDK 2.0.0
Loading...
Searching...
No Matches
client.h
Go to the documentation of this file.
1#import <Foundation/Foundation.h>
2#import <MillicastSDK/exports.h>
3
4// Forward declaration
5@class MCStatsReport;
6@protocol MCClient;
7
9typedef NS_CLOSED_ENUM(NSInteger, MCDegradationPreferences)
10{
12 MCDegradationPreferencesDisabled,
13
15 MCDegradationPreferencesMaintainResolution,
16
18 MCDegradationPreferencesMaintainFrameRate,
19
21 MCDegradationPreferencesBalanced,
22
24 MCDegradationPreferencesDefault
25};
26
27typedef NS_CLOSED_ENUM(NSInteger, MCConnectionState)
28{
30 MCConnectionStateIdle,
32 MCConnectionStateConnecting,
34 MCConnectionStateConnected,
36 MCConnectionStateReconnecting,
38 MCConnectionStateDisconnecting,
40 MCConnectionStateFailed
41};
42
44MILLICAST_API @interface MCBitrateSettings : NSObject
45
47@property(nonatomic) BOOL disableBWE;
48
50@property(nonatomic) NSInteger maxBitrateKbps;
51
53@property(nonatomic) NSInteger minBitrateKbps;
54
56@property(nonatomic) NSInteger startBitrateKbps;
57@end
58
62 NSNumber *code;
63 NSString *reason;
64}
66@property (copy) NSNumber* _Nonnull code;
68@property (copy) NSString* _Nonnull reason;
69@end
70
73MILLICAST_API @interface MCSignalingError: NSObject {
74 NSString *reason;
75}
77@property (copy) NSString* _Nonnull reason;
78@end
79
80
83@protocol MCDelegate <NSObject>
84
90- (void) client:(nonnull id<MCClient>) client didReceiveHTTPConnectionError:(nonnull MCHTTPConnectionError*) error
91 NS_SWIFT_NAME(client(_:didReceiveHTTPConnectionError:));
92
97- (void) client:(nonnull id<MCClient>) client didReceiveSignalingError:(nonnull MCSignalingError*) error
98 NS_SWIFT_NAME(client(_:didReceiveSignalingError:));
99
100@optional
111- (void)client:(nonnull id<MCClient>) client didReceiveStatsReport:(nonnull MCStatsReport *) report
112 NS_SWIFT_NAME(client(_:didReceiveStatsReport:));
113
114@optional
119- (void)client:(nonnull id<MCClient>) client didReceiveViewerCount:(int)viewerCount
120 NS_SWIFT_NAME(client(_:didReceiveViewerCount:));
121
126- (void)client:(nonnull id<MCClient>) client didReceiveWebsocketConnectionState:(MCConnectionState) state
127 NS_SWIFT_NAME(client(_:didReceiveWebsocketConnectionState:));
128
133- (void)client:(nonnull id<MCClient>) client didReceiveRTCPeerConnectionState:(MCConnectionState) state
134 NS_SWIFT_NAME(client(_:didReceiveRTCPeerConnectionState:));
135
136@end
137
139typedef NS_CLOSED_ENUM(NSInteger, MCScalabilityMode)
140{
141 MCScalabilityModeNone,
142 MCScalabilityModeL1T2 NS_SWIFT_NAME(l1t2),
143 MCScalabilityModeL1T2h NS_SWIFT_NAME(l1t2h),
144 MCScalabilityModeL1T3 NS_SWIFT_NAME(l1t3),
145 MCScalabilityModeL1T3h NS_SWIFT_NAME(l1t3h),
146 MCScalabilityModeL2T1 NS_SWIFT_NAME(l2t1),
147 MCScalabilityModeL2T1h NS_SWIFT_NAME(l2t1h),
148 MCScalabilityModeL2T1Key NS_SWIFT_NAME(l2t1Key),
149 MCScalabilityModeL2T2 NS_SWIFT_NAME(l2t2),
150 MCScalabilityModeL2T3 NS_SWIFT_NAME(l2t3),
151 MCScalabilityModeL2T2h NS_SWIFT_NAME(l2t2h),
152 MCScalabilityModeL2T2Key NS_SWIFT_NAME(l2t2Key),
153 MCScalabilityModeL2T2KeyShift NS_SWIFT_NAME(l2t2KeyShift),
154 MCScalabilityModeL2T3h NS_SWIFT_NAME(l2t3h),
155 MCScalabilityModeL3T1 NS_SWIFT_NAME(l3t1),
156 MCScalabilityModeL3T2 NS_SWIFT_NAME(l3t2),
157 MCScalabilityModeL3T3 NS_SWIFT_NAME(l3t3),
158 MCScalabilityModeL3T3Key NS_SWIFT_NAME(l3t3Key),
159 MCScalabilityModeS2T1 NS_SWIFT_NAME(s2t1),
160 MCScalabilityModeS2T2 NS_SWIFT_NAME(s2t2),
161 MCScalabilityModeS2T3 NS_SWIFT_NAME(s2t3),
162 MCScalabilityModeS3T1 NS_SWIFT_NAME(s3t1),
163 MCScalabilityModeS3T2 NS_SWIFT_NAME(s3t2),
164 MCScalabilityModeS3T3 NS_SWIFT_NAME(s3t3),
165 MCScalabilityModeS2T1h NS_SWIFT_NAME(s2t1h),
166 MCScalabilityModeS2T2h NS_SWIFT_NAME(s2t2h),
167 MCScalabilityModeS2T3h NS_SWIFT_NAME(s2t3h),
168 MCScalabilityModeS3T1h NS_SWIFT_NAME(s3t1h),
169 MCScalabilityModeS3T2h NS_SWIFT_NAME(s3t2h),
170 MCScalabilityModeS3T3h NS_SWIFT_NAME(s3t3h)
171};
172
175
177@property(nonatomic, assign) BOOL autoReconnect;
178
179@end
180
194- (nonnull instancetype) initWithMin: (int) min max: (int) max
195 NS_SWIFT_NAME(init(min:max:));
196
199@property(nonatomic, assign) int minimum;
200
203@property(nonatomic, assign) int maximum;
204
205@end
206
208MILLICAST_API @interface MCClientOptions : NSObject
209
211@property(nonatomic, retain, nullable) NSString *sourceId;
212
214@property(nonatomic, retain, nullable) NSString *pinnedSourceId;
215
217@property(nonatomic, retain, nullable) NSArray *excludedSourceId;
218
220@property(nonatomic, assign) BOOL dtx;
221
223@property(nonatomic, assign) int multiplexedAudioTrack;
224
225
227@property(nonatomic, retain, nullable) NSString *videoCodec;
228
230@property(nonatomic, retain, nullable) NSString *audioCodec;
231
232
234@property(nonatomic, assign) MCDegradationPreferences degradationPreferences;
235
237@property(nonatomic, retain, nullable) MCBitrateSettings *bitrateSettings;
238
240@property(nonatomic, assign) BOOL stereo;
241
243@property(nonatomic, assign) int statsDelayMs;
244
246@property(nonatomic, assign) int jitterMinimumDelayMs;
247
249@property(nonatomic, retain, nullable) MCForcePlayoutDelay *forcePlayoutDelay;
250
252@property(nonatomic, assign) BOOL disableAudio;
253
255@property(nonatomic, retain, nullable) NSNumber* maximumBitrate;
256
258@property(nonatomic, assign) MCScalabilityMode svcMode;
259
260
262@property(nonatomic, assign) BOOL simulcast;
263
265@property(nonatomic, retain, nullable) NSString *rtcEventLogOutputPath;
266
267
269@property(nonatomic,assign) BOOL recordStream;
270
272@property(nonatomic, assign, nullable) NSNumber *priority;
273
282@property(nonatomic, assign) BOOL forceSmooth;
283
286@property(nonatomic, retain, nullable) NSNumber *bweMonitorDurationUs;
287
289@property(nonatomic, retain, nullable) NSNumber *bweRateChangePercentage;
290
292@property(nonatomic, retain, nullable) NSNumber *upwardsLayerWaitTimeMs;
293
294@end
295
297MILLICAST_API @protocol MCClient
298
302- (void)connectWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
303
304
309- (void)connectWithOptions:(nonnull MCConnectionOptions *) options
310 completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
311
317- (void)connectWithWebsocketUrl:(nonnull NSString *)websocketUrl jwt:(nonnull NSString *)jwt
318 completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
319
326- (void)connectWithWebsocketUrl:(nonnull NSString *)websocketUrl jwt:(nonnull NSString *)jwt
327 connectionOptions:(nonnull MCConnectionOptions *) connectionOptions
328 completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
329
333- (void)isConnectedWithCompletionHandler:(nonnull void (^)(BOOL connected)) completionHandler;
334
335
343- (void)disconnectWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
344
352- (void)enableStats:(BOOL)enable
353 completionHandler:(nonnull void (^)(void)) completionHandler;
354@end
355
356
358MILLICAST_API @interface MCCleanup : NSObject
359
361+ (void)cleanup;
362
363@end
#define MILLICAST_API
Definition exports.h:51
The BitrateSettings class allows customizing bitrate settings for publishing streams.
Definition client.h:45
BOOL disableBWE
Disable built-in bandwidth estimation algorithm that forces sending the maximum bitrate without any c...
Definition client.h:47
NSInteger startBitrateKbps
The start bitrate, in kilobits per second.
Definition client.h:56
NSInteger minBitrateKbps
The minimum bitrate, in kilobits per second.
Definition client.h:53
NSInteger maxBitrateKbps
The maximum bitrate, in kilobits per second.
Definition client.h:50
The Cleanup class is responsible for cleaning the memory of dynamic objects.
Definition client.h:359
The MCClientOptions class gathers options for the client.
Definition client.h:209
The MCConnectionOptions class gathers connection options.
Definition client.h:175
Definition client.h:194
Definition client.h:61
NSNumber * code
Definition client.h:62
NSString * reason
Definition client.h:63
Definition client.h:73
NSString * reason
Definition client.h:74
Interface is a container for various different statistics.
Definition stats.h:469
typedef NS_CLOSED_ENUM(NSInteger, MCDegradationPreferences)
The DegradationPreferences enum. Based on the WebRTC standard
Definition client.h:9