MiXiD API Reference: SRT

Back to MiXiD API Documentation

Detailed MiXiD XCFramework reference for SRT. Read through each header, class, protocol, and function section to inspect Objective-C declarations, parameters, return values, and usage guidance.

SRT Publishing Examples

Use MXDSRTStreamPusher with an MXDSRTPlayerConfiguration transport object to publish encoded MiXiD video and audio over SRT.

Swift

final class SRTPublisher: NSObject, MXDSRTStreamPusherDelegate {
    private let pusher: MXDSRTStreamPusher

    init(streamURL: URL, streamID: String? = nil, passphrase: String? = nil) {
        let transport = MXDSRTPlayerConfiguration(streamURL: streamURL)
        transport.streamID = streamID
        transport.passphrase = passphrase
        transport.latencyInMilliseconds = 120
        transport.payloadFormat = HVSRTStreamPayloadFormatMPEGTS

        let config = MXDSRTStreamPusherConfiguration.default()
        config.videoWidth = 1920
        config.videoHeight = 1080
        config.videoFPS = 30
        config.videoCodec = .h264
        config.minVideoBitrateBps = 3_000_000
        config.maxVideoBitrateBps = 5_000_000

        self.pusher = MXDSRTStreamPusher(transportConfiguration: transport, 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 srtStreamPusherDidConnect() {
        print("SRT connected")
    }

    func srtStreamPusherDidFailWithError(_ error: Error) {
        print("SRT failed: \(error)")
    }
}

Objective-C

@interface SRTPublisher : NSObject <MXDSRTStreamPusherDelegate>
@property (nonatomic, strong) MXDSRTStreamPusher *pusher;
@end

@implementation SRTPublisher

- (instancetype)initWithStreamURL:(NSURL *)streamURL streamID:(NSString *)streamID passphrase:(NSString *)passphrase {
    self = [super init];
    if (!self) { return nil; }

    MXDSRTPlayerConfiguration *transport = [[MXDSRTPlayerConfiguration alloc] initWithStreamURL:streamURL];
    transport.streamID = streamID;
    transport.passphrase = passphrase;
    transport.latencyInMilliseconds = 120;
    transport.payloadFormat = HVSRTStreamPayloadFormatMPEGTS;

    MXDSRTStreamPusherConfiguration *config = [MXDSRTStreamPusherConfiguration defaultConfiguration];
    config.videoWidth = 1920;
    config.videoHeight = 1080;
    config.videoFPS = 30;
    config.videoCodec = MXDSRTStreamPusherVideoCodecH264;
    config.minVideoBitrateBps = 3000000;
    config.maxVideoBitrateBps = 5000000;

    _pusher = [[MXDSRTStreamPusher alloc] initWithTransportConfiguration:transport 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)srtStreamPusherDidConnect { NSLog(@"SRT connected"); }
- (void)srtStreamPusherDidFailWithError:(NSError *)error { NSLog(@"SRT failed: %@", error); }

@end

SRT

SRT

MXDHaivisionSRTPlayer.h

Convenience umbrella for SRT playback APIs.

MXDSRTAnnexBParser.h

Annex B H.264 parser for SRT streams.

MXDSRTAnnexBParser

appendDataAndExtractNALUnits:
- (NSArray<NSData *> *)appendDataAndExtractNALUnits:(NSData *)data;
KindInstance method
ReturnNSArray<NSData *> *
DetailsAppends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized.
ParametersappendDataAndExtractNALUnits (NSData *, data)
Swift usagelet result = instance.appendDataAndExtractNALUnits(appendDataAndExtractNALUnits: data)
reset
- (void)reset;
KindInstance method
Returnvoid
DetailsResets parser or demuxer state before processing a new stream or segment.
ParametersNo parameters.
Swift usageinstance.reset()

MXDSRTAudioPlayer.h

AAC audio renderer for SRT playback.

MXDSRTAudioPlayerDelegate Protocol

audioPlayer:didFailWithError:
- (void)audioPlayer:(MXDSRTAudioPlayer *)audioPlayer didFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for audioPlayer didFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParametersaudioPlayer (MXDSRTAudioPlayer *, audioPlayer); didFailWithError (NSError *, error)
Swift usageinstance.audioPlayer(audioPlayer: audioPlayer, didFailWithError: nil)

MXDSRTAudioPlayer

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTAudioPlayerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
muted@property (nonatomic, assign, getter=isMuted) BOOL muted;Audio routing, mute, level, or gain configuration.
enqueueADTSData:presentationTimeStamp:
- (void)enqueueADTSData:(NSData *)data presentationTimeStamp:(CMTime)presentationTimeStamp;
KindInstance method
Returnvoid
DetailsQueues encoded audio data for playback. Call in timestamp order for stable audio scheduling.
ParametersenqueueADTSData (NSData *, data); presentationTimeStamp (CMTime, presentationTimeStamp)
Swift usageinstance.enqueueADTSData(enqueueADTSData: data, presentationTimeStamp: 0.0)
flush
- (void)flush;
KindInstance method
Returnvoid
DetailsClears queued decoder/player state so future media starts from a clean point.
ParametersNo parameters.
Swift usageinstance.flush()

MXDSRTElementaryStreamPacket.h

Elementary stream packet model.

Enums

MXDSRTElementaryStreamKind

  • HVSRTElementaryStreamKindVideo = 0
  • HVSRTElementaryStreamKindAudio = 1

MXDSRTElementaryStreamPacket

NameDeclarationDetails
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) MXDSRTElementaryStreamKind 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:(MXDSRTElementaryStreamKind)streamKind streamType:(uint8_t)streamType;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithPayload presentationTimeStamp streamKind streamType. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithPayload (NSData *, payload); presentationTimeStamp (CMTime, presentationTimeStamp); streamKind (MXDSRTElementaryStreamKind, streamKind); streamType (uint8_t, streamType)
Swift usagelet value = MXDSRTElementaryStreamPacket(initWithPayload: data, presentationTimeStamp: 0.0, streamKind: streamKind, streamType: streamType)

MXDSRTPlayerConfiguration.h

SRT player and transport configuration.

Enums

MXDSRTStreamPayloadFormat

  • HVSRTStreamPayloadFormatAnnexBH264 = 0
  • HVSRTStreamPayloadFormatMPEGTS

MXDSRTPlayerConfiguration

NameDeclarationDetails
streamURL@property (nonatomic, copy) NSURL *streamURL;Endpoint or file URL used by the component.
streamID@property (nonatomic, copy, nullable) NSString *streamID;Public configuration or state exposed by this API.
passphrase@property (nonatomic, copy, nullable) NSString *passphrase;Public configuration or state exposed by this API.
username@property (nonatomic, copy, nullable) NSString *username;Public configuration or state exposed by this API.
password@property (nonatomic, copy, nullable) NSString *password;Public configuration or state exposed by this API.
latencyInMilliseconds@property (nonatomic, assign) NSInteger latencyInMilliseconds;Network transport reliability and buffering configuration.
networkCachingInMilliseconds@property (nonatomic, assign) NSInteger networkCachingInMilliseconds;Network transport reliability and buffering configuration.
connectionTimeoutInMilliseconds@property (nonatomic, assign) NSInteger connectionTimeoutInMilliseconds;Network transport reliability and buffering configuration.
shouldReconnectAutomatically@property (nonatomic, assign) BOOL shouldReconnectAutomatically;Network transport reliability and buffering configuration.
maximumReconnectAttempts@property (nonatomic, assign) NSInteger maximumReconnectAttempts;Network transport reliability and buffering configuration.
muted@property (nonatomic, assign) BOOL muted;Audio routing, mute, level, or gain configuration.
payloadFormat@property (nonatomic, assign) MXDSRTStreamPayloadFormat payloadFormat;Public configuration or state exposed by this API.
listenAsServer@property (nonatomic, assign) BOOL listenAsServer;Public configuration or state exposed by this API.
initWithStreamURL:
- (instancetype)initWithStreamURL:(NSURL *)streamURL;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithStreamURL. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithStreamURL (NSURL *, streamURL)
Swift usagelet value = MXDSRTPlayerConfiguration(initWithStreamURL: url)

MXDSRTPlayerView.h

SRT playback component.

Enums

MXDSRTPlayerState

  • HVSRTPlayerStateIdle = 0
  • HVSRTPlayerStateBuffering
  • HVSRTPlayerStatePlaying
  • HVSRTPlayerStatePaused
  • HVSRTPlayerStateStopped
  • HVSRTPlayerStateError

MXDSRTPlayerViewDelegate Protocol

playerView:didChangeState:
- (void)playerView:(MXDSRTPlayerView *)playerView didChangeState:(MXDSRTPlayerState)state;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for playerView didChangeState. Implement this method to observe lifecycle, media output, status, or error events.
ParametersplayerView (MXDSRTPlayerView *, playerView); didChangeState (MXDSRTPlayerState, state)
Swift usageinstance.playerView(playerView: playerView, didChangeState: state)
playerView:didFailWithError:
- (void)playerView:(MXDSRTPlayerView *)playerView didFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for playerView didFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParametersplayerView (MXDSRTPlayerView *, playerView); didFailWithError (NSError *, error)
Swift usageinstance.playerView(playerView: playerView, didFailWithError: nil)
playerViewDidStartRenderingVideo:
- (void)playerViewDidStartRenderingVideo:(MXDSRTPlayerView *)playerView;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for playerViewDidStartRenderingVideo. Implement this method to observe lifecycle, media output, status, or error events.
ParametersplayerViewDidStartRenderingVideo (MXDSRTPlayerView *, playerView)
Swift usageinstance.playerViewDidStartRenderingVideo(playerViewDidStartRenderingVideo: playerView)

MXDSRTPlayerViewOutputDelegate Protocol

srtPlayerView:didOutputVideoFrame:presentationTime:
- (void)srtPlayerView:(MXDSRTPlayerView *)playerView didOutputVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtPlayerView didOutputVideoFrame presentationTime. Implement this method to observe lifecycle, media output, status, or error events.
ParameterssrtPlayerView (MXDSRTPlayerView *, playerView); didOutputVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)
Swift usageinstance.srtPlayerView(srtPlayerView: playerView, didOutputVideoFrame: imageBuffer, presentationTime: 0.0)
srtPlayerView:didOutputAACAccessUnit:sampleRate:channels:objectType:config:
- (void)srtPlayerView:(MXDSRTPlayerView *)playerView didOutputAACAccessUnit:(NSData *)accessUnit sampleRate:(Float64)sampleRate channels:(UInt32)channels objectType:(UInt32)objectType config:(NSData * _Nullable)config;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtPlayerView didOutputAACAccessUnit sampleRate channels objectType config. Implement this method to observe lifecycle, media output, status, or error events.
ParameterssrtPlayerView (MXDSRTPlayerView *, playerView); didOutputAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData * _Nullable, config)
Swift usageinstance.srtPlayerView(srtPlayerView: playerView, didOutputAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)

