Table of Contents

Class RtmpPublisherSink

Namespace
VAST.RTMP
Assembly
VAST.RTMP.dll

Provides a media sink for publishing media streams to an RTMP server. Supports automatic reconnection and bandwidth monitoring.

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

Constructors

RtmpPublisherSink()

Create new instance of RtmpSink

public RtmpPublisherSink()

Properties

Accept

Whether sink is accepted or not

public bool Accept { get; set; }

Property Value

bool

Capabilities

Gets the list of sink capabilities

public List<SinkCapability> Capabilities { get; }

Property Value

List<SinkCapability>

CurrentStat

Gets current network statistics

public NetworkStat CurrentStat { get; }

Property Value

NetworkStat

EndPoint

Connected end point info

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

IsNetworkSink

whether it's a network or local sink. Necessary to apply longer timeouts in media session processing logic.

public bool IsNetworkSink { get; }

Property Value

bool

Parameters

Gets or sets sink parameters

public SinkParameters Parameters { get; set; }

Property Value

SinkParameters

PublishingPath

Publishing point name extracted from the sink URI or by any other means (depends on the protocol)

public string PublishingPath { get; set; }

Property Value

string

ReceivedUri

End point URI used when connected (depends on the protocol)

public string ReceivedUri { get; set; }

Property Value

string

SocketError

Socket error got on disconnection

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Current sink state

public MediaState State { get; }

Property Value

MediaState

UniqueId

Unique stream id

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

URI to be opened. Exact URI syntax depends on the implementation.

public string Uri { get; set; }

Property Value

string

Methods

AddStream(int, MediaType)

Add media stream for pushing

public void AddStream(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

Stream index

mediaType MediaType

Stream media type

Dispose()

Disposes used resources

public void Dispose()

Open()

Open sink using specified URI

public void Open()

PushMedia(int, VersatileBuffer)

Push media sample

public void PushMedia(int streamIndex, VersatileBuffer sample)

Parameters

streamIndex int

Stream index

sample VersatileBuffer

Media sample

Start(bool)

Start media pushing

public void Start(bool delayedStart = false)

Parameters

delayedStart bool

Whether media samples are expected immediately or after significant time interval. Not used in current sink

Stop()

Stop media pushing

public void Stop()

addStream(int, MediaType)

Adds a media stream for publishing to the RTMP server.

public void addStream(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The stream index.

mediaType MediaType

The media type of the stream.

Events

Error

Error occurred

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

StateChanged

Sink state changed

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>