Back to MiXiD API Documentation
Detailed MiXiD XCFramework reference for RTMP. The page starts with practical publishing examples, followed by headers, classes, protocols, Objective-C declarations, parameters, return values, and usage guidance.
RTMP Publishing Examples
Use MXDRTMPStreamPusher when the app already has captured or mixed video and audio frames and needs to publish them to an RTMP endpoint.
Swift
final class RTMPPublisher: NSObject, MXDRTMPStreamPusherDelegate {
private let pusher: MXDRTMPStreamPusher
init(serverURL: URL, streamKey: String) {
let config = MXDRTMPStreamPusherConfiguration.default()
config.videoWidth = 1920
config.videoHeight = 1080
config.videoFPS = 30
config.minVideoBitrateBps = 3_000_000
config.maxVideoBitrateBps = 4_500_000
self.pusher = MXDRTMPStreamPusher(serverURL: serverURL, streamKey: streamKey, 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 rtmpStreamPusherDidConnect() {
print("RTMP connected")
}
func rtmpStreamPusherDidFailWithError(_ error: Error) {
print("RTMP failed: \(error)")
}
}
Objective-C
@interface RTMPPublisher : NSObject <MXDRTMPStreamPusherDelegate>
@property (nonatomic, strong) MXDRTMPStreamPusher *pusher;
@end
@implementation RTMPPublisher
- (instancetype)initWithServerURL:(NSURL *)serverURL streamKey:(NSString *)streamKey {
self = [super init];
if (!self) { return nil; }
MXDRTMPStreamPusherConfiguration *config = [MXDRTMPStreamPusherConfiguration defaultConfiguration];
config.videoWidth = 1920;
config.videoHeight = 1080;
config.videoFPS = 30;
config.minVideoBitrateBps = 3000000;
config.maxVideoBitrateBps = 4500000;
_pusher = [[MXDRTMPStreamPusher alloc] initWithServerURL:serverURL
streamKey:streamKey
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)rtmpStreamPusherDidConnect {
NSLog(@"RTMP connected");
}
- (void)rtmpStreamPusherDidFailWithError:(NSError *)error {
NSLog(@"RTMP failed: %@", error);
}
@end
RTMP
RTMP
MXDRTMPAACPlayer.h
AAC audio helper for RTMP playback.
MXDRTMPAACPlayer
reset
- (void)reset;
Kind Instance method Return voidDetails Resets parser or demuxer state before processing a new stream or segment. Parameters No parameters. Swift usage instance.reset()
configureWithAudioSpecificConfig:sampleRate:channels:error:
- (BOOL)configureWithAudioSpecificConfig:(NSData *)audioSpecificConfig sampleRate:(Float64)sampleRate channels:(UInt32)channels error:(NSError **)error;
Kind Instance method Return BOOLDetails Performs the configureWithAudioSpecificConfig sampleRate channels error operation on this MiXiD component. Parameters configureWithAudioSpecificConfig (NSData *, audioSpecificConfig); sampleRate (Float64, sampleRate); channels (UInt32, channels); error (NSError **, error)Swift usage let result = instance.configureWithAudioSpecificConfig(configureWithAudioSpecificConfig: data, sampleRate: 0.0, channels: channels, error: nil)
enqueueAACSampleData:
- (void)enqueueAACSampleData:(NSData *)sampleData;
Kind Instance method Return voidDetails Queues encoded audio data for playback. Call in timestamp order for stable audio scheduling. Parameters enqueueAACSampleData (NSData *, sampleData)Swift usage instance.enqueueAACSampleData(enqueueAACSampleData: data)
MXDRTMPFLVDemuxer.h
FLV tag demuxer for RTMP payloads.
MXDRTMPFLVDemuxerDelegate Protocol
demuxer:didUpdateVideoConfigWithSPS:pps:naluLengthSize:
- (void)demuxer:(MXDRTMPFLVDemuxer *)demuxer didUpdateVideoConfigWithSPS:(NSData *)sps pps:(NSData *)pps naluLengthSize:(NSUInteger)naluLengthSize;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for demuxer didUpdateVideoConfigWithSPS pps naluLengthSize. Implement this method to observe lifecycle, media output, status, or error events. Parameters demuxer (MXDRTMPFLVDemuxer *, demuxer); didUpdateVideoConfigWithSPS (NSData *, sps); pps (NSData *, pps); naluLengthSize (NSUInteger, naluLengthSize)Swift usage instance.demuxer(demuxer: demuxer, didUpdateVideoConfigWithSPS: data, pps: data, naluLengthSize: 0)
demuxer:didReceiveVideoSampleData:dts:pts:keyframe:
- (void)demuxer:(MXDRTMPFLVDemuxer *)demuxer didReceiveVideoSampleData:(NSData *)sampleData dts:(uint32_t)dts pts:(uint32_t)pts keyframe:(BOOL)isKeyframe;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for demuxer didReceiveVideoSampleData dts pts keyframe. Implement this method to observe lifecycle, media output, status, or error events. Parameters demuxer (MXDRTMPFLVDemuxer *, demuxer); didReceiveVideoSampleData (NSData *, sampleData); dts (uint32_t, dts); pts (uint32_t, pts); keyframe (BOOL, isKeyframe)Swift usage instance.demuxer(demuxer: demuxer, didReceiveVideoSampleData: data, dts: 0, pts: 0, keyframe: "value")
demuxer:didUpdateAudioConfig:sampleRate:channels:
- (void)demuxer:(MXDRTMPFLVDemuxer *)demuxer didUpdateAudioConfig:(NSData *)audioSpecificConfig sampleRate:(Float64)sampleRate channels:(UInt32)channels;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for demuxer didUpdateAudioConfig sampleRate channels. Implement this method to observe lifecycle, media output, status, or error events. Parameters demuxer (MXDRTMPFLVDemuxer *, demuxer); didUpdateAudioConfig (NSData *, audioSpecificConfig); sampleRate (Float64, sampleRate); channels (UInt32, channels)Swift usage instance.demuxer(demuxer: demuxer, didUpdateAudioConfig: data, sampleRate: 0.0, channels: channels)
demuxer:didReceiveAudioSampleData:timestamp:
- (void)demuxer:(MXDRTMPFLVDemuxer *)demuxer didReceiveAudioSampleData:(NSData *)sampleData timestamp:(uint32_t)timestamp;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for demuxer didReceiveAudioSampleData timestamp. Implement this method to observe lifecycle, media output, status, or error events. Parameters demuxer (MXDRTMPFLVDemuxer *, demuxer); didReceiveAudioSampleData (NSData *, sampleData); timestamp (uint32_t, timestamp)Swift usage instance.demuxer(demuxer: demuxer, didReceiveAudioSampleData: data, timestamp: 0)
MXDRTMPFLVDemuxer
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPFLVDemuxerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
reset
- (void)reset;
Kind Instance method Return voidDetails Resets parser or demuxer state before processing a new stream or segment. Parameters No parameters. Swift usage instance.reset()
consumeVideoTagData:timestamp:
- (void)consumeVideoTagData:(NSData *)data timestamp:(uint32_t)timestamp;
Kind Instance method Return voidDetails Performs the consumeVideoTagData timestamp operation on this MiXiD component. Parameters consumeVideoTagData (NSData *, data); timestamp (uint32_t, timestamp)Swift usage instance.consumeVideoTagData(consumeVideoTagData: data, timestamp: 0)
consumeAudioTagData:timestamp:
- (void)consumeAudioTagData:(NSData *)data timestamp:(uint32_t)timestamp;
Kind Instance method Return voidDetails Performs the consumeAudioTagData timestamp operation on this MiXiD component. Parameters consumeAudioTagData (NSData *, data); timestamp (uint32_t, timestamp)Swift usage instance.consumeAudioTagData(consumeAudioTagData: data, timestamp: 0)
MXDRTMPH264Decoder.h
H.264 decoder for RTMP video samples.
MXDRTMPH264DecoderDelegate Protocol
videoDecoder:didDecodeFrame:presentationTime:
- (void)videoDecoder:(MXDRTMPH264Decoder *)decoder didDecodeFrame:(CVPixelBufferRef)pixelBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for videoDecoder didDecodeFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters videoDecoder (MXDRTMPH264Decoder *, decoder); didDecodeFrame (CVPixelBufferRef, pixelBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.videoDecoder(videoDecoder: decoder, didDecodeFrame: imageBuffer, presentationTime: 0.0)
videoDecoder:didFailWithError:
- (void)videoDecoder:(MXDRTMPH264Decoder *)decoder didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for videoDecoder didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters videoDecoder (MXDRTMPH264Decoder *, decoder); didFailWithError (NSError *, error)Swift usage instance.videoDecoder(videoDecoder: decoder, didFailWithError: nil)
MXDRTMPH264Decoder
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPH264DecoderDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
reset
- (void)reset;
Kind Instance method Return voidDetails Resets parser or demuxer state before processing a new stream or segment. Parameters No parameters. Swift usage instance.reset()
configureWithSPS:pps:naluLengthSize:error:
- (BOOL)configureWithSPS:(NSData *)sps pps:(NSData *)pps naluLengthSize:(NSUInteger)naluLengthSize error:(NSError **)error;
Kind Instance method Return BOOLDetails Performs the configureWithSPS pps naluLengthSize error operation on this MiXiD component. Parameters configureWithSPS (NSData *, sps); pps (NSData *, pps); naluLengthSize (NSUInteger, naluLengthSize); error (NSError **, error)Swift usage let result = instance.configureWithSPS(configureWithSPS: data, pps: data, naluLengthSize: 0, error: nil)
decodeSampleData:pts:dts:
- (void)decodeSampleData:(NSData *)sampleData pts:(uint32_t)pts dts:(uint32_t)dts;
Kind Instance method Return voidDetails Decodes encoded video access units into sample buffers for rendering or forwarding. Parameters decodeSampleData (NSData *, sampleData); pts (uint32_t, pts); dts (uint32_t, dts)Swift usage instance.decodeSampleData(decodeSampleData: data, pts: 0, dts: 0)
MXDRTMPPlayerView.h
RTMP playback component.
Enums
MXDRTMPPlayerState
RTMPPlayerStateIdle = 0
RTMPPlayerStateLoading
RTMPPlayerStatePlaying
RTMPPlayerStatePaused
RTMPPlayerStateStopped
RTMPPlayerStateError
MXDRTMPPlayerViewDelegate Protocol
playerView:didChangeState:
- (void)playerView:(MXDRTMPPlayerView *)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 (MXDRTMPPlayerView *, playerView); didChangeState (NSInteger, state)Swift usage instance.playerView(playerView: playerView, didChangeState: 0)
playerView:didFailWithError:
- (void)playerView:(MXDRTMPPlayerView *)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 (MXDRTMPPlayerView *, playerView); didFailWithError (NSError *, error)Swift usage instance.playerView(playerView: playerView, didFailWithError: nil)
MXDRTMPPlayerViewOutputDelegate Protocol
rtmpPlayerView:didOutputVideoFrame:presentationTime:
- (void)rtmpPlayerView:(MXDRTMPPlayerView *)playerView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpPlayerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpPlayerView (MXDRTMPPlayerView *, playerView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.rtmpPlayerView(rtmpPlayerView: playerView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
rtmpPlayerView:didOutputAACAccessUnit:sampleRate:channels:objectType:config:
- (void)rtmpPlayerView:(MXDRTMPPlayerView *)playerView didOutputAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData * _Nullable)config;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpPlayerView didOutputAACAccessUnit sampleRate channels objectType config. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpPlayerView (MXDRTMPPlayerView *, playerView); didOutputAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData * _Nullable, config)Swift usage instance.rtmpPlayerView(rtmpPlayerView: playerView, didOutputAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)
MXDRTMPPlayerView
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPPlayerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. outputDelegate@property (nonatomic, weak, nullable) id<MXDRTMPPlayerViewOutputDelegate> outputDelegate;Receives lifecycle, media output, status, or error callbacks. streamURL@property (nonatomic, copy, nullable, readonly) NSURL *streamURL;Endpoint or file URL used by the component. state@property (nonatomic, assign, readonly) MXDRTMPPlayerState state;Public configuration or state exposed by this API. muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration. 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 = MXDRTMPPlayerView()
initWithStreamURL:
- (instancetype)initWithStreamURL:(NSURL *)streamURL;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithStreamURL. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithStreamURL (NSURL *, streamURL)Swift usage let value = MXDRTMPPlayerView(initWithStreamURL: url)
setStreamURL:autoplay:
- (void)setStreamURL:(nullable NSURL *)streamURL 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 setStreamURL (nullable NSURL *, streamURL); autoplay (BOOL, autoplay)Swift usage instance.setStreamURL(setStreamURL: 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()
pause
- (void)pause;
Kind Instance method Return voidDetails Pauses playback while keeping the object available for a later resume. Parameters No parameters. Swift usage instance.pause()
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()
MXDRTMPServer.h
Lightweight RTMP ingest server.
Enums
MXDRTMPServerMessageKind
RTMPServerMessageKindMetadata
RTMPServerMessageKindAudio
RTMPServerMessageKindVideo
RTMPServerMessageKindCommand
RTMPServerMessageKindUnknown
MXDRTMPServerDelegate Protocol
rtmpServerDidStart:
- (void)rtmpServerDidStart:(MXDRTMPServer *)server;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServerDidStart. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServerDidStart (MXDRTMPServer *, server)Swift usage instance.rtmpServerDidStart(rtmpServerDidStart: server)
rtmpServer:didStopWithError:
- (void)rtmpServer:(MXDRTMPServer *)server didStopWithError:(nullable NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServer didStopWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServer (MXDRTMPServer *, server); didStopWithError (nullable NSError *, error)Swift usage instance.rtmpServer(rtmpServer: server, didStopWithError: nil)
rtmpServer:clientDidConnectFromHost:
- (void)rtmpServer:(MXDRTMPServer *)server clientDidConnectFromHost:(NSString *)host;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServer clientDidConnectFromHost. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServer (MXDRTMPServer *, server); clientDidConnectFromHost (NSString *, host)Swift usage instance.rtmpServer(rtmpServer: server, clientDidConnectFromHost: "value")
rtmpServer:clientDidDisconnectFromHost:
- (void)rtmpServer:(MXDRTMPServer *)server clientDidDisconnectFromHost:(NSString *)host;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServer clientDidDisconnectFromHost. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServer (MXDRTMPServer *, server); clientDidDisconnectFromHost (NSString *, host)Swift usage instance.rtmpServer(rtmpServer: server, clientDidDisconnectFromHost: "value")
rtmpServer:didPublishStream:app:
- (void)rtmpServer:(MXDRTMPServer *)server didPublishStream:(NSString *)streamName app:(nullable NSString *)app;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServer didPublishStream app. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServer (MXDRTMPServer *, server); didPublishStream (NSString *, streamName); app (nullable NSString *, app)Swift usage instance.rtmpServer(rtmpServer: server, didPublishStream: "value", app: "value")
rtmpServer:didReceiveMessageOfKind:data:timestamp:streamName:
- (void)rtmpServer:(MXDRTMPServer *)server didReceiveMessageOfKind:(MXDRTMPServerMessageKind)kind data:(NSData *)data timestamp:(uint32_t)timestamp streamName:(nullable NSString *)streamName;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServer didReceiveMessageOfKind data timestamp streamName. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServer (MXDRTMPServer *, server); didReceiveMessageOfKind (MXDRTMPServerMessageKind, kind); data (NSData *, data); timestamp (uint32_t, timestamp); streamName (nullable NSString *, streamName)Swift usage instance.rtmpServer(rtmpServer: server, didReceiveMessageOfKind: kind, data: data, timestamp: 0, streamName: "value")
MXDRTMPServer
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPServerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. port@property (nonatomic, readonly) uint16_t port;Public configuration or state exposed by this API. running@property (nonatomic, readonly, getter=isRunning) BOOL running;Read-only runtime state flag. allowedAppName@property (nonatomic, copy, nullable) NSString *allowedAppName;Public configuration or state exposed by this API.
initWithPort:
- (instancetype)initWithPort:(uint16_t)port NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPort. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPort (uint16_t, port)Swift usage let value = MXDRTMPServer(initWithPort: 0)
start:
- (BOOL)start:(NSError * _Nullable * _Nullable)error;
Kind Instance method Return BOOLDetails Performs the start operation on this MiXiD component. Parameters start (NSError * _Nullable * _Nullable, error)Swift usage let result = instance.start(start: nil)
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()
MXDRTMPServerView.h
RTMP ingest and preview component.
Enums
MXDRTMPServerViewState
RTMPServerViewStateIdle = 0
RTMPServerViewStateListening
RTMPServerViewStateReceiving
RTMPServerViewStateStopped
RTMPServerViewStateError
MXDRTMPServerViewDelegate Protocol
playerView:didChangeState:
- (void)playerView:(MXDRTMPServerView *)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 (MXDRTMPServerView *, playerView); didChangeState (NSInteger, state)Swift usage instance.playerView(playerView: playerView, didChangeState: 0)
playerView:didFailWithError:
- (void)playerView:(MXDRTMPServerView *)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 (MXDRTMPServerView *, playerView); didFailWithError (NSError *, error)Swift usage instance.playerView(playerView: playerView, didFailWithError: nil)
MXDRTMPServerViewOutputDelegate Protocol
rtmpServerView:didOutputVideoFrame:presentationTime:
- (void)rtmpServerView:(MXDRTMPServerView *)serverView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServerView (MXDRTMPServerView *, serverView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.rtmpServerView(rtmpServerView: serverView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
rtmpServerView:didOutputAACAccessUnit:sampleRate:channels:objectType:config:
- (void)rtmpServerView:(MXDRTMPServerView *)serverView didOutputAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData * _Nullable)config;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpServerView didOutputAACAccessUnit sampleRate channels objectType config. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpServerView (MXDRTMPServerView *, serverView); didOutputAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData * _Nullable, config)Swift usage instance.rtmpServerView(rtmpServerView: serverView, didOutputAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)
MXDRTMPServerView
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPServerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. outputDelegate@property (nonatomic, weak, nullable) id<MXDRTMPServerViewOutputDelegate> 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) MXDRTMPServerViewState state;Public configuration or state exposed by this API. muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration. 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 = MXDRTMPServerView()
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 = MXDRTMPServerView(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()
MXDRTMPStreamClient.h
RTMP client transport.
Enums
MXDRTMPStreamClientState
RTMPStreamClientStateIdle = 0
RTMPStreamClientStateConnecting
RTMPStreamClientStateHandshaking
RTMPStreamClientStateConnected
RTMPStreamClientStatePlaying
RTMPStreamClientStateStopped
RTMPStreamClientStateError
MXDRTMPStreamClientDelegate Protocol
streamClient:didChangeState:
- (void)streamClient:(MXDRTMPStreamClient *)client didChangeState:(MXDRTMPStreamClientState)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClient didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClient (MXDRTMPStreamClient *, client); didChangeState (MXDRTMPStreamClientState, state)Swift usage instance.streamClient(streamClient: client, didChangeState: state)
streamClient:didReceiveMetadata:
- (void)streamClient:(MXDRTMPStreamClient *)client didReceiveMetadata:(NSDictionary<NSString *, id> *)metadata;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClient didReceiveMetadata. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClient (MXDRTMPStreamClient *, client); didReceiveMetadata (NSDictionary<NSString *, id> *, metadata)Swift usage instance.streamClient(streamClient: client, didReceiveMetadata: "value")
streamClient:didReceiveAudioPacket:timestamp:
- (void)streamClient:(MXDRTMPStreamClient *)client didReceiveAudioPacket:(NSData *)audioPacket timestamp:(uint32_t)timestamp;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClient didReceiveAudioPacket timestamp. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClient (MXDRTMPStreamClient *, client); didReceiveAudioPacket (NSData *, audioPacket); timestamp (uint32_t, timestamp)Swift usage instance.streamClient(streamClient: client, didReceiveAudioPacket: data, timestamp: 0)
streamClient:didReceiveVideoPacket:timestamp:
- (void)streamClient:(MXDRTMPStreamClient *)client didReceiveVideoPacket:(NSData *)videoPacket timestamp:(uint32_t)timestamp;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClient didReceiveVideoPacket timestamp. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClient (MXDRTMPStreamClient *, client); didReceiveVideoPacket (NSData *, videoPacket); timestamp (uint32_t, timestamp)Swift usage instance.streamClient(streamClient: client, didReceiveVideoPacket: data, timestamp: 0)
streamClientDidReceiveFirstMediaPacket:
- (void)streamClientDidReceiveFirstMediaPacket:(MXDRTMPStreamClient *)client;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClientDidReceiveFirstMediaPacket. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClientDidReceiveFirstMediaPacket (MXDRTMPStreamClient *, client)Swift usage instance.streamClientDidReceiveFirstMediaPacket(streamClientDidReceiveFirstMediaPacket: client)
streamClient:didFailWithError:
- (void)streamClient:(MXDRTMPStreamClient *)client didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for streamClient didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters streamClient (MXDRTMPStreamClient *, client); didFailWithError (NSError *, error)Swift usage instance.streamClient(streamClient: client, didFailWithError: nil)
MXDRTMPStreamClient
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPStreamClientDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. streamURL@property (nonatomic, copy, readonly) NSURL *streamURL;Endpoint or file URL used by the component. state@property (nonatomic, assign, readonly) MXDRTMPStreamClientState state;Public configuration or state exposed by this API.
initWithURL:
- (instancetype)initWithURL:(NSURL *)url;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithURL. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithURL (NSURL *, url)Swift usage let value = MXDRTMPStreamClient(initWithURL: url)
connect
- (void)connect;
Kind Instance method Return voidDetails Connects to a selected source or endpoint and starts receiving media when available. Parameters No parameters. Swift usage instance.connect()
disconnect
- (void)disconnect;
Kind Instance method Return voidDetails Disconnects from the current source and stops receiving media from that connection. Parameters No parameters. Swift usage instance.disconnect()
MXDRTMPStreamPusher.h
RTMP publishing component.
MXDRTMPStreamPusherDelegate Protocol
rtmpStreamPusherDidConnect
- (void)rtmpStreamPusherDidConnect;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpStreamPusherDidConnect. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.rtmpStreamPusherDidConnect()
rtmpStreamPusherDidStop
- (void)rtmpStreamPusherDidStop;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpStreamPusherDidStop. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.rtmpStreamPusherDidStop()
rtmpStreamPusherDidFailWithError:
- (void)rtmpStreamPusherDidFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpStreamPusherDidFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpStreamPusherDidFailWithError (NSError *, error)Swift usage instance.rtmpStreamPusherDidFailWithError(rtmpStreamPusherDidFailWithError: nil)
rtmpStreamPusherDidUpdateStatus:
- (void)rtmpStreamPusherDidUpdateStatus:(NSString *)status;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for rtmpStreamPusherDidUpdateStatus. Implement this method to observe lifecycle, media output, status, or error events. Parameters rtmpStreamPusherDidUpdateStatus (NSString *, status)Swift usage instance.rtmpStreamPusherDidUpdateStatus(rtmpStreamPusherDidUpdateStatus: "value")
MXDRTMPStreamPusher
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDRTMPStreamPusherDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. pushing@property (nonatomic, assign, readonly, getter=isPushing) BOOL pushing;Read-only runtime state flag. configuration@property (nonatomic, strong, readonly) MXDRTMPStreamPusherConfiguration *configuration;Public configuration or state exposed by this API.
initWithServerURL:streamKey:
- (instancetype)initWithServerURL:(NSURL *)serverURL streamKey:(NSString *)streamKey;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithServerURL streamKey. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithServerURL (NSURL *, serverURL); streamKey (NSString *, streamKey)Swift usage let value = MXDRTMPStreamPusher(initWithServerURL: url, streamKey: "value")
initWithServerURL:streamKey:configuration:
- (instancetype)initWithServerURL:(NSURL *)serverURL streamKey:(NSString *)streamKey configuration:(nullable MXDRTMPStreamPusherConfiguration *)configuration;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithServerURL streamKey configuration. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithServerURL (NSURL *, serverURL); streamKey (NSString *, streamKey); configuration (nullable MXDRTMPStreamPusherConfiguration *, configuration)Swift usage let value = MXDRTMPStreamPusher(initWithServerURL: url, streamKey: "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)
MXDRTMPStreamPusherConfiguration
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 = MXDRTMPStreamPusherConfiguration.defaultConfiguration()
MXDSRTMPEGTSDemuxer.h
MPEG-TS demuxer for SRT payloads.
MXDSRTMPEGTSDemuxer
appendDataAndExtractPackets:
- (NSArray<MXDSRTElementaryStreamPacket *> *)appendDataAndExtractPackets:(NSData *)data;
Kind Instance method Return NSArray<MXDSRTElementaryStreamPacket *> *Details Appends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized. Parameters appendDataAndExtractPackets (NSData *, data)Swift usage let result = instance.appendDataAndExtractPackets(appendDataAndExtractPackets: data)
reset
- (void)reset;
Kind Instance method Return voidDetails Resets parser or demuxer state before processing a new stream or segment. Parameters No parameters. Swift usage instance.reset()
Back to API Reference index