Class NDISourceInfoX
- Namespace
- VisioForge.Core.MediaInfoReaderX
- Assembly
- VisioForge.Core.dll
Provides functionality to retrieve basic video and audio stream information from NDI (Network Device Interface) sources.
public class NDISourceInfoX : IDisposableInheritance
Implements
Inherited Members
Remarks
This API is available on Windows and Android builds. It connects to an NDI sender and reads enough frames to determine stream properties (video resolution/frame rate and audio sample rate/channel count).
The underlying NDI receiver holds unmanaged resources. Call VisioForge.Core.MediaInfoReaderX.NDISourceInfoX.Dispose when finished.
Constructors
NDISourceInfoX(string)
Creates an NDI source info instance using NDI name.
public NDISourceInfoX(string ndiName)Parameters
ndiNamestring-
The NDI source name to connect to.
Exceptions
- ArgumentException
-
Thrown when
ndiNameisnullor empty.
NDISourceInfoX(Uri)
Creates an NDI source info instance using IP and port.
public NDISourceInfoX(Uri uri)Parameters
uriUri-
The URI containing IP address and port of the NDI source.
Remarks
This overload uses ToString() as the NDI URL address.
Exceptions
- ArgumentNullException
-
Thrown when
uriisnull.
NDISourceInfoX(string, string)
Creates an NDI source info instance using both NDI name and URL address.
public NDISourceInfoX(string ndiName, string url)Parameters
ndiNamestring-
The NDI source name (e.g. "MACHINE (Stream)").
urlstring-
The URL address (e.g. "192.168.1.10:5961").
Remarks
Preferred form when both are available — the receiver connects via URL directly
without waiting for its internal Find subsystem to (re)discover the source by name.
Without the URL, the very first recv_create_v3 call after process start
frequently times out because NDI Find can take several seconds to populate the
per-receiver source cache.
Exceptions
- ArgumentException
-
Thrown when both
ndiNameandurlare null/empty.
Properties
IsValid
Gets a value indicating whether the NDI source is properly initialized and ready for use.
public bool IsValid { get; }Property Value
Methods
Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected virtual void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()~NDISourceInfoX()
Finalizes an instance of the VisioForge.Core.MediaInfoReaderX.NDISourceInfoX class.
protected ~NDISourceInfoX()GetAudioInfo()
Gets audio stream information from the NDI source.
public (int sampleRate, int channels)? GetAudioInfo()Returns
- (int sampleRate, int channels)?
-
A tuple containing sample rate and channel count. Returns
nullif the source is not initialized or no audio stream is detected.
Remarks
The method waits for incoming frames up to an internal timeout (currently 5 seconds by default) in order to infer stream properties.
GetVideoInfo()
Gets video stream information from the NDI source.
public (int width, int height, float frameRate, bool progressive)? GetVideoInfo()Returns
- (int width, int height, float frameRate, bool progressive)?
-
A tuple containing width, height, frame rate, and a value indicating whether the stream is progressive. Returns
nullif the source is not initialized or no video stream is detected.
Remarks
The method waits for incoming frames up to an internal timeout (currently 5 seconds by default) in order to infer stream properties.
PrintInfo()
Prints all available information about the NDI source to the debug output.
public void PrintInfo()Remarks
This method writes to Debug output. It does not throw if the source is not initialized.
ReadInfoAsync()
Reads stream information from the NDI source and returns it as a VisioForge.Core.Types.MediaInfo.MediaFileInfo.
public Task<MediaFileInfo> ReadInfoAsync()Returns
- Task<MediaFileInfo>
-
A task that returns a VisioForge.Core.Types.MediaInfo.MediaFileInfo instance populated with detected video and/or audio stream info. Returns
nullif the source is not initialized.
Remarks
Only basic stream properties are reported (video width/height/frame rate and audio sample rate/channels). Container-level information such as duration, tags, and codecs is not applicable to NDI and is not populated.