Table of Contents

Class ProxySource

Namespace
VAST.Media
Assembly
VAST.Common.dll

Provides a proxy wrapper around an IMediaSource that enables additional processing and routing.

public class ProxySource : IMediaSource, IReferenceable, IDisposable
Inheritance
ProxySource
Implements
Inherited Members

Constructors

ProxySource(IMediaSource)

Initializes a new instance of the ProxySource class.

public ProxySource(IMediaSource originalSource)

Parameters

originalSource IMediaSource

The original media source to wrap.

Properties

AudioRenderer

Gets or sets the optional audio renderer for capture preview.

public IAudioRenderer AudioRenderer { get; set; }

Property Value

IAudioRenderer

Capabilities

Gets the list of capabilities supported by this source.

public List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

EchoCanceller

Gets or sets the echo canceller for two-way communication scenarios.

public IEchoCanceller EchoCanceller { get; set; }

Property Value

IEchoCanceller

GenerateIntermediateFrames

Gets or sets a value indicating whether intermediate frames should be generated.

public bool GenerateIntermediateFrames { get; set; }

Property Value

bool

IsDisposed

Gets a value indicating whether this object has been disposed and can no longer be used.

public bool IsDisposed { get; }

Property Value

bool

IsNetworkSource

Gets a value indicating whether this is a network source rather than a local source.

public bool IsNetworkSource { get; }

Property Value

bool

Parameters

Gets or sets the source configuration parameters.

public SourceParameters Parameters { get; set; }

Property Value

SourceParameters

RefCount

Gets the current reference count of the object.

public int RefCount { get; }

Property Value

int

State

Gets the current source state.

public MediaState State { get; }

Property Value

MediaState

StreamCount

Gets the total number of streams in the source.

public int StreamCount { get; }

Property Value

int

UniqueId

Gets or sets the unique identifier for this source.

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the source URI.

public string Uri { get; set; }

Property Value

string

Methods

AddRef()

Adds a reference to this object.

public void AddRef()

Dispose()

Releases all resources used by this proxy source.

public void Dispose()

GetMediaType(int)

Gets the media type of the specified stream.

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

The index of the stream to get the media type for.

Returns

MediaType

The media type of the requested stream, or null if not found.

GetPlatformContext(int)

Gets the platform-specific context for the specified stream.

public object GetPlatformContext(int streamIndex)

Parameters

streamIndex int

The index of the stream to get the platform context for.

Returns

object

The platform context, or null if not available.

Open()

Opens the source and prepares it for streaming.

public void Open()

Release()

Releases a reference to this object.

public void Release()

Remarks

If the reference count reaches zero, Dispose() is called automatically. The caller must not use this object after calling this method.

SetDesiredOutputType(int, MediaType)

Sets the desired output media type for the specified stream.

public virtual Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The index of the stream to set the desired output type for.

mediaType MediaType

The desired media type, which can be incomplete and specify only the necessary parameters.

Returns

Task

Remarks

The source implements decoding or encoding internally to provide the requested output type. The actual output type may not match the desired type exactly; use GetMediaType(int) to obtain the actual output media type.

SetStreamMapping(int, int)

Sets the mapping between input and output stream indices.

public void SetStreamMapping(int inputStreamIndex, int outputStreamIndex)

Parameters

inputStreamIndex int

The input stream index to map.

outputStreamIndex int

The output stream index, or -1 to discard the input stream.

Remarks

This method can be used to reorder source streams or discard input streams. Output stream indices must form a consecutive sequence starting from 0, without overlapping. Examples: 0 → 0 (same index), 0 → 1 (reorder), 0 → -1 (discard).

Exceptions

InvalidOperationException

Thrown if not in Opened state.

Start()

Starts the source and begins pushing media data.

public void Start()

Stop()

Stops the source and releases the underlying media source.

public void Stop()

Events

Error

Occurs when an error is encountered.

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

Occurs when a new sample is ready to be consumed.

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

Occurs when a new stream is created or stream information becomes available.

public event EventHandler<NewStreamEventArgs> NewStream

Event Type

EventHandler<NewStreamEventArgs>

StateChanged

Occurs when the source state changes.

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>