Table of Contents

Class SrtPublisherSink

Namespace
VAST.SRT
Assembly
VAST.SRT.dll

Represents an SRT publisher sink that publishes media data to a remote SRT server or listener.

public class SrtPublisherSink : INetworkSink, IMediaSink, IDisposable, INetworkEndPoint, IMessaging, INetworkStat
Inheritance
SrtPublisherSink
Implements
Inherited Members

Constructors

SrtPublisherSink()

Initializes a new instance of the SrtPublisherSink class.

public SrtPublisherSink()

Properties

Accept

Gets or sets a value indicating whether the sink is accepted.

public bool Accept { get; set; }

Property Value

bool

Capabilities

Gets the list of capabilities supported by this sink.

public List<SinkCapability> Capabilities { get; }

Property Value

List<SinkCapability>

CurrentStat

Gets the current network statistics.

public NetworkStat CurrentStat { get; }

Property Value

NetworkStat

EndPoint

Gets the connected end point information.

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

IsMessagingSupported

Gets a value indicating whether the remote peer supports messaging. A value of null indicates that support has not yet been determined.

public bool? IsMessagingSupported { get; }

Property Value

bool?

IsNetworkSink

Gets a value indicating whether this is a network sink. Always returns true.

public bool IsNetworkSink { get; }

Property Value

bool

Parameters

Gets or sets the sink parameters.

public SinkParameters Parameters { get; set; }

Property Value

SinkParameters

PublishingPath

Gets or sets the publishing point name extracted from the sink URI or by any other means depending on the protocol.

public string PublishingPath { get; set; }

Property Value

string

ReceivedUri

Gets or sets the end point URI used when connected.

public string ReceivedUri { get; set; }

Property Value

string

SocketError

Gets the socket error received on disconnection.

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Gets the current sink state.

public MediaState State { get; }

Property Value

MediaState

UniqueId

Gets or sets the unique stream identifier.

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the URI of the remote SRT endpoint.

public string Uri { get; set; }

Property Value

string

Methods

AddStream(int, MediaType)

Adds a media stream for pushing.

public void AddStream(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The zero-based index of the stream.

mediaType MediaType

The media type of the stream.

Dispose()

Releases all resources used by the SrtPublisherSink class.

public void Dispose()

Open()

Opens the sink using the specified URI and establishes the SRT connection.

public void Open()

PushMedia(int, VersatileBuffer)

Pushes a media sample to the remote SRT endpoint.

public void PushMedia(int streamIndex, VersatileBuffer packet)

Parameters

streamIndex int

The zero-based index of the stream.

packet VersatileBuffer

The media sample buffer to push.

SendMessage(byte[], int, int)

Sends a binary message to the remote peer.

public void SendMessage(byte[] message, int offset, int size)

Parameters

message byte[]

The byte array containing the message data.

offset int

The offset in the byte array at which the message begins.

size int

The number of bytes to send.

SendMessage(string)

Sends a text message to the remote peer.

public void SendMessage(string message)

Parameters

message string

The text message to send.

SendMessage(VersatileBuffer)

Sends a binary message to the remote peer using a VersatileBuffer.

public void SendMessage(VersatileBuffer buffer)

Parameters

buffer VersatileBuffer

The buffer containing the message data to send.

Start(bool)

Starts media pushing to the remote SRT endpoint.

public void Start(bool delayedStart = false)

Parameters

delayedStart bool

A value indicating whether media samples are expected immediately or after a significant time interval. Not used in the current sink implementation.

Stop()

Stops media pushing and closes the sink.

public void Stop()

Events

Error

Occurs when an error is encountered during sink operation.

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

MessagingSupportDetermined

Occurs when it has been determined whether the remote peer supports messaging.

public event EventHandler<bool> MessagingSupportDetermined

Event Type

EventHandler<bool>

NewMessage

Occurs when a new message from the remote peer arrives.

public event EventHandler<MessageEventArgs> NewMessage

Event Type

EventHandler<MessageEventArgs>

StateChanged

Occurs when the sink state changes.

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>