MXDSRTPlayerView

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTPlayerViewDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
outputDelegate@property (nonatomic, weak, nullable) id<MXDSRTPlayerViewOutputDelegate> outputDelegate;Receives lifecycle, media output, status, or error callbacks.
configuration@property (nonatomic, strong, readonly, nullable) MXDSRTPlayerConfiguration *configuration;Public configuration or state exposed by this API.
state@property (nonatomic, assign, readonly) MXDSRTPlayerState 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;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for init. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersNo parameters.
Swift usagelet value = MXDSRTPlayerView()
initWithConfiguration:
- (instancetype)initWithConfiguration:(MXDSRTPlayerConfiguration *)configuration;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithConfiguration. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithConfiguration (MXDSRTPlayerConfiguration *, configuration)
Swift usagelet value = MXDSRTPlayerView(initWithConfiguration: configuration)
prepareToPlay
- (void)prepareToPlay;
KindInstance method
Returnvoid
DetailsPrepares transport, decoder, and rendering resources before playback starts.
ParametersNo parameters.
Swift usageinstance.prepareToPlay()
play
- (void)play;
KindInstance method
Returnvoid
DetailsBegins or resumes playback/rendering for the configured media source.
ParametersNo parameters.
Swift usageinstance.play()
pause
- (void)pause;
KindInstance method
Returnvoid
DetailsPauses playback while keeping the object available for a later resume.
ParametersNo parameters.
Swift usageinstance.pause()
stop
- (void)stop;
KindInstance method
Returnvoid
DetailsStops the component and releases or finalizes active workflow resources.
ParametersNo parameters.
Swift usageinstance.stop()
reloadWithConfiguration:
- (void)reloadWithConfiguration:(MXDSRTPlayerConfiguration *)configuration;
KindInstance method
Returnvoid
DetailsUpdates configuration on an existing object. Some changes apply immediately; transport or stream changes may reconnect or reload internal resources.
ParametersreloadWithConfiguration (MXDSRTPlayerConfiguration *, configuration)
Swift usageinstance.reloadWithConfiguration(reloadWithConfiguration: configuration)

