Back to MiXiD API Documentation
Detailed MiXiD XCFramework reference for HLS. Read through each header, class, protocol, and function section to inspect Objective-C declarations, parameters, return values, and usage guidance.
HLS Publishing Examples
Use MXDHLSStreamPusher to publish a live HLS playlist and MPEG-TS segments to an HTTP endpoint or a local file URL.
Swift
final class HLSPublisher: NSObject, MXDHLSStreamPusherDelegate {
private let pusher: MXDHLSStreamPusher
init(publishingURL: URL) {
let config = MXDHLSStreamPusherConfiguration.default()
config.videoWidth = 1920
config.videoHeight = 1080
config.videoFPS = 30
config.videoCodec = .h264
config.minVideoBitrateBps = 3_000_000
config.maxVideoBitrateBps = 5_000_000
config.segmentDurationSeconds = 2
config.playlistWindowSize = 6
config.playlistFileName = "live.m3u8"
config.segmentFileNamePrefix = "segment"
config.uploadHTTPMethod = "PUT"
self.pusher = MXDHLSStreamPusher(publishingURL: publishingURL, 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 hlsStreamPusherDidConnect() {
print("HLS publishing started")
}
func hlsStreamPusherDidFailWithError(_ error: Error) {
print("HLS failed: \(error)")
}
}
Objective-C
@interface HLSPublisher : NSObject <MXDHLSStreamPusherDelegate>
@property (nonatomic, strong) MXDHLSStreamPusher *pusher;
@end
@implementation HLSPublisher
- (instancetype)initWithPublishingURL:(NSURL *)publishingURL {
self = [super init];
if (!self) { return nil; }
MXDHLSStreamPusherConfiguration *config = [MXDHLSStreamPusherConfiguration defaultConfiguration];
config.videoWidth = 1920;
config.videoHeight = 1080;
config.videoFPS = 30;
config.videoCodec = MXDHLSVideoCodecH264;
config.minVideoBitrateBps = 3000000;
config.maxVideoBitrateBps = 5000000;
config.segmentDurationSeconds = 2;
config.playlistWindowSize = 6;
config.playlistFileName = @"live.m3u8";
config.segmentFileNamePrefix = @"segment";
config.uploadHTTPMethod = @"PUT";
_pusher = [[MXDHLSStreamPusher alloc] initWithPublishingURL:publishingURL 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)hlsStreamPusherDidConnect { NSLog(@"HLS publishing started"); }
- (void)hlsStreamPusherDidFailWithError:(NSError *)error { NSLog(@"HLS failed: %@", error); }
@end
HLS
HLS
MXDHLSAnnexBParser.h
Annex B H.264 parser for HLS streams.
MXDHLSAnnexBParser
appendDataAndExtractNALUnits:
- (NSArray<NSData *> *)appendDataAndExtractNALUnits:(NSData *)data;
Kind Instance method Return NSArray<NSData *> *Details Appends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized. Parameters appendDataAndExtractNALUnits (NSData *, data)Swift usage let result = instance.appendDataAndExtractNALUnits(appendDataAndExtractNALUnits: 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()
MXDHLSAudioPlayer.h
AAC audio renderer for HLS playback.
MXDHLSAudioPlayerDelegate Protocol
audioPlayer:didFailWithError:
- (void)audioPlayer:(MXDHLSAudioPlayer *)audioPlayer didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for audioPlayer didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters audioPlayer (MXDHLSAudioPlayer *, audioPlayer); didFailWithError (NSError *, error)Swift usage instance.audioPlayer(audioPlayer: audioPlayer, didFailWithError: nil)
MXDHLSAudioPlayer
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSAudioPlayerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration. minimumPCMPrerollChunks@property (nonatomic, assign) NSUInteger minimumPCMPrerollChunks;Public configuration or state exposed by this API.
enqueueADTSData:presentationTimeStamp:
- (void)enqueueADTSData:(NSData *)data presentationTimeStamp:(CMTime)presentationTimeStamp;
Kind Instance method Return voidDetails Queues encoded audio data for playback. Call in timestamp order for stable audio scheduling. Parameters enqueueADTSData (NSData *, data); presentationTimeStamp (CMTime, presentationTimeStamp)Swift usage instance.enqueueADTSData(enqueueADTSData: data, presentationTimeStamp: 0.0)
finishEnqueuedSegment
- (void)finishEnqueuedSegment;
Kind Instance method Return voidDetails Performs the finishEnqueuedSegment operation on this MiXiD component. Parameters No parameters. Swift usage instance.finishEnqueuedSegment()
flush
- (void)flush;
Kind Instance method Return voidDetails Clears queued decoder/player state so future media starts from a clean point. Parameters No parameters. Swift usage instance.flush()
MXDHLSMPEGTSDemuxer.h
MPEG-TS demuxer for HLS payloads.
MXDHLSMPEGTSDemuxer
appendDataAndExtractPackets:
- (NSArray<MXDHLSMPEGTSStreamPacket *> *)appendDataAndExtractPackets:(NSData *)data;
Kind Instance method Return NSArray<MXDHLSMPEGTSStreamPacket *> *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()
MXDHLSMPEGTSStreamPacket.h
Elementary stream packet model.
Enums
MXDHLSMPEGTSStreamKind
MXDHLSMPEGTSStreamKindVideo = 0
MXDHLSMPEGTSStreamKindAudio = 1
MXDHLSMPEGTSStreamPacket
Name Declaration Details payload@property (nonatomic, strong, readonly) NSData *payload;Public configuration or state exposed by this API. presentationTimeStamp@property (nonatomic, assign, readonly) CMTime presentationTimeStamp;Public configuration or state exposed by this API. streamKind@property (nonatomic, assign, readonly) MXDHLSMPEGTSStreamKind streamKind;Public configuration or state exposed by this API. streamType@property (nonatomic, assign, readonly) uint8_t streamType;Public configuration or state exposed by this API.
initWithPayload:presentationTimeStamp:streamKind:streamType:
- (instancetype)initWithPayload:(NSData *)payload presentationTimeStamp:(CMTime)presentationTimeStamp streamKind:(MXDHLSMPEGTSStreamKind)streamKind streamType:(uint8_t)streamType;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPayload presentationTimeStamp streamKind streamType. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPayload (NSData *, payload); presentationTimeStamp (CMTime, presentationTimeStamp); streamKind (MXDHLSMPEGTSStreamKind, streamKind); streamType (uint8_t, streamType)Swift usage let value = MXDHLSMPEGTSStreamPacket(initWithPayload: data, presentationTimeStamp: 0.0, streamKind: streamKind, streamType: streamType)
MXDHLSPlayerView.h
HLS playback source component.
Enums
MXDHLSPlayerState
HLSPlayerStateIdle = 0
HLSPlayerStateLoading
HLSPlayerStatePlaying
HLSPlayerStatePaused
HLSPlayerStateStopped
HLSPlayerStateError
MXDHLSPlayerViewDelegate Protocol
hlsPlayerView:didChangeState:
- (void)hlsPlayerView:(MXDHLSPlayerView *)playerView didChangeState:(MXDHLSPlayerState)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsPlayerView didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsPlayerView (MXDHLSPlayerView *, playerView); didChangeState (MXDHLSPlayerState, state)Swift usage instance.hlsPlayerView(hlsPlayerView: playerView, didChangeState: state)
hlsPlayerView:didFailWithError:
- (void)hlsPlayerView:(MXDHLSPlayerView *)playerView didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsPlayerView didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsPlayerView (MXDHLSPlayerView *, playerView); didFailWithError (NSError *, error)Swift usage instance.hlsPlayerView(hlsPlayerView: playerView, didFailWithError: nil)
MXDHLSPlayerViewOutputDelegate Protocol
hlsPlayerView:didOutputVideoFrame:presentationTime:
- (void)hlsPlayerView:(MXDHLSPlayerView *)playerView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsPlayerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsPlayerView (MXDHLSPlayerView *, playerView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.hlsPlayerView(hlsPlayerView: playerView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
hlsPlayerView:didOutputAACAccessUnit:sampleRate:channels:objectType:config:
- (void)hlsPlayerView:(MXDHLSPlayerView *)playerView didOutputAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData *)config;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsPlayerView didOutputAACAccessUnit sampleRate channels objectType config. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsPlayerView (MXDHLSPlayerView *, playerView); didOutputAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData *, config)Swift usage instance.hlsPlayerView(hlsPlayerView: playerView, didOutputAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)
MXDHLSPlayerView
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSPlayerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. outputDelegate@property (nonatomic, weak, nullable) id<MXDHLSPlayerViewOutputDelegate> 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) MXDHLSPlayerState state;Public configuration or state exposed by this API. muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration. slotIndex@property (nonatomic, assign) NSInteger slotIndex;Public configuration or state exposed by this API. audioPrerollChunkCount@property (nonatomic, assign) NSUInteger audioPrerollChunkCount;Audio routing, mute, level, or gain configuration.
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 = MXDHLSPlayerView()
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 = MXDHLSPlayerView(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()
appendMPEGTSData:
- (void)appendMPEGTSData:(NSData *)data;
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 appendMPEGTSData (NSData *, data)Swift usage instance.appendMPEGTSData(appendMPEGTSData: data)
MXDHLSServerView.h
HLS ingest source component.
Enums
MXDHLSServerViewState
HLSServerViewStateIdle = 0
HLSServerViewStateListening
HLSServerViewStateReceiving
HLSServerViewStateStopped
HLSServerViewStateError
MXDHLSServerViewDelegate Protocol
hlsServerView:didChangeState:
- (void)hlsServerView:(MXDHLSServerView *)serverView didChangeState:(MXDHLSServerViewState)state;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsServerView didChangeState. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsServerView (MXDHLSServerView *, serverView); didChangeState (MXDHLSServerViewState, state)Swift usage instance.hlsServerView(hlsServerView: serverView, didChangeState: state)
hlsServerView:didFailWithError:
- (void)hlsServerView:(MXDHLSServerView *)serverView didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsServerView didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsServerView (MXDHLSServerView *, serverView); didFailWithError (NSError *, error)Swift usage instance.hlsServerView(hlsServerView: serverView, didFailWithError: nil)
hlsServerViewDidStartNewSession:
- (void)hlsServerViewDidStartNewSession:(MXDHLSServerView *)serverView;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsServerViewDidStartNewSession. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsServerViewDidStartNewSession (MXDHLSServerView *, serverView)Swift usage instance.hlsServerViewDidStartNewSession(hlsServerViewDidStartNewSession: serverView)
MXDHLSServerViewOutputDelegate Protocol
hlsServerView:didOutputVideoFrame:presentationTime:
- (void)hlsServerView:(MXDHLSServerView *)serverView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsServerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsServerView (MXDHLSServerView *, serverView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)Swift usage instance.hlsServerView(hlsServerView: serverView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
hlsServerView:didOutputAACAccessUnit:sampleRate:channels:objectType:config:
- (void)hlsServerView:(MXDHLSServerView *)serverView didOutputAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData *)config;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsServerView didOutputAACAccessUnit sampleRate channels objectType config. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsServerView (MXDHLSServerView *, serverView); didOutputAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData *, config)Swift usage instance.hlsServerView(hlsServerView: serverView, didOutputAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)
MXDHLSServerView
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSServerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. outputDelegate@property (nonatomic, weak, nullable) id<MXDHLSServerViewOutputDelegate> 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) MXDHLSServerViewState state;Public configuration or state exposed by this API. muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration. 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 = MXDHLSServerView()
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 = MXDHLSServerView(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()
MXDHLSStreamPusher.h
HLS publishing component.
Enums
MXDHLSVideoCodec
MXDHLSVideoCodecH264 = 0
MXDHLSVideoCodecHEVC = 1
MXDHLSStreamPusherDelegate Protocol
hlsStreamPusherDidConnect
- (void)hlsStreamPusherDidConnect;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamPusherDidConnect. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.hlsStreamPusherDidConnect()
hlsStreamPusherDidStop
- (void)hlsStreamPusherDidStop;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamPusherDidStop. Implement this method to observe lifecycle, media output, status, or error events. Parameters No parameters. Swift usage instance.hlsStreamPusherDidStop()
hlsStreamPusherDidFailWithError:
- (void)hlsStreamPusherDidFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamPusherDidFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamPusherDidFailWithError (NSError *, error)Swift usage instance.hlsStreamPusherDidFailWithError(hlsStreamPusherDidFailWithError: nil)
hlsStreamPusherDidUpdateStatus:
- (void)hlsStreamPusherDidUpdateStatus:(NSString *)status;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamPusherDidUpdateStatus. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamPusherDidUpdateStatus (NSString *, status)Swift usage instance.hlsStreamPusherDidUpdateStatus(hlsStreamPusherDidUpdateStatus: "value")
MXDHLSStreamPusher
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSStreamPusherDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. pushing@property (nonatomic, assign, readonly, getter=isPushing) BOOL pushing;Read-only runtime state flag. publishingURL@property (nonatomic, strong, readonly) NSURL *publishingURL;Endpoint or file URL used by the component. configuration@property (nonatomic, strong, readonly) MXDHLSStreamPusherConfiguration *configuration;Public configuration or state exposed by this API.
initWithPublishingURL:
- (instancetype)initWithPublishingURL:(NSURL *)publishingURL;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPublishingURL. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPublishingURL (NSURL *, publishingURL)Swift usage let value = MXDHLSStreamPusher(initWithPublishingURL: url)
initWithPublishingURL:configuration:
- (instancetype)initWithPublishingURL:(NSURL *)publishingURL configuration:(nullable MXDHLSStreamPusherConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
Kind Instance method Return instancetypeDetails Initializes the receiver for initWithPublishingURL configuration. Use this to provide required URLs, ports, names, peer connections, or configuration objects. Parameters initWithPublishingURL (NSURL *, publishingURL); configuration (nullable MXDHLSStreamPusherConfiguration *, configuration)Swift usage let value = MXDHLSStreamPusher(initWithPublishingURL: url, 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)
MXDHLSStreamPusherConfiguration
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. videoCodec@property (nonatomic, assign) MXDHLSVideoCodec videoCodec;Public configuration or state exposed by this API. 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. segmentDurationSeconds@property (nonatomic, assign) NSTimeInterval segmentDurationSeconds;Public configuration or state exposed by this API. playlistWindowSize@property (nonatomic, assign) NSUInteger playlistWindowSize;Public configuration or state exposed by this API. playlistFileName@property (nonatomic, copy) NSString *playlistFileName;Public configuration or state exposed by this API. segmentFileNamePrefix@property (nonatomic, copy) NSString *segmentFileNamePrefix;Public configuration or state exposed by this API. uploadHTTPMethod@property (nonatomic, copy) NSString *uploadHTTPMethod;Public configuration or state exposed by this API. uploadTimeoutSeconds@property (nonatomic, assign) NSTimeInterval uploadTimeoutSeconds;Network transport reliability and buffering configuration.
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 = MXDHLSStreamPusherConfiguration.defaultConfiguration()
MXDHLSStreamServer.h
Lightweight HTTP HLS ingest server.
MXDHLSStreamServerDelegate Protocol
hlsStreamServerDidStart:
- (void)hlsStreamServerDidStart:(MXDHLSStreamServer *)server;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamServerDidStart. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamServerDidStart (MXDHLSStreamServer *, server)Swift usage instance.hlsStreamServerDidStart(hlsStreamServerDidStart: server)
hlsStreamServer:didStopWithError:
- (void)hlsStreamServer:(MXDHLSStreamServer *)server didStopWithError:(nullable NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamServer didStopWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamServer (MXDHLSStreamServer *, server); didStopWithError (nullable NSError *, error)Swift usage instance.hlsStreamServer(hlsStreamServer: server, didStopWithError: nil)
hlsStreamServer:didReceivePlaylistAtPath:
- (void)hlsStreamServer:(MXDHLSStreamServer *)server didReceivePlaylistAtPath:(NSString *)path;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamServer didReceivePlaylistAtPath. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamServer (MXDHLSStreamServer *, server); didReceivePlaylistAtPath (NSString *, path)Swift usage instance.hlsStreamServer(hlsStreamServer: server, didReceivePlaylistAtPath: "value")
hlsStreamServer:didFailWithError:
- (void)hlsStreamServer:(MXDHLSStreamServer *)server didFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for hlsStreamServer didFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters hlsStreamServer (MXDHLSStreamServer *, server); didFailWithError (NSError *, error)Swift usage instance.hlsStreamServer(hlsStreamServer: server, didFailWithError: nil)
MXDHLSStreamServer
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSStreamServerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks. serverURL@property (nonatomic, strong, readonly) NSURL *serverURL;Endpoint or file URL used by the component. 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. playlistPath@property (nonatomic, copy, readonly) NSString *playlistPath;Public configuration or state exposed by this API.
initWithServerURL:
- (instancetype)initWithServerURL:(NSURL *)serverURL NS_DESIGNATED_INITIALIZER;
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 = MXDHLSStreamServer(initWithServerURL: url)
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()
localURLForPath:
- (nullable NSURL *)localURLForPath:(NSString *)path;
Kind Instance method Return nullable NSURL *Details Returns derived state, buffered data, preview information, or available source metadata from the component. Parameters localURLForPath (NSString *, path)Swift usage let result = instance.localURLForPath(localURLForPath: "value")
storedDataForPath:
- (nullable NSData *)storedDataForPath:(NSString *)path;
Kind Instance method Return nullable NSData *Details Returns derived state, buffered data, preview information, or available source metadata from the component. Parameters storedDataForPath (NSString *, path)Swift usage let result = instance.storedDataForPath(storedDataForPath: "value")
MXDHLSVideoDecoder.h
H.264 and HEVC video decoder for HLS streams.
MXDHLSVideoDecoderDelegate Protocol
videoDecoderDidDecodeSampleBuffer:
- (void)videoDecoderDidDecodeSampleBuffer:(CMSampleBufferRef)sampleBuffer;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for videoDecoderDidDecodeSampleBuffer. Implement this method to observe lifecycle, media output, status, or error events. Parameters videoDecoderDidDecodeSampleBuffer (CMSampleBufferRef, sampleBuffer)Swift usage instance.videoDecoderDidDecodeSampleBuffer(videoDecoderDidDecodeSampleBuffer: sampleBuffer)
videoDecoderDidFailWithError:
- (void)videoDecoderDidFailWithError:(NSError *)error;
Kind Delegate / protocol callback Return voidDetails Callback invoked by MiXiD for videoDecoderDidFailWithError. Implement this method to observe lifecycle, media output, status, or error events. Parameters videoDecoderDidFailWithError (NSError *, error)Swift usage instance.videoDecoderDidFailWithError(videoDecoderDidFailWithError: nil)
MXDHLSVideoDecoder
Name Declaration Details delegate@property (nonatomic, weak, nullable) id<MXDHLSVideoDecoderDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
decodeAccessUnitNALUnits:presentationTimeStamp:
- (void)decodeAccessUnitNALUnits:(NSArray<NSData *> *)nalUnits presentationTimeStamp:(CMTime)presentationTimeStamp;
Kind Instance method Return voidDetails Decodes encoded video access units into sample buffers for rendering or forwarding. Parameters decodeAccessUnitNALUnits (NSArray<NSData *> *, nalUnits); presentationTimeStamp (CMTime, presentationTimeStamp)Swift usage instance.decodeAccessUnitNALUnits(decodeAccessUnitNALUnits: data, presentationTimeStamp: 0.0)
decodeAccessUnitNALUnits:presentationTimeStamp:videoStreamType:
- (void)decodeAccessUnitNALUnits:(NSArray<NSData *> *)nalUnits presentationTimeStamp:(CMTime)presentationTimeStamp videoStreamType:(uint8_t)videoStreamType;
Kind Instance method Return voidDetails Decodes encoded video access units into sample buffers for rendering or forwarding. Parameters decodeAccessUnitNALUnits (NSArray<NSData *> *, nalUnits); presentationTimeStamp (CMTime, presentationTimeStamp); videoStreamType (uint8_t, videoStreamType)Swift usage instance.decodeAccessUnitNALUnits(decodeAccessUnitNALUnits: data, presentationTimeStamp: 0.0, videoStreamType: videoStreamType)
flush
- (void)flush;
Kind Instance method Return voidDetails Clears queued decoder/player state so future media starts from a clean point. Parameters No parameters. Swift usage instance.flush()
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