Back to MiXiD API Documentation
Detailed MiXiD XCFramework reference for WebRTC and WHIP. Read through each header, class, protocol, and function section to inspect Objective-C declarations, parameters, return values, and usage guidance.
WHIP Publishing Examples
Use MXDWHIPStreamPusher to publish WebRTC media to a WHIP endpoint using an optional bearer token.
Swift
final class WHIPPublisher: NSObject, MXDWHIPStreamPusherDelegate {
private let pusher: MXDWHIPStreamPusher
init(endpointURL: URL, bearerToken: String?) {
let config = MXDWHIPStreamPusherConfiguration.default()
config.videoWidth = 1280
config.videoHeight = 720
config.videoFPS = 30
config.minVideoBitrateBps = 1_500_000
config.maxVideoBitrateBps = 3_500_000
config.keyframeIntervalSeconds = 2
self.pusher = MXDWHIPStreamPusher(endpointURL: endpointURL, bearerToken: bearerToken, configuration: config)
super.init()
pusher.delegate = self
}
func start() { pusher.start() }
func stop() { pusher.stop() }
func appendVideoFrame(_ imageBuffer: CVImageBuffer, time: CMTime) {
pusher.appendVideoFrame(imageBuffer, presentationTime: time)
}
func appendAudioBuffer(_ audioBuffer: AVAudioPCMBuffer) {
pusher.appendAudioBuffer(audioBuffer)
}
func whipStreamPusher(_ streamPusher: MXDWHIPStreamPusher, didChangeState state: MXDWHIPStreamPusherState) {
print("WHIP state: \(state.rawValue)")
}
func whipStreamPusher(_ streamPusher: MXDWHIPStreamPusher, didFailWithError error: Error) {
print("WHIP failed: \(error)")
}
}
Objective-C
@interface WHIPPublisher : NSObject <MXDWHIPStreamPusherDelegate>
@property (nonatomic, strong) MXDWHIPStreamPusher *pusher;
@end
@implementation WHIPPublisher
- (instancetype)initWithEndpointURL:(NSURL *)endpointURL bearerToken:(NSString *)bearerToken {
self = [super init];
if (!self) { return nil; }
MXDWHIPStreamPusherConfiguration *config = [MXDWHIPStreamPusherConfiguration defaultConfiguration];
config.videoWidth = 1280;
config.videoHeight = 720;
config.videoFPS = 30;
config.minVideoBitrateBps = 1500000;
config.maxVideoBitrateBps = 3500000;
config.keyframeIntervalSeconds = 2;
_pusher = [[MXDWHIPStreamPusher alloc] initWithEndpointURL:endpointURL
bearerToken:bearerToken
configuration:config];
_pusher.delegate = self;
return self;
}
- (void)start { [self.pusher start]; }
- (void)stop { [self.pusher stop]; }
- (void)appendVideoFrame:(CVImageBufferRef)imageBuffer time:(CMTime)time {
[self.pusher appendVideoFrame:imageBuffer presentationTime:time];
}
- (void)appendAudioBuffer:(AVAudioPCMBuffer *)audioBuffer {
[self.pusher appendAudioBuffer:audioBuffer];
}
- (void)whipStreamPusher:(MXDWHIPStreamPusher *)streamPusher didChangeState:(MXDWHIPStreamPusherState)state {
NSLog(@"WHIP state: %ld", (long)state);
}
- (void)whipStreamPusher:(MXDWHIPStreamPusher *)streamPusher didFailWithError:(NSError *)error {
NSLog(@"WHIP failed: %@", error);
}
@end
WebRTC and WHIP
WebRTC and WHIP
MXDH264KeyframeEncoderFactory.h
WebRTC H.264 encoder factory with keyframe cadence control.
MXDH264KeyframeEncoderFactory
initWithBaseFactory:keyframeIntervalSeconds:
- (instancetype)initWithBaseFactory:(id<RTCVideoEncoderFactory>)baseFactory keyframeIntervalSeconds:(NSTimeInterval)keyframeIntervalSeconds;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithBaseFactory keyframeIntervalSeconds. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithBaseFactory (id<RTCVideoEncoderFactory>, baseFactory); keyframeIntervalSeconds (NSTimeInterval, keyframeIntervalSeconds)Swift usage let value = MXDH264KeyframeEncoderFactory(initWithBaseFactory: baseFactory, keyframeIntervalSeconds: "value")
MXDWHIPServer.h
Protocol-level WHIP ingest server.
Enums
MXDWHIPServerErrorCode
MXDWHIPServerErrorCodeInvalidRequest = 1
MXDWHIPServerErrorCodeMissingPeerConnection
MXDWHIPServerErrorCodeAnswerCreationFailed
MXDWHIPServerErrorCodeSessionNotFound
Typedefs
typedef NS_ENUM(NSInteger, MXDWHIPServerErrorCode) { MXDWHIPServerErrorCodeInvalidRequest = 1, MXDWHIPServerErrorCodeMissingPeerConnection, MXDWHIPServerErrorCodeAnswerCreationFailed, MXDWHIPServerErrorCodeSessionNotFound }; @class MXDWHIPServer; @class MXDWHIPServerResponse; @class MXDWHIPServerSession; typedef void (^MXDWHIPServerAnswerCompletion)(NSString * _Nullable answerSDP, NSError * _Nullable error);
typedef void (^MXDWHIPServerResponseCompletion)(MXDWHIPServerResponse *response);
typedef id<MXDWHIPServerPeerConnection> _Nullable (^MXDWHIPServerPeerConnectionFactory)(void);
MXDWHIPServerPeerConnection Protocol
createAnswerForRemoteOfferSDP:completion:
- (void)createAnswerForRemoteOfferSDP:(NSString *)offerSDP completion:(MXDWHIPServerAnswerCompletion)completion;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for createAnswerForRemoteOfferSDP completion. Implement this method to observe lifecycle, media output, status, or error events. Parameters createAnswerForRemoteOfferSDP (NSString *, offerSDP); completion (MXDWHIPServerAnswerCompletion, completion)Swift usage instance.createAnswerForRemoteOfferSDP(createAnswerForRemoteOfferSDP: "value", completion: completion)
close
- (void)close;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for close. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.close()
MXDWHIPServerDelegate Protocol
whipServer:didCreateSession:
- (void)whipServer:(MXDWHIPServer *)server didCreateSession:(MXDWHIPServerSession *)session;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipServer didCreateSession. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipServer (MXDWHIPServer *, server); didCreateSession (MXDWHIPServerSession *, session)Swift usage instance.whipServer(whipServer: server, didCreateSession: session)
whipServer:didCloseSession:
- (void)whipServer:(MXDWHIPServer *)server didCloseSession:(MXDWHIPServerSession *)session;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipServer didCloseSession. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipServer (MXDWHIPServer *, server); didCloseSession (MXDWHIPServerSession *, session)Swift usage instance.whipServer(whipServer: server, didCloseSession: session)
whipServer:didFailWithError:
- (void)whipServer:(MXDWHIPServer *)server didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipServer didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipServer (MXDWHIPServer *, server); didFailWithError (NSError *, error)Swift usage instance.whipServer(whipServer: server, didFailWithError: nil)
MXDWHIPServerResponse
Name Declaration Details statusCode@property (nonatomic, assign, readonly) NSInteger statusCode;Public configuration or state exposed by this API. headers@property (nonatomic, copy, readonly) NSDictionary<NSString *, NSString *> *headers;Public configuration or state exposed by this API. body@property (nonatomic, strong, readonly) NSData *body;Public configuration or state exposed by this API.
initWithStatusCode:headers:body:
- (instancetype)initWithStatusCode:(NSInteger)statusCode headers:(nullable NSDictionary<NSString *, NSString *> *)headers body:(nullable NSData *)body NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithStatusCode headers body. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithStatusCode (NSInteger, statusCode); headers (nullable NSDictionary<NSString *, NSString *> *, headers); body (nullable NSData *, body)Swift usage let value = MXDWHIPServerResponse(initWithStatusCode: 0, headers: "value", body: data)
MXDWHIPServerSession
Name Declaration Details identifier@property (nonatomic, copy, readonly) NSString *identifier;Public configuration or state exposed by this API. resourceURL@property (nonatomic, strong, readonly) NSURL *resourceURL;Endpoint or file URL used by the component. peerConnection@property (nonatomic, strong, readonly) id<MXDWHIPServerPeerConnection> peerConnection;Public configuration or state exposed by this API. createdAt@property (nonatomic, copy, readonly) NSDate *createdAt;Public configuration or state exposed by this API.
MXDWHIPServer
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDWHIPServerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. baseURL@property (nonatomic, copy, readonly) NSURL *baseURL;Endpoint or file URL used by the component. resourcePathPrefix@property (nonatomic, copy, readonly) NSString *resourcePathPrefix;Public configuration or state exposed by this API. sessionsByIdentifier@property (nonatomic, copy, readonly) NSDictionary<NSString *, MXDWHIPServerSession *> *sessionsByIdentifier;Public configuration or state exposed by this API.
initWithBaseURL:resourcePathPrefix:peerConnectionFactory:
- (instancetype)initWithBaseURL:(NSURL *)baseURL resourcePathPrefix:(nullable NSString *)resourcePathPrefix peerConnectionFactory:(MXDWHIPServerPeerConnectionFactory)peerConnectionFactory NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithBaseURL resourcePathPrefix peerConnectionFactory. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithBaseURL (NSURL *, baseURL); resourcePathPrefix (nullable NSString *, resourcePathPrefix); peerConnectionFactory (MXDWHIPServerPeerConnectionFactory, peerConnectionFactory)Swift usage let value = MXDWHIPServer(initWithBaseURL: url, resourcePathPrefix: "value", peerConnectionFactory: peerConnectionFactory)
handlePOSTOfferSDP:requestURL:headers:completion:
- (void)handlePOSTOfferSDP:(NSString *)offerSDP requestURL:(NSURL *)requestURL headers:(nullable NSDictionary<NSString *, NSString *> *)headers completion:(MXDWHIPServerResponseCompletion)completion;
Kind Instance method Return voidDetails Performs the handlePOSTOfferSDP requestURL headers completion operation on this MiXiD component. Parameters handlePOSTOfferSDP (NSString *, offerSDP); requestURL (NSURL *, requestURL); headers (nullable NSDictionary<NSString *, NSString *> *, headers); completion (MXDWHIPServerResponseCompletion, completion)Swift usage instance.handlePOSTOfferSDP(handlePOSTOfferSDP: "value", requestURL: url, headers: "value", completion: completion)
handleDELETEResourceURL:
- (MXDWHIPServerResponse *)handleDELETEResourceURL:(NSURL *)resourceURL;
Kind Instance method Return MXDWHIPServerResponse *Details Performs the handleDELETEResourceURL operation on this MiXiD component. Parameters handleDELETEResourceURL (NSURL *, resourceURL)Swift usage let result = instance.handleDELETEResourceURL(handleDELETEResourceURL: url)
closeAllSessions
- (void)closeAllSessions;
Kind Instance method Return voidDetails Performs the closeAllSessions operation on this MiXiD component. Parameters No parameters. Swift usage instance.closeAllSessions()
MXDWHIPServerView.h
WHIP ingest and preview component.
Enums
MXDWHIPServerViewState
MXDWHIPServerViewStateIdle = 0
MXDWHIPServerViewStateListening
MXDWHIPServerViewStateReceiving
MXDWHIPServerViewStateStopped
MXDWHIPServerViewStateError
MXDWHIPServerViewDelegate Protocol
playerView:didChangeState:
- (void)playerView:(MXDWHIPServerView *)playerView didChangeState:(NSInteger)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for playerView didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters playerView (MXDWHIPServerView *, playerView); didChangeState (NSInteger, state)Swift usage instance.playerView(playerView: playerView, didChangeState: 0)
playerView:didFailWithError:
- (void)playerView:(MXDWHIPServerView *)playerView didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for playerView didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters playerView (MXDWHIPServerView *, playerView); didFailWithError (NSError *, error)Swift usage instance.playerView(playerView: playerView, didFailWithError: nil)
MXDWHIPServerViewOutputDelegate Protocol
whipServerView:didOutputVideoFrame:presentationTime:
- (void)whipServerView:(MXDWHIPServerView *)serverView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipServerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipServerView (MXDWHIPServerView *, serverView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.whipServerView(whipServerView: serverView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
MXDWHIPServerView
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDWHIPServerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. outputDelegate@property (nonatomic, weak, nullable) id<MXDWHIPServerViewOutputDelegate> outputDelegate;Receives lifecycle, media output, status, or error callbacks. serverURL@property (nonatomic, copy, nullable, readonly) NSURL *serverURL;Endpoint or file URL used by the component. state@property (nonatomic, assign, readonly) MXDWHIPServerViewState state;Public configuration or state exposed by this API. previewEnabled@property (nonatomic, assign) BOOL previewEnabled;Public configuration or state exposed by this API. slotIndex@property (nonatomic, assign) NSInteger slotIndex;Public configuration or state exposed by this API.
init
- (instancetype)init;
Kind Instance method Return instancetypeDetails Initializes the receiver for init. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters No parameters. Swift usage let value = MXDWHIPServerView()
initWithServerURL:
- (instancetype)initWithServerURL:(NSURL *)serverURL;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithServerURL. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithServerURL (NSURL *, serverURL)Swift usage let value = MXDWHIPServerView(initWithServerURL: url)
setServerURL:autoplay:
- (void)setServerURL:(nullable NSURL *)serverURL autoplay:(BOOL)autoplay;
Kind Instance method Return voidDetails Updates configuration on an existing object. Some changes apply immediately; transport or stream changes may reconnect or reload internal resources. Parameters setServerURL (nullable NSURL *, serverURL); autoplay (BOOL, autoplay)Swift usage instance.setServerURL(setServerURL: url, autoplay: true)
play
- (void)play;
Kind Instance method Return voidDetails Begins or resumes playback/rendering for the configured media source. Parameters No parameters. Swift usage instance.play()
stop
- (void)stop;
Kind Instance method Return voidDetails Stops the component and releases or finalizes active workflow resources. Parameters No parameters. Swift usage instance.stop()
MXDWHIPStreamPush.h
Protocol-level WHIP publisher.
Enums
MXDWHIPStreamPushState
MXDWHIPStreamPushStateIdle
MXDWHIPStreamPushStateCreatingOffer
MXDWHIPStreamPushStateConnecting
MXDWHIPStreamPushStateStreaming
MXDWHIPStreamPushStateStopping
MXDWHIPStreamPushStateFailed
MXDWHIPStreamPushErrorCode
MXDWHIPStreamPushErrorCodeInvalidConfiguration = 1
MXDWHIPStreamPushErrorCodeMissingPeerConnection
MXDWHIPStreamPushErrorCodeOfferCreationFailed
MXDWHIPStreamPushErrorCodeHTTPFailure
MXDWHIPStreamPushErrorCodeInvalidHTTPResponse
MXDWHIPStreamPushErrorCodeRemoteDescriptionFailed
MXDWHIPStreamPushErrorCodeStopped
Typedefs
typedef NS_ENUM(NSInteger, MXDWHIPStreamPushState) { MXDWHIPStreamPushStateIdle, MXDWHIPStreamPushStateCreatingOffer, MXDWHIPStreamPushStateConnecting, MXDWHIPStreamPushStateStreaming, MXDWHIPStreamPushStateStopping, MXDWHIPStreamPushStateFailed }; /// Enumerates the possible values for `MXDWHIPStreamPushErrorCode`. /// Use these values when configuring the component or interpreting delegate state callbacks. typedef NS_ENUM(NSInteger, MXDWHIPStreamPushErrorCode) { MXDWHIPStreamPushErrorCodeInvalidConfiguration = 1, MXDWHIPStreamPushErrorCodeMissingPeerConnection, MXDWHIPStreamPushErrorCodeOfferCreationFailed, MXDWHIPStreamPushErrorCodeHTTPFailure, MXDWHIPStreamPushErrorCodeInvalidHTTPResponse, MXDWHIPStreamPushErrorCodeRemoteDescriptionFailed, MXDWHIPStreamPushErrorCodeStopped }; @class MXDWHIPStreamPush; @class MXDWHIPEndpoint; typedef void (^MXDWHIPSDPCompletion)(NSString * _Nullable sdp, NSError * _Nullable error);
typedef void (^MXDWHIPCompletion)(NSError * _Nullable error);
MXDWHIPStreamPushDelegate Protocol
whipStreamPush:didChangeState:
- (void)whipStreamPush:(MXDWHIPStreamPush *)streamPush didChangeState:(MXDWHIPStreamPushState)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipStreamPush didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipStreamPush (MXDWHIPStreamPush *, streamPush); didChangeState (MXDWHIPStreamPushState, state)Swift usage instance.whipStreamPush(whipStreamPush: streamPush, didChangeState: state)
whipStreamPush:didFailWithError:
- (void)whipStreamPush:(MXDWHIPStreamPush *)streamPush didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipStreamPush didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipStreamPush (MXDWHIPStreamPush *, streamPush); didFailWithError (NSError *, error)Swift usage instance.whipStreamPush(whipStreamPush: streamPush, didFailWithError: nil)
whipStreamPush:didCreateResourceAtURL:
- (void)whipStreamPush:(MXDWHIPStreamPush *)streamPush didCreateResourceAtURL:(NSURL *)resourceURL;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipStreamPush didCreateResourceAtURL. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipStreamPush (MXDWHIPStreamPush *, streamPush); didCreateResourceAtURL (NSURL *, resourceURL)Swift usage instance.whipStreamPush(whipStreamPush: streamPush, didCreateResourceAtURL: url)
MXDWHIPPeerConnection Protocol
createOfferWithCompletion:
- (void)createOfferWithCompletion:(MXDWHIPSDPCompletion)completion;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for createOfferWithCompletion. Implement this method to observe lifecycle, media output, status, or error events. Parameters createOfferWithCompletion (MXDWHIPSDPCompletion, completion)Swift usage instance.createOfferWithCompletion(createOfferWithCompletion: completion)
setRemoteAnswerSDP:completion:
- (void)setRemoteAnswerSDP:(NSString *)answerSDP completion:(MXDWHIPCompletion)completion;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for setRemoteAnswerSDP completion. Implement this method to observe lifecycle, media output, status, or error events. Parameters setRemoteAnswerSDP (NSString *, answerSDP); completion (MXDWHIPCompletion, completion)Swift usage instance.setRemoteAnswerSDP(setRemoteAnswerSDP: "value", completion: completion)
close
- (void)close;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for close. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.close()
pushVideoSampleBuffer:
- (void)pushVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for pushVideoSampleBuffer. Implement this method to observe lifecycle, media output, status, or error events. Parameters pushVideoSampleBuffer (CMSampleBufferRef, sampleBuffer)Swift usage instance.pushVideoSampleBuffer(pushVideoSampleBuffer: sampleBuffer)
pushAudioSampleBuffer:
- (void)pushAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for pushAudioSampleBuffer. Implement this method to observe lifecycle, media output, status, or error events. Parameters pushAudioSampleBuffer (CMSampleBufferRef, sampleBuffer)Swift usage instance.pushAudioSampleBuffer(pushAudioSampleBuffer: sampleBuffer)
MXDWHIPEndpoint
Name Declaration Details url@property (nonatomic, strong, readonly) NSURL *url;Endpoint or file URL used by the component. bearerToken@property (nonatomic, copy, readonly, nullable) NSString *bearerToken;Public configuration or state exposed by this API. additionalHeaders@property (nonatomic, copy, readonly) NSDictionary<NSString *, NSString *> *additionalHeaders;Public configuration or state exposed by this API. requestTimeout@property (nonatomic, assign, readonly) NSTimeInterval requestTimeout;Network transport reliability and buffering configuration.
initWithURL:bearerToken:
- (instancetype)initWithURL:(NSURL *)url bearerToken:(nullable NSString *)bearerToken;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithURL bearerToken. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithURL (NSURL *, url); bearerToken (nullable NSString *, bearerToken)Swift usage let value = MXDWHIPEndpoint(initWithURL: url, bearerToken: "value")
initWithURL:bearerToken:additionalHeaders:requestTimeout:
- (instancetype)initWithURL:(NSURL *)url bearerToken:(nullable NSString *)bearerToken additionalHeaders:(nullable NSDictionary<NSString *, NSString *> *)additionalHeaders requestTimeout:(NSTimeInterval)requestTimeout NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithURL bearerToken additionalHeaders requestTimeout. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithURL (NSURL *, url); bearerToken (nullable NSString *, bearerToken); additionalHeaders (nullable NSDictionary<NSString *, NSString *> *, additionalHeaders); requestTimeout (NSTimeInterval, requestTimeout)Swift usage let value = MXDWHIPEndpoint(initWithURL: url, bearerToken: "value", additionalHeaders: "value", requestTimeout: 0.0)
MXDWHIPStreamPush
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDWHIPStreamPushDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. peerConnection@property (nonatomic, strong, nullable) id<MXDWHIPPeerConnection> peerConnection;Public configuration or state exposed by this API. state@property (nonatomic, readonly) MXDWHIPStreamPushState state;Public configuration or state exposed by this API. endpoint@property (nonatomic, copy, readonly, nullable) MXDWHIPEndpoint *endpoint;Public configuration or state exposed by this API. resourceURL@property (nonatomic, strong, readonly, nullable) NSURL *resourceURL;Endpoint or file URL used by the component.
initWithPeerConnection:
- (instancetype)initWithPeerConnection:(nullable id<MXDWHIPPeerConnection>)peerConnection;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPeerConnection. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPeerConnection (nullable id<MXDWHIPPeerConnection>, peerConnection)Swift usage let value = MXDWHIPStreamPush(initWithPeerConnection: peerConnection)
initWithPeerConnection:URLSession:
- (instancetype)initWithPeerConnection:(nullable id<MXDWHIPPeerConnection>)peerConnection URLSession:(NSURLSession *)URLSession NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPeerConnection URLSession. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPeerConnection (nullable id<MXDWHIPPeerConnection>, peerConnection); URLSession (NSURLSession *, URLSession)Swift usage let value = MXDWHIPStreamPush(initWithPeerConnection: peerConnection, URLSession: url)
startWithEndpoint:
- (void)startWithEndpoint:(MXDWHIPEndpoint *)endpoint;
Kind Instance method Return voidDetails Performs the startWithEndpoint operation on this MiXiD component. Parameters startWithEndpoint (MXDWHIPEndpoint *, endpoint)Swift usage instance.startWithEndpoint(startWithEndpoint: endpoint)
stop
- (void)stop;
Kind Instance method Return voidDetails Stops the component and releases or finalizes active workflow resources. Parameters No parameters. Swift usage instance.stop()
pushVideoSampleBuffer:
- (void)pushVideoSampleBuffer:(CMSampleBufferRef)sampleBuffer;
Kind Instance method Return voidDetails Performs the pushVideoSampleBuffer operation on this MiXiD component. Parameters pushVideoSampleBuffer (CMSampleBufferRef, sampleBuffer)Swift usage instance.pushVideoSampleBuffer(pushVideoSampleBuffer: sampleBuffer)
pushAudioSampleBuffer:
- (void)pushAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer;
Kind Instance method Return voidDetails Performs the pushAudioSampleBuffer operation on this MiXiD component. Parameters pushAudioSampleBuffer (CMSampleBufferRef, sampleBuffer)Swift usage instance.pushAudioSampleBuffer(pushAudioSampleBuffer: sampleBuffer)
MXDWHIPStreamPusher.h
High-level WHIP publishing component.
Enums
MXDWHIPStreamPusherState
MXDWHIPStreamPusherStateIdle = 0
MXDWHIPStreamPusherStateConnecting
MXDWHIPStreamPusherStateStreaming
MXDWHIPStreamPusherStateStopping
MXDWHIPStreamPusherStateFailed
MXDWHIPStreamPusherDelegate Protocol
whipStreamPusher:didChangeState:
- (void)whipStreamPusher:(MXDWHIPStreamPusher *)streamPusher didChangeState:(MXDWHIPStreamPusherState)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipStreamPusher didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipStreamPusher (MXDWHIPStreamPusher *, streamPusher); didChangeState (MXDWHIPStreamPusherState, state)Swift usage instance.whipStreamPusher(whipStreamPusher: streamPusher, didChangeState: state)
whipStreamPusher:didFailWithError:
- (void)whipStreamPusher:(MXDWHIPStreamPusher *)streamPusher didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for whipStreamPusher didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters whipStreamPusher (MXDWHIPStreamPusher *, streamPusher); didFailWithError (NSError *, error)Swift usage instance.whipStreamPusher(whipStreamPusher: streamPusher, didFailWithError: nil)
MXDWHIPStreamPusher
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDWHIPStreamPusherDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. endpointURL@property (nonatomic, strong, readonly) NSURL *endpointURL;Endpoint or file URL used by the component. bearerToken@property (nonatomic, copy, nullable, readonly) NSString *bearerToken;Public configuration or state exposed by this API. configuration@property (nonatomic, strong, readonly) MXDWHIPStreamPusherConfiguration *configuration;Public configuration or state exposed by this API. state@property (nonatomic, assign, readonly) MXDWHIPStreamPusherState state;Public configuration or state exposed by this API. pushing@property (nonatomic, assign, readonly, getter=isPushing) BOOL pushing;Read-only runtime state flag.
initWithEndpointURL:bearerToken:
- (instancetype)initWithEndpointURL:(NSURL *)endpointURL bearerToken:(nullable NSString *)bearerToken;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithEndpointURL bearerToken. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithEndpointURL (NSURL *, endpointURL); bearerToken (nullable NSString *, bearerToken)Swift usage let value = MXDWHIPStreamPusher(initWithEndpointURL: url, bearerToken: "value")
initWithEndpointURL:bearerToken:configuration:
- (instancetype)initWithEndpointURL:(NSURL *)endpointURL bearerToken:(nullable NSString *)bearerToken configuration:(nullable MXDWHIPStreamPusherConfiguration *)configuration;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithEndpointURL bearerToken configuration. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithEndpointURL (NSURL *, endpointURL); bearerToken (nullable NSString *, bearerToken); configuration (nullable MXDWHIPStreamPusherConfiguration *, configuration)Swift usage let value = MXDWHIPStreamPusher(initWithEndpointURL: url, bearerToken: "value", configuration: configuration)
start
- (void)start;
Kind Instance method Return voidDetails Starts the component and begins the related capture, server, playback, publish, recording, or discovery workflow. Parameters No parameters. Swift usage instance.start()
stop
- (void)stop;
Kind Instance method Return voidDetails Stops the component and releases or finalizes active workflow resources. Parameters No parameters. Swift usage instance.stop()
appendVideoFrame:presentationTime:
- (void)appendVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Instance method Return voidDetails Appends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized. Parameters appendVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.appendVideoFrame(appendVideoFrame: imageBuffer, presentationTime: 0.0)
appendAudioBuffer:
- (void)appendAudioBuffer:(AVAudioPCMBuffer *)audioBuffer;
Kind Instance method Return voidDetails Appends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized. Parameters appendAudioBuffer (AVAudioPCMBuffer *, audioBuffer)Swift usage instance.appendAudioBuffer(appendAudioBuffer: audioBuffer)
appendAACAccessUnit:sampleRate:channels:objectType:config:
- (void)appendAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData * _Nullable)config;
Kind Instance method Return voidDetails Appends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized. Parameters appendAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData * _Nullable, config)Swift usage instance.appendAACAccessUnit(appendAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)
MXDWHIPStreamPusherConfiguration
Name Declaration Details videoWidth@property (nonatomic, assign) NSInteger videoWidth;Video encoding or rendering configuration. videoHeight@property (nonatomic, assign) NSInteger videoHeight;Video encoding or rendering configuration. videoFPS@property (nonatomic, assign) NSInteger videoFPS;Video encoding or rendering configuration. minVideoBitrateBps@property (nonatomic, assign) NSInteger minVideoBitrateBps;Video encoding or rendering configuration. maxVideoBitrateBps@property (nonatomic, assign) NSInteger maxVideoBitrateBps;Video encoding or rendering configuration. keyframeIntervalSeconds@property (nonatomic, assign) NSTimeInterval keyframeIntervalSeconds;Public configuration or state exposed by this API.
defaultConfiguration
+ (instancetype)defaultConfiguration;
Kind Class method Return instancetypeDetails Creates, discovers, or returns shared information for defaultConfiguration. Call this on the class before creating or configuring an instance. Parameters No parameters. Swift usage let result = MXDWHIPStreamPusherConfiguration.defaultConfiguration()
MXDWebRTCPeerConnectionAdapter.h
WebRTC peer connection adapter for WHIP publishing.
Typedefs
typedef void (^MXDWebRTCPeerConnectionEventHandler)(NSString *message);
MXDWebRTCPeerConnectionAdapter
Name Declaration Details eventHandler@property (nonatomic, copy, nullable) MXDWebRTCPeerConnectionEventHandler eventHandler;Public configuration or state exposed by this API. videoFrameCount@property (nonatomic, assign, readonly) NSUInteger videoFrameCount;Public configuration or state exposed by this API. audioTrackEnabled@property (nonatomic, assign, readonly) BOOL audioTrackEnabled;Audio routing, mute, level, or gain configuration.
initWithTargetVideoWidth:height:fps:minVideoBitrateBps:maxVideoBitrateBps:keyframeIntervalSeconds:
- (instancetype)initWithTargetVideoWidth:(NSInteger)targetVideoWidth height:(NSInteger)targetVideoHeight fps:(NSInteger)targetVideoFPS minVideoBitrateBps:(NSInteger)minVideoBitrateBps maxVideoBitrateBps:(NSInteger)maxVideoBitrateBps keyframeIntervalSeconds:(NSTimeInterval)keyframeIntervalSeconds;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithTargetVideoWidth height fps minVideoBitrateBps maxVideoBitrateBps keyframeIntervalSeconds. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithTargetVideoWidth (NSInteger, targetVideoWidth); height (NSInteger, targetVideoHeight); fps (NSInteger, targetVideoFPS); minVideoBitrateBps (NSInteger, minVideoBitrateBps); maxVideoBitrateBps (NSInteger, maxVideoBitrateBps); keyframeIntervalSeconds (NSTimeInterval, keyframeIntervalSeconds)Swift usage let value = MXDWebRTCPeerConnectionAdapter(initWithTargetVideoWidth: 0, height: 0, fps: 0, minVideoBitrateBps: 0, maxVideoBitrateBps: 0, keyframeIntervalSeconds: "value")
addLocalVideoRenderer:
- (void)addLocalVideoRenderer:(id<RTCVideoRenderer>)renderer;
Kind Instance method Return voidDetails Performs the addLocalVideoRenderer operation on this MiXiD component. Parameters addLocalVideoRenderer (id<RTCVideoRenderer>, renderer)Swift usage instance.addLocalVideoRenderer(addLocalVideoRenderer: renderer)
removeLocalVideoRenderer:
- (void)removeLocalVideoRenderer:(id<RTCVideoRenderer>)renderer;
Kind Instance method Return voidDetails Performs the removeLocalVideoRenderer operation on this MiXiD component. Parameters removeLocalVideoRenderer (id<RTCVideoRenderer>, renderer)Swift usage instance.removeLocalVideoRenderer(removeLocalVideoRenderer: renderer)
MXDWebRTCWHIPServerPeerConnectionAdapter.h
WebRTC peer connection adapter for WHIP ingest.
Typedefs
typedef void (^MXDWebRTCWHIPServerEventHandler)(NSString *message);
MXDWebRTCWHIPServerPeerConnectionAdapter
Name Declaration Details eventHandler@property (nonatomic, copy, nullable) MXDWebRTCWHIPServerEventHandler eventHandler;Public configuration or state exposed by this API. receivedVideoTrackCount@property (nonatomic, assign, readonly) NSUInteger receivedVideoTrackCount;Public configuration or state exposed by this API. receivedAudioTrackCount@property (nonatomic, assign, readonly) NSUInteger receivedAudioTrackCount;Audio routing, mute, level, or gain configuration. generatedCandidateCount@property (nonatomic, assign, readonly) NSUInteger generatedCandidateCount;Public configuration or state exposed by this API.
addRemoteVideoRenderer:
- (void)addRemoteVideoRenderer:(id<RTCVideoRenderer>)renderer;
Kind Instance method Return voidDetails Performs the addRemoteVideoRenderer operation on this MiXiD component. Parameters addRemoteVideoRenderer (id<RTCVideoRenderer>, renderer)Swift usage instance.addRemoteVideoRenderer(addRemoteVideoRenderer: renderer)
removeRemoteVideoRenderer:
- (void)removeRemoteVideoRenderer:(id<RTCVideoRenderer>)renderer;
Kind Instance method Return voidDetails Performs the removeRemoteVideoRenderer operation on this MiXiD component. Parameters removeRemoteVideoRenderer (id<RTCVideoRenderer>, renderer)Swift usage instance.removeRemoteVideoRenderer(removeRemoteVideoRenderer: renderer)
Back to API Reference index