MillicastSDK 1.8.4
Loading...
Searching...
No Matches
viewer.h
Go to the documentation of this file.
2#import <MillicastSDK/exports.h>
3
4NS_ASSUME_NONNULL_BEGIN
5
6// Forward declarations ///////////////////////////////////////////////////////
7@class MCVideoTrack;
8@class MCAudioTrack;
9
10// Viewer /////////////////////////////////////////////////////////////////////
11
14@interface MCLayerResolution : NSObject
16@property int height;
18@property int width;
19@end
20
23MILLICAST_API @interface MCLayerData : NSObject
24
26@property (nonatomic, strong, nonnull) NSString* encodingId;
27
29@property int bitrate;
30
32@property(nonatomic, assign, nullable) NSNumber *spatialLayerId;
33
35@property(nonatomic, assign, nullable) NSNumber *temporalLayerId;
36
38@property(nonatomic, assign, nullable) NSNumber *maxTemporalLayerId;
39
41@property(nonatomic, assign, nullable) NSNumber *maxSpatialLayerId;
42
44@property(nonatomic, assign, nullable) MCLayerResolution* layerResolution;
45@end
46
50MILLICAST_API @interface MCProjectionData : NSObject
51
53@property (nonatomic, strong, nonnull) NSString* trackId;
54
56@property (nonatomic, strong, nonnull) NSString* media;
57
59@property (nonatomic, strong, nonnull) NSString* mid;
60
62@property (nonatomic, strong, nullable) MCLayerData* layer;
63
64@end
65
68@protocol MCSubscriberDelegate <MCDelegate>
69
71- (void) onSubscribed;
72
73
77- (void) onVideoTrack:(nonnull MCVideoTrack*) track withMid:(nonnull NSString*) mid;
78
83- (void) onAudioTrack:(nonnull MCAudioTrack*) track withMid:(nonnull NSString*) mid;
84
90- (void) onActive: (nonnull NSString*) streamId tracks: (nonnull NSArray<NSString*> *)tracks sourceId:(nonnull NSString*) sourceId;
91
92
97- (void) onInactive: (nonnull NSString*) streamId sourceId:(nonnull NSString*) sourceId;
98
100- (void) onStopped;
101
106- (void) onVad: (nonnull NSString*) mid sourceId:(nonnull NSString*) sourceId;
107
113- (void) onLayers: (nonnull NSString*) mid activeLayers:(nonnull NSArray<MCLayerData*>*) activeLayers inactiveLayers:(nonnull NSArray<NSString*>*) inactiveLayers;
114
115@optional
125- (void) onFrameMetadata:(nonnull const unsigned char*)data withLength:(int)length withSsrc:(int) ssrc withTimestamp:(int) timestamp;
126
127@end
128
132
134@property (nonatomic, strong, nonnull) NSString* streamName;
135
137@property (nonatomic, strong, nonnull) NSString* token;
138
140@property (nonatomic, strong, nonnull) NSString* accountId;
141
143@property (nonatomic, strong, nonnull) NSString* apiUrl;
144
145@end
146
148MILLICAST_API @interface MCSubscriber : NSObject <MCClient>
149
150@property(nonatomic, weak) id<MCSubscriberDelegate> delegate;
151
157- (instancetype)initWithDelegate: (id<MCSubscriberDelegate>) delegate;
158
165- (void)subscribeWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
166
172- (void)subscribeWithOptions: (MCClientOptions *) opts completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
173
177- (void) isSubscribedWithCompletionHandler:(nonnull void (^)(BOOL subscribed)) completionHandler;
178
185- (void)unsubscribeWithCompletionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
186
194- (void) project:(NSString*) sourceId withData:(NSArray<MCProjectionData*>*) projectionData completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
195
200- (void) unproject:(NSArray<NSString*>*) mids completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
201
206- (void) select:(MCLayerData* _Nullable)layer completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
207
213- (void) addRemoteTrack: (NSString*) kind completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
214
219- (void) getMid:(NSString*) trackId completionHandler:(nonnull void (^)(NSString *, NSError * _Nullable)) completionHandler;
220
225- (void) setCredentials: (nonnull MCSubscriberCredentials*) credentials completionHandler:(nonnull void (^)(NSError * _Nullable)) completionHandler;
226
230- (void) getCredentialsWithCompletionHandler:(nonnull void (^)(MCSubscriberCredentials * _Nonnull)) completionHandler;
231
232@end
233
234NS_ASSUME_NONNULL_END
#define MILLICAST_API
Definition exports.h:51
Manages and plays a single audio resource.
Definition track.h:51
The MCClientOptions class gathers options for the client.
Definition client.h:126
Definition viewer.h:24
int bitrate
The bitrate of the SVC layer.
Definition viewer.h:29
Definition viewer.h:15
int height
The height of the layer.
Definition viewer.h:16
int width
The width of the layer.
Definition viewer.h:18
Definition viewer.h:51
Definition viewer.h:132
The Subscriber class manages the subscription to audio and video tracks from the Millicast platform.
Definition viewer.h:148
Responsible for managing video capture session from a video source.
Definition track.h:33
The Client base that contains common methods between MCPublisher and MCSubscriber.
Definition client.h:191