Interface IMediaSink
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
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
Parameters
Gets or sets the sink configuration parameters.
SinkParameters Parameters { get; set; }
Property Value
State
Gets the current sink state.
MediaState State { get; }
Property Value
UniqueId
Gets or sets the unique identifier for this sink.
Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the URI to be opened. The exact URI syntax depends on the implementation.
string Uri { get; set; }
Property Value
Methods
AddStream(int, MediaType)
Adds a media stream to the sink.
void AddStream(int streamIndex, MediaType mediaType)
Parameters
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
streamIndexintThe index of the stream.
sampleVersatileBufferThe media sample to push.
Start(bool)
Starts media pushing to the sink.
void Start(bool delayedStart = false)
Parameters
delayedStartboolTrue 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
StateChanged
Occurs when the sink state changes.
event EventHandler<MediaState> StateChanged