MXDSRTStreamClient.h

SRT transport client.

MXDSRTStreamClient

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTStreamClientDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
initWithConfiguration:
- (instancetype)initWithConfiguration:(MXDSRTPlayerConfiguration *)configuration;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithConfiguration. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithConfiguration (MXDSRTPlayerConfiguration *, configuration)
Swift usagelet value = MXDSRTStreamClient(initWithConfiguration: configuration)
start
- (void)start;
KindInstance method
Returnvoid
DetailsStarts the component and begins the related capture, server, playback, publish, recording, or discovery workflow.
ParametersNo parameters.
Swift usageinstance.start()
stop
- (void)stop;
KindInstance method
Returnvoid
DetailsStops the component and releases or finalizes active workflow resources.
ParametersNo parameters.
Swift usageinstance.stop()

MXDSRTStreamClientDelegate Protocol

streamClientDidStart:
- (void)streamClientDidStart:(MXDSRTStreamClient *)streamClient;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamClientDidStart. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamClientDidStart (MXDSRTStreamClient *, streamClient)
Swift usageinstance.streamClientDidStart(streamClientDidStart: streamClient)
streamClient:didReceiveData:
- (void)streamClient:(MXDSRTStreamClient *)streamClient didReceiveData:(NSData *)data;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamClient didReceiveData. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamClient (MXDSRTStreamClient *, streamClient); didReceiveData (NSData *, data)
Swift usageinstance.streamClient(streamClient: streamClient, didReceiveData: data)
streamClient:didFailWithError:
- (void)streamClient:(MXDSRTStreamClient *)streamClient didFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamClient didFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamClient (MXDSRTStreamClient *, streamClient); didFailWithError (NSError *, error)
Swift usageinstance.streamClient(streamClient: streamClient, didFailWithError: nil)
streamClientDidStop:
- (void)streamClientDidStop:(MXDSRTStreamClient *)streamClient;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamClientDidStop. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamClientDidStop (MXDSRTStreamClient *, streamClient)
Swift usageinstance.streamClientDidStop(streamClientDidStop: streamClient)

