Table of Contents

Class NdiSource

Namespace
VAST.NDI
Assembly
VAST.NDI.dll

NDI media source implementation for receiving video and audio over NDI. Implements IMediaSource.

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

Constructors

NdiSource()

Initializes a new instance of the NdiSource class.

public NdiSource()

Properties

Capabilities

Gets the list of source capabilities.

public List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

IsDisposed

Gets a value indicating whether this object is already disposed and can no longer be used.

public bool IsDisposed { get; }

Property Value

bool

IsNetworkSource

Gets a value indicating whether it is a network or local source. Always false for this class.

public bool IsNetworkSource { get; }

Property Value

bool

Parameters

Gets or sets the source 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 stream count of 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 URI to be opened.

public string Uri { get; set; }

Property Value

string

WebControlUri

Gets the web control URI for this NDI source, or null if not available.

public string WebControlUri { get; }

Property Value

string

Methods

AddRef()

Adds a reference to this object, incrementing the reference count.

public void AddRef()

Dispose()

Releases all resources used by the NdiSource class.

public void Dispose()

GetMediaType(int)

Gets the media type of the specified stream.

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

The stream index to get the media type for.

Returns

MediaType

The MediaType of the requested stream, or null if the index is out of range.

Open()

Opens the NDI source and starts receiving frames.

public void Open()

Release()

Releases a reference to this object, decrementing the reference count. If the reference count becomes 0 then Dispose() is called. The calling object must not use this object after this call.

public void Release()

SetDesiredOutputType(int, MediaType)

Sets the desired output media type of the specified stream. The desired media type can be an incomplete media type specifying only necessary parameters. The source implements decoding or encoding internally to provide the requested output type. It is not guaranteed that the actual output type will match the desired type exactly. GetMediaType(int) should be used to obtain the actual output media type.

public Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

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

mediaType MediaType

The desired media type.

Returns

Task

A Task representing the asynchronous operation.

Start()

Starts the source and begins processing frames.

public void Start()

Stop()

Stops the source and releases all native resources.

public void Stop()

Events

Error

Occurs when an error is encountered during source operations.

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

Occurs when a new sample is ready for processing.

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

Occurs when a new stream has been created.

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>