Class SrtPublisherSink
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
Capabilities
Gets the list of capabilities supported by this sink.
public List<SinkCapability> Capabilities { get; }
Property Value
CurrentStat
Gets the current network statistics.
public NetworkStat CurrentStat { get; }
Property Value
EndPoint
Gets the connected end point information.
public IPProtoEndPoint EndPoint { get; }
Property Value
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
Parameters
Gets or sets the sink parameters.
public SinkParameters Parameters { get; set; }
Property Value
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
ReceivedUri
Gets or sets the end point URI used when connected.
public string ReceivedUri { get; set; }
Property Value
SocketError
Gets the socket error received on disconnection.
public ExtendedSocketError SocketError { get; }
Property Value
State
Gets the current sink state.
public MediaState State { get; }
Property Value
UniqueId
Gets or sets the unique stream identifier.
public Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the URI of the remote SRT endpoint.
public string Uri { get; set; }
Property Value
Methods
AddStream(int, MediaType)
Adds a media stream for pushing.
public void AddStream(int streamIndex, MediaType mediaType)
Parameters
streamIndexintThe zero-based index of the stream.
mediaTypeMediaTypeThe 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
streamIndexintThe zero-based index of the stream.
packetVersatileBufferThe 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
messagebyte[]The byte array containing the message data.
offsetintThe offset in the byte array at which the message begins.
sizeintThe number of bytes to send.
SendMessage(string)
Sends a text message to the remote peer.
public void SendMessage(string message)
Parameters
messagestringThe text message to send.
SendMessage(VersatileBuffer)
Sends a binary message to the remote peer using a VersatileBuffer.
public void SendMessage(VersatileBuffer buffer)
Parameters
bufferVersatileBufferThe buffer containing the message data to send.
Start(bool)
Starts media pushing to the remote SRT endpoint.
public void Start(bool delayedStart = false)
Parameters
delayedStartboolA 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
MessagingSupportDetermined
Occurs when it has been determined whether the remote peer supports messaging.
public event EventHandler<bool> MessagingSupportDetermined
Event Type
NewMessage
Occurs when a new message from the remote peer arrives.
public event EventHandler<MessageEventArgs> NewMessage
Event Type
StateChanged
Occurs when the sink state changes.
public event EventHandler<MediaState> StateChanged