Table of Contents

Interface IMediaSink

Namespace
VAST.Media
Assembly
VAST.Common.dll

Defines the contract for a media sink.

public interface IMediaSink : IDisposable
Inherited Members

Properties

Capabilities

Gets the list of capabilities supported by this sink.

List<SinkCapability> Capabilities { get; }

Property Value

List<SinkCapability>

IsNetworkSink

Gets a value indicating whether this is a network sink rather than a local sink. Used to apply longer timeouts in processing logic.

bool IsNetworkSink { get; }

Property Value

bool

Parameters

Gets or sets the sink configuration parameters.

SinkParameters Parameters { get; set; }

Property Value

SinkParameters

State

Gets the current sink state.

MediaState State { get; }

Property Value

MediaState

UniqueId

Gets or sets the unique identifier for this sink.

Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the URI to be opened. The exact URI syntax depends on the implementation.

string Uri { get; set; }

Property Value

string

Methods

AddStream(int, MediaType)

Adds a media stream to the sink.

void AddStream(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The index of the stream.

mediaType MediaType

The media type of the stream.

Open()

Opens the sink using the specified URI.

void Open()

PushMedia(int, VersatileBuffer)

Pushes a media sample to the sink.

void PushMedia(int streamIndex, VersatileBuffer sample)

Parameters

streamIndex int

The index of the stream.

sample VersatileBuffer

The media sample to push.

Start(bool)

Starts media pushing to the sink.

void Start(bool delayedStart = false)

Parameters

delayedStart bool

True if the first media sample is expected after a significant time interval (e.g., tens of seconds); false if samples are expected immediately.

Stop()

Stops media pushing to the sink.

void Stop()

Events

Error

Occurs when an error is encountered.

event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

StateChanged

Occurs when the sink state changes.

event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>