Table of Contents

Class MixingSource

Namespace
VAST.Image.Mixing
Assembly
VAST.Image.dll

Implements a media mixing source that combines multiple input sources into a single output stream. Supports video compositing with layers, audio mixing with volume control, fade animations, pull sources (file, stream), push sources, and automatic reconnection.

public class MixingSource : INetworkSource, IMediaSource, IReferenceable, IDisposable, INetworkEndPoint
Inheritance
MixingSource
Implements
Derived
Inherited Members

Constructors

MixingSource()

Initializes a new instance of the MixingSource class with default image processor parameters.

public MixingSource()

MixingSource(ImageProcessorParameters)

Initializes a new instance of the MixingSource class with the specified image processor parameters.

public MixingSource(ImageProcessorParameters imageProcessorParameters)

Parameters

imageProcessorParameters ImageProcessorParameters

Parameters for configuring the image processor, or null for defaults.

Exceptions

UnauthorizedAccessException

Thrown when the license is invalid.

Properties

Accept

Whether source is accepted or not

public bool Accept { get; set; }

Property Value

bool

AudioNotificationIntervalMs

Gets or sets audio notification event interval for each source in milliseconds

public int AudioNotificationIntervalMs { get; set; }

Property Value

int

Capabilities

Gets the list of source capabilities

public List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

CleanupOnStop

Gets or sets whether to cleanup video renderer on stop. By default it's true and video renderer window is filled with black color on stop. Set to false to keep last rendered image intact. Only makes sense if video renderer has been set, otherwise has no effect.

public bool CleanupOnStop { get; set; }

Property Value

bool

CurrentStat

Gets current statistics

public MixingStat CurrentStat { get; }

Property Value

MixingStat

EndPoint

Connected end point info

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

FileCache

Gets or sets the shared file cache used for file-based sources.

public static FileCache FileCache { get; set; }

Property Value

FileCache

IsDisposed

Can be used to check whether object is already disposed and can't be used anymore

public bool IsDisposed { get; }

Property Value

bool

IsNetworkSource

Whether it's a network or local source.

public bool IsNetworkSource { get; }

Property Value

bool

Parameters

Gets or sets source parameters

public SourceParameters Parameters { get; set; }

Property Value

SourceParameters

PublishingPath

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

public string PublishingPath { get; set; }

Property Value

string

ReceivedUri

Source URI when present (depends on the protocol)

public string ReceivedUri { get; set; }

Property Value

string

RefCount

Gets current reference count of the object

public int RefCount { get; }

Property Value

int

Renderer

Gets or sets the video renderer for preview output. When set, the mixed video is rendered to this renderer in addition to being output as samples.

public IVideoRenderer Renderer { get; set; }

Property Value

IVideoRenderer

SocketError

Socket error got on disconnection

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Current source state

public MediaState State { get; }

Property Value

MediaState

StreamCount

Total stream count of the source

public int StreamCount { get; }

Property Value

int

UniqueId

Unique source id

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

URI to be opened. Meaningless for current class

public string Uri { get; set; }

Property Value

string

Methods

AddRef()

Add reference

public void AddRef()

Discard(Dictionary<int, bool>)

Applies discard flags for selected streams. This is a smooth discard request which should not produce any interruptions in playback.

public void Discard(Dictionary<int, bool> values)

Parameters

values Dictionary<int, bool>

Map of stream index to discard value

Dispose()

Disposes used resources

public void Dispose()

GetMediaType(int)

Gets media type of the stream

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

Stream index to get media type for

Returns

MediaType

Media type of requested stream

Open()

Connect is meaningless because current class is instantiated for already connected RTMP publisher session

public void Open()

Release()

Release reference. If reference count becomes 0 then Dispose() method is called. Calling object must not use current object after this call.

public void Release()

SetDesiredOutputType(int, MediaType)

Sets desired output media type of the specified stream. Desired media type could be an incomplete media type specifying only necessary parameters. Source should implement decoding or encoding internally to provide requested output type. It is not guaranteed though that an actual output type will match a desired type exactly. GetMediaType function should be used to obtain actual output media type.

public Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

Stream index to set desired output media type for

mediaType MediaType

Desired media type

Returns

Task

Start()

Start the source. Not used in current class

public void Start()

Stop()

Stop the source. Not used in current class

public void Stop()

Update(Descriptor)

Updates the mixing descriptor with new source, track, and mixing configurations. Can be called at any time to dynamically change the mixing setup.

public void Update(Descriptor desc)

Parameters

desc Descriptor

The new descriptor to apply. If null, no changes are made.

Events

AudioNotification

Audio notification

public event EventHandler<MixingSource.AudioNotificationEventArgs> AudioNotification

Event Type

EventHandler<MixingSource.AudioNotificationEventArgs>

Error

Error occurred

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

New sample is ready

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

New stream has been created

public event EventHandler<NewStreamEventArgs> NewStream

Event Type

EventHandler<NewStreamEventArgs>

StateChanged

Source state changed

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>