MXDSRTStreamPusher.h

SRT publishing component.

Enums

MXDSRTStreamPusherVideoCodec

  • MXDSRTStreamPusherVideoCodecH264 = 0
  • MXDSRTStreamPusherVideoCodecHEVC = 1

MXDSRTStreamPusherDelegate Protocol

srtStreamPusherDidConnect
- (void)srtStreamPusherDidConnect;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtStreamPusherDidConnect. Implement this method to observe lifecycle, media output, status, or error events.
ParametersNo parameters.
Swift usageinstance.srtStreamPusherDidConnect()
srtStreamPusherDidStop
- (void)srtStreamPusherDidStop;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtStreamPusherDidStop. Implement this method to observe lifecycle, media output, status, or error events.
ParametersNo parameters.
Swift usageinstance.srtStreamPusherDidStop()
srtStreamPusherDidFailWithError:
- (void)srtStreamPusherDidFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtStreamPusherDidFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParameterssrtStreamPusherDidFailWithError (NSError *, error)
Swift usageinstance.srtStreamPusherDidFailWithError(srtStreamPusherDidFailWithError: nil)
srtStreamPusherDidUpdateStatus:
- (void)srtStreamPusherDidUpdateStatus:(NSString *)status;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for srtStreamPusherDidUpdateStatus. Implement this method to observe lifecycle, media output, status, or error events.
ParameterssrtStreamPusherDidUpdateStatus (NSString *, status)
Swift usageinstance.srtStreamPusherDidUpdateStatus(srtStreamPusherDidUpdateStatus: "value")

