Class NdiSource
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
IsDisposed
Gets a value indicating whether this object is already disposed and can no longer be used.
public bool IsDisposed { get; }
Property Value
IsNetworkSource
Gets a value indicating whether it is a network or local source.
Always false for this class.
public bool IsNetworkSource { get; }
Property Value
Parameters
Gets or sets the source parameters.
public SourceParameters Parameters { get; set; }
Property Value
RefCount
Gets the current reference count of the object.
public int RefCount { get; }
Property Value
State
Gets the current source state.
public MediaState State { get; }
Property Value
StreamCount
Gets the total stream count of the source.
public int StreamCount { get; }
Property Value
UniqueId
Gets or sets the unique identifier for this source.
public Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the URI to be opened.
public string Uri { get; set; }
Property Value
WebControlUri
Gets the web control URI for this NDI source, or null if not available.
public string WebControlUri { get; }
Property Value
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
streamIndexintThe stream index to get the media type for.
Returns
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
streamIndexintThe stream index to set the desired output media type for.
mediaTypeMediaTypeThe desired media type.
Returns
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
NewSample
Occurs when a new sample is ready for processing.
public event EventHandler<NewSampleEventArgs> NewSample
Event Type
NewStream
Occurs when a new stream has been created.
public event EventHandler<NewStreamEventArgs> NewStream
Event Type
StateChanged
Occurs when the source state changes.
public event EventHandler<MediaState> StateChanged