MXDSRTStreamPusher

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTStreamPusherDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
pushing@property (nonatomic, assign, readonly, getter=isPushing) BOOL pushing;Read-only runtime state flag.
transportConfiguration@property (nonatomic, strong, readonly) MXDSRTPlayerConfiguration *transportConfiguration;Public configuration or state exposed by this API.
configuration@property (nonatomic, strong, readonly) MXDSRTStreamPusherConfiguration *configuration;Public configuration or state exposed by this API.
initWithConfiguration:
- (instancetype)initWithConfiguration:(MXDSRTPlayerConfiguration *)configuration;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithConfiguration. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithConfiguration (MXDSRTPlayerConfiguration *, configuration)
Swift usagelet value = MXDSRTStreamPusher(initWithConfiguration: configuration)
initWithTransportConfiguration:configuration:
- (instancetype)initWithTransportConfiguration:(MXDSRTPlayerConfiguration *)transportConfiguration configuration:(nullable MXDSRTStreamPusherConfiguration *)configuration;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithTransportConfiguration configuration. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithTransportConfiguration (MXDSRTPlayerConfiguration *, transportConfiguration); configuration (nullable MXDSRTStreamPusherConfiguration *, configuration)
Swift usagelet value = MXDSRTStreamPusher(initWithTransportConfiguration: 0, configuration: configuration)
start
- (void)start;
KindInstance method
Returnvoid
DetailsStarts the component and begins the related capture, server, playback, publish, recording, or discovery workflow.
ParametersNo parameters.
Swift usageinstance.start()
stop
- (void)stop;
KindInstance method
Returnvoid
DetailsStops the component and releases or finalizes active workflow resources.
ParametersNo parameters.
Swift usageinstance.stop()
appendVideoFrame:presentationTime:
- (void)appendVideoFrame:(CVImageBufferRef)imageBuffer presentationTime:(CMTime)presentationTime;
KindInstance method
Returnvoid
DetailsAppends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized.
ParametersappendVideoFrame (CVImageBufferRef, imageBuffer); presentationTime (CMTime, presentationTime)
Swift usageinstance.appendVideoFrame(appendVideoFrame: imageBuffer, presentationTime: 0.0)
appendAudioBuffer:
- (void)appendAudioBuffer:(AVAudioPCMBuffer *)audioBuffer;
KindInstance method
Returnvoid
DetailsAppends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized.
ParametersappendAudioBuffer (AVAudioPCMBuffer *, audioBuffer)
Swift usageinstance.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;
KindInstance method
Returnvoid
DetailsAppends media into the component. Use presentation timestamps and matching stream configuration so downstream encoders, mixers, or recorders stay synchronized.
ParametersappendAACAccessUnit (NSData *, accessUnit); sampleRate (Float64, sampleRate); channels (UInt32, channels); objectType (UInt32, objectType); config (NSData * _Nullable, config)
Swift usageinstance.appendAACAccessUnit(appendAACAccessUnit: data, sampleRate: 0.0, channels: channels, objectType: objectType, config: data)

MXDSRTStreamPusherConfiguration

NameDeclarationDetails
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) MXDSRTStreamPusherVideoCodec 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.
defaultConfiguration
+ (instancetype)defaultConfiguration;
KindClass method
Returninstancetype
DetailsCreates, discovers, or returns shared information for defaultConfiguration. Call this on the class before creating or configuring an instance.
ParametersNo parameters.
Swift usagelet result = MXDSRTStreamPusherConfiguration.defaultConfiguration()

MXDSRTStreamServer.h

SRT listener transport.

MXDSRTStreamServerDelegate Protocol

streamServerDidStartListening:
- (void)streamServerDidStartListening:(MXDSRTStreamServer *)streamServer;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamServerDidStartListening. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamServerDidStartListening (MXDSRTStreamServer *, streamServer)
Swift usageinstance.streamServerDidStartListening(streamServerDidStartListening: streamServer)
streamServerDidAcceptConnection:
- (void)streamServerDidAcceptConnection:(MXDSRTStreamServer *)streamServer;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamServerDidAcceptConnection. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamServerDidAcceptConnection (MXDSRTStreamServer *, streamServer)
Swift usageinstance.streamServerDidAcceptConnection(streamServerDidAcceptConnection: streamServer)
streamServer:didReceiveData:
- (void)streamServer:(MXDSRTStreamServer *)streamServer didReceiveData:(NSData *)data;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamServer didReceiveData. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamServer (MXDSRTStreamServer *, streamServer); didReceiveData (NSData *, data)
Swift usageinstance.streamServer(streamServer: streamServer, didReceiveData: data)
streamServer:didFailWithError:
- (void)streamServer:(MXDSRTStreamServer *)streamServer didFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamServer didFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamServer (MXDSRTStreamServer *, streamServer); didFailWithError (NSError *, error)
Swift usageinstance.streamServer(streamServer: streamServer, didFailWithError: nil)
streamServerDidStop:
- (void)streamServerDidStop:(MXDSRTStreamServer *)streamServer;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for streamServerDidStop. Implement this method to observe lifecycle, media output, status, or error events.
ParametersstreamServerDidStop (MXDSRTStreamServer *, streamServer)
Swift usageinstance.streamServerDidStop(streamServerDidStop: streamServer)

MXDSRTStreamServer

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTStreamServerDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
initWithConfiguration:
- (instancetype)initWithConfiguration:(MXDSRTPlayerConfiguration *)configuration;
KindInstance method
Returninstancetype
DetailsInitializes the receiver for initWithConfiguration. Use this to provide required URLs, ports, names, peer connections, or configuration objects.
ParametersinitWithConfiguration (MXDSRTPlayerConfiguration *, configuration)
Swift usagelet value = MXDSRTStreamServer(initWithConfiguration: configuration)
start
- (void)start;
KindInstance method
Returnvoid
DetailsStarts the component and begins the related capture, server, playback, publish, recording, or discovery workflow.
ParametersNo parameters.
Swift usageinstance.start()
stop
- (void)stop;
KindInstance method
Returnvoid
DetailsStops the component and releases or finalizes active workflow resources.
ParametersNo parameters.
Swift usageinstance.stop()

MXDSRTVideoDecoder.h

H.264 and HEVC video decoder for SRT streams.

MXDSRTVideoDecoderDelegate Protocol

videoDecoderDidDecodeSampleBuffer:
- (void)videoDecoderDidDecodeSampleBuffer:(CMSampleBufferRef)sampleBuffer;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for videoDecoderDidDecodeSampleBuffer. Implement this method to observe lifecycle, media output, status, or error events.
ParametersvideoDecoderDidDecodeSampleBuffer (CMSampleBufferRef, sampleBuffer)
Swift usageinstance.videoDecoderDidDecodeSampleBuffer(videoDecoderDidDecodeSampleBuffer: sampleBuffer)
videoDecoderDidFailWithError:
- (void)videoDecoderDidFailWithError:(NSError *)error;
KindDelegate / protocol callback
Returnvoid
DetailsCallback invoked by MiXiD for videoDecoderDidFailWithError. Implement this method to observe lifecycle, media output, status, or error events.
ParametersvideoDecoderDidFailWithError (NSError *, error)
Swift usageinstance.videoDecoderDidFailWithError(videoDecoderDidFailWithError: nil)

MXDSRTVideoDecoder

NameDeclarationDetails
delegate@property (nonatomic, weak, nullable) id<MXDSRTVideoDecoderDelegate> delegate;Receives lifecycle, media output, status, or error callbacks.
decodeAccessUnitNALUnits:presentationTimeStamp:
- (void)decodeAccessUnitNALUnits:(NSArray<NSData *> *)nalUnits presentationTimeStamp:(CMTime)presentationTimeStamp;
KindInstance method
Returnvoid
DetailsDecodes encoded video access units into sample buffers for rendering or forwarding.
ParametersdecodeAccessUnitNALUnits (NSArray<NSData *> *, nalUnits); presentationTimeStamp (CMTime, presentationTimeStamp)
Swift usageinstance.decodeAccessUnitNALUnits(decodeAccessUnitNALUnits: data, presentationTimeStamp: 0.0)
decodeAccessUnitNALUnits:presentationTimeStamp:videoStreamType:
- (void)decodeAccessUnitNALUnits:(NSArray<NSData *> *)nalUnits presentationTimeStamp:(CMTime)presentationTimeStamp videoStreamType:(uint8_t)videoStreamType;
KindInstance method
Returnvoid
DetailsDecodes encoded video access units into sample buffers for rendering or forwarding.
ParametersdecodeAccessUnitNALUnits (NSArray<NSData *> *, nalUnits); presentationTimeStamp (CMTime, presentationTimeStamp); videoStreamType (uint8_t, videoStreamType)
Swift usageinstance.decodeAccessUnitNALUnits(decodeAccessUnitNALUnits: data, presentationTimeStamp: 0.0, videoStreamType: videoStreamType)
flush
- (void)flush;
KindInstance method
Returnvoid
DetailsClears queued decoder/player state so future media starts from a clean point.
ParametersNo parameters.
Swift usageinstance.flush()

Back to API Reference index