Table of Contents

Class DeviceEnumerator

Namespace
VisioForge.Core
Assembly
VisioForge.Core.dll

Cross-platform device enumerator that discovers and manages audio/video input devices, professional hardware, and network sources across all supported platforms.

public class DeviceEnumerator : IDisposable

Inheritance

Implements

Inherited Members

Remarks

This class provides unified access to a wide variety of media devices:

  • Standard webcams and video capture devices
  • Microphones and audio capture sources
  • Audio output devices (speakers, headphones, etc.)
  • IP cameras via ONVIF protocol
  • NDI (Network Device Interface) sources for IP video streaming
  • Blackmagic Design DeckLink professional video hardware
  • Industrial cameras supporting GenICam/GigE Vision standards
  • Allied Vision, Basler, and FLIR/Teledyne machine vision cameras

The class supports both synchronous and asynchronous device discovery methods with platform-specific optimizations for Windows, macOS, Linux, iOS, and Android. Real-time device change notifications are provided through events when devices are added or removed from the system.

Use the VisioForge.Core.DeviceEnumerator.Shared singleton instance for most scenarios to avoid resource duplication and ensure consistent device state across your application.

Constructors

DeviceEnumerator(ContextX)

Initializes a new instance of the VisioForge.Core.DeviceEnumerator class with an optional GStreamer context. If no context is provided, a new default context will be created for device operations.

protected DeviceEnumerator(ContextX context = null)

Parameters

context ContextX

The GStreamer context to use for device operations, or null to create a default context.

Fields

_shared

The shared singleton DeviceEnumerator instance for application-wide device management.

protected static DeviceEnumerator _shared

Field Value

DeviceEnumerator

_videoSourcesLock

The video sources lock.

protected readonly object _videoSourcesLock

Field Value

object

_videoSourcesX

Represents a list of video capture device information objects.

protected List<VideoCaptureDeviceInfo> _videoSourcesX

Field Value

List<VideoCaptureDeviceInfo>

Properties

IsEnumerateMediaFoundationDevices

Gets or sets a value indicating whether to include Media Foundation devices in the enumeration.

public bool IsEnumerateMediaFoundationDevices { get; set; }

Property Value

bool

Remarks

When enabled, camera devices exposed through the Windows Media Foundation framework will be included in the video sources enumeration. This provides access to newer camera drivers that only support Media Foundation. Disabling this option may be useful if you want to use only DirectShow-compatible devices.

Shared

Gets the shared singleton VisioForge.Core.DeviceEnumerator instance that provides application-wide device enumeration.

public static DeviceEnumerator Shared { get; }

Property Value

DeviceEnumerator

Remarks

This property provides a singleton instance that is automatically created on first access and disposed when the application exits via the ProcessExit event.

Using the shared instance is recommended for most scenarios to:

  • Avoid resource duplication from multiple enumerator instances
  • Maintain consistent device state across your application
  • Reduce memory overhead from redundant device monitoring

Video_IncludeMediaFoundation

Windows-only opt-in. When set to true, video-source enumeration also probes the Media Foundation device provider (mfdeviceprovider) in addition to Kernel Streaming. This exposes MF-only virtual cameras (NDI Webcam, OBS Virtual Camera, vendor virtual cameras, etc.) in the device list. Defaults to false.

NVENC is no longer at risk. This flag was introduced because probing mfdeviceprovider used to break NvEncOpenEncodeSessionEx with NV_ENC_ERR_INVALID_VERSION for the rest of the process. The cause was not Media Foundation initialization: loading the mediafoundation plugin activated NVIDIA's Media Foundation encoder MFTs while registering its elements, and that activation is what invalidated later NVENC sessions. The Windows redistributables ship a patched plugin that excludes those MFTs, so enumerating MF devices and using nvh264enc/nvh265enc/nvav1enc in one process is safe — while the SDK loads its own runtime from the VisioForge.CrossPlatform.Core.Windows.* package. An application that resolves GStreamer from a stock installation on PATH / GST_PLUGIN_PATH instead gets the unpatched plugin, and with it the original failure.

It stays opt-in because MF enumeration is additive rather than exclusive: cameras that are visible to both stacks are reported twice, once per API. Real KS-registered cameras (USB webcams, BRIO, most capture cards) are already covered by the default KS-only path, so turn this on when the application needs MF-only virtual cameras. The flag must be set BEFORE the first call to VisioForge.Core.DeviceEnumerator.VideoSources / VisioForge.Core.DeviceEnumerator.VideoSourcesAsync(System.Threading.CancellationToken); it is not cached, so the enumerator reads it fresh on every call.

public static bool Video_IncludeMediaFoundation { get; set; }

Property Value

bool

Methods

AlliedVisionSourcesAsync(CancellationToken)

Asynchronously gets an array of available Allied Vision machine vision cameras.

public Task<AlliedVisionCameraInfo[]> AlliedVisionSourcesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token to observe while waiting for the enumeration to complete.

Returns

Task<AlliedVisionCameraInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.AlliedVisionCameraInfo objects representing available Allied Vision cameras.

Remarks

This method discovers Allied Vision cameras using the Vimba X SDK, supporting GigE Vision, USB3 Vision, and Camera Link interfaces. The enumeration is performed on a background thread.

Requires the Allied Vision Vimba X SDK to be installed on the system.

AudioOutputsAsync(AudioOutputDeviceAPI?, CancellationToken)

Asynchronously gets an array of available audio output devices (speakers, headphones, etc.).

public Task<AudioOutputDeviceInfo[]> AudioOutputsAsync(AudioOutputDeviceAPI? api = null, CancellationToken cancellationToken = default)

Parameters

api AudioOutputDeviceAPI?

Optional filter to return only devices from a specific audio API. If null, returns devices from all available APIs.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<AudioOutputDeviceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Output.AudioOutputDeviceInfo objects representing available audio output devices.

Remarks

This method runs device enumeration on a background thread to avoid blocking the calling thread.

AudioSources(AudioCaptureDeviceAPI?)

Gets an array of available audio capture devices (microphones and audio inputs).

public AudioCaptureDeviceInfo[] AudioSources(AudioCaptureDeviceAPI? api = null)

Parameters

api AudioCaptureDeviceAPI?

Optional filter to return only devices from a specific audio API. If null, returns devices from all available APIs. On Linux, defaults to PulseAudio.

Returns

AudioCaptureDeviceInfo[]

An array of VisioForge.Core.Types.X.Sources.AudioCaptureDeviceInfo objects representing available audio input devices.

Remarks

This method automatically performs device enumeration on first call if the internal cache is empty. Subsequent calls return cached results unless VisioForge.Core.DeviceEnumerator.Clear is called.

Supported APIs vary by platform:

  • Windows: DirectSound, WASAPI
  • Linux: PulseAudio, ALSA, PipeWire
  • macOS: Core Audio
  • iOS/Android: Platform default (single device)

AudioSourcesAsync(AudioCaptureDeviceAPI?, CancellationToken)

Asynchronously gets an array of available audio capture devices (microphones and audio inputs).

public Task<AudioCaptureDeviceInfo[]> AudioSourcesAsync(AudioCaptureDeviceAPI? api = null, CancellationToken cancellationToken = default)

Parameters

api AudioCaptureDeviceAPI?

Optional filter to return only devices from a specific audio API. If null, returns devices from all available APIs.

cancellationToken CancellationToken

A token to observe while waiting for the task to complete.

Returns

Task<AudioCaptureDeviceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.AudioCaptureDeviceInfo objects representing available audio input devices.

Remarks

On Apple platforms (macOS, iOS), this method automatically requests microphone access permission before performing enumeration. The method runs device enumeration on a background thread.

BaslerSourcesAsync(CancellationToken)

Asynchronously gets an array of available Basler machine vision cameras.

public Task<BaslerCameraInfo[]> BaslerSourcesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

A cancellation token to observe while waiting for the enumeration to complete.

Returns

Task<BaslerCameraInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.BaslerCameraInfo objects representing available Basler cameras.

Remarks

This method discovers Basler cameras using the Pylon SDK, supporting GigE Vision, USB3 Vision, and Camera Link interfaces. The enumeration provides detailed camera information including device IDs, model names, and connection details.

Requires the Basler Pylon SDK to be installed on the system. The method runs enumeration on a background thread to avoid blocking the calling thread.

Clear()

Clears all cached device lists, forcing a fresh enumeration on the next device query.

public void Clear()

Remarks

This method clears all internal device caches including:

  • Video capture sources
  • Audio capture sources
  • Audio output devices (sinks)
  • DeckLink video and audio sources/sinks
  • NDI sources
  • GenICam cameras

Call this method when you need to force a complete re-enumeration of all devices, for example, after system configuration changes or when troubleshooting device detection issues.

DecklinkAudioSinksAsync(CancellationToken)

Asynchronously gets an array of available DeckLink audio output sinks.

public Task<DecklinkAudioSinkInfo[]> DecklinkAudioSinksAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DecklinkAudioSinkInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Decklink.DecklinkAudioSinkInfo objects representing available DeckLink audio outputs.

Remarks

This method enumerates all DeckLink audio output connections including embedded audio channels. The enumeration is performed on a background thread.

DecklinkAudioSourcesAsync(CancellationToken)

Asynchronously gets an array of available DeckLink audio capture sources.

public Task<DecklinkAudioSourceInfo[]> DecklinkAudioSourcesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DecklinkAudioSourceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Decklink.DecklinkAudioSourceInfo objects representing available DeckLink audio inputs.

Remarks

This method enumerates all DeckLink audio capture inputs including embedded audio channels. The enumeration is performed on a background thread.

DecklinkVideoSinksAsync(CancellationToken)

Asynchronously gets an array of available DeckLink video output sinks.

public Task<DecklinkVideoSinkInfo[]> DecklinkVideoSinksAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DecklinkVideoSinkInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Decklink.DecklinkVideoSinkInfo objects representing available DeckLink video outputs.

Remarks

This method enumerates all DeckLink video output connections including SDI and HDMI outputs. The enumeration is performed on a background thread.

DecklinkVideoSourcesAsync(CancellationToken)

Asynchronously gets an array of available DeckLink video capture sources.

public Task<DecklinkVideoSourceInfo[]> DecklinkVideoSourcesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<DecklinkVideoSourceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Decklink.DecklinkVideoSourceInfo objects representing available DeckLink video inputs.

Remarks

This method enumerates all DeckLink video capture inputs including SDI, HDMI, and component connections. The enumeration is performed on a background thread.

Dispose()

Releases all resources used by the VisioForge.Core.DeviceEnumerator instance.

public void Dispose()

Remarks

This method stops all active device monitors, releases GStreamer resources, and unregisters any platform-specific device notification handlers. On Windows, this also stops the WMI event watcher used for USB device change notifications.

After calling this method, the device enumerator cannot be reused. If using the VisioForge.Core.DeviceEnumerator.Shared instance, a new instance will be created automatically on the next access.

Dispose(bool)

Releases the resources used by the VisioForge.Core.DeviceEnumerator.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Enumeratex() Deprecated

Legacy stub for Spinnaker camera enumeration using the managed Spinnaker SDK wrapper. This method body is commented out and retained for historical reference only. Use VisioForge.Core.DeviceEnumerator.SpinnakerSources or VisioForge.Core.DeviceEnumerator.SpinnakerSourcesAsync instead.

[Obsolete("Use SpinnakerSources() or SpinnakerSourcesAsync() instead. This stub is a no-op retained only for source-compatibility with old samples.", false)]
public static void Enumeratex()

~DeviceEnumerator()

Finalizes an instance of the VisioForge.Core.DeviceEnumerator class.

protected ~DeviceEnumerator()

FindVideoSourceByDevicePathAsync(string)

Asynchronously finds a video capture device by its device path.

public Task<VideoCaptureDeviceInfo> FindVideoSourceByDevicePathAsync(string devicePath)

Parameters

devicePath string

The device path to search for.

Returns

Task<VideoCaptureDeviceInfo>

A task that represents the asynchronous operation. The task result contains the matching VisioForge.Core.Types.X.Sources.VideoCaptureDeviceInfo or null if not found.

GenICamSourcesAsync()

Asynchronously gets an array of available GenICam-compliant cameras.

public Task<GenICamCamera[]> GenICamSourcesAsync()

Returns

Task<GenICamCamera[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.GenICam.GenICamCamera objects representing available GenICam cameras.

Remarks

This method discovers industrial and scientific cameras that comply with the GenICam standard, including GigE Vision and USB3 Vision devices. The enumeration provides detailed camera information including device IDs, model names, and available pixel formats.

The method includes fallback mechanisms to ensure robust camera discovery even when detailed enumeration fails.

NDISourcesAsync()

Asynchronously gets an array of available NDI video/audio sources on the network.

public Task<NDISourceInfo[]> NDISourcesAsync()

Returns

Task<NDISourceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.NDISourceInfo objects representing available NDI sources.

Remarks

This method discovers NDI sources available on the local network. NDI (Network Device Interface) is a royalty-free protocol for live video streaming over IP networks, commonly used in professional broadcast and video production environments.

The enumeration includes a retry mechanism with delays to ensure all network sources are discovered, as NDI source discovery may take time depending on network conditions.

Worst-case wait budget: on Android each attempt blocks up to 3000 ms inside libndi's find_wait_for_sources. The retry loop runs at most three attempts and inserts a 500 ms delay between attempts when no source has been observed yet. Total worst-case ceiling is therefore 3 * 3000 + 2 * 500 = 10000 ms on Android. On desktop the GStreamer DeviceMonitor path drives libndi's mDNS find with no native timeout; a single wedged discovery attempt is now bounded to NDI_DESKTOP_ENUM_TIMEOUT_MS (5000 ms), after which the call breaks out and returns the last-known/empty snapshot rather than blocking the caller forever.

Use the VisioForge.Core.DeviceEnumerator.NDISourcesAsync(System.Threading.CancellationToken) overload if the caller needs to abort the worst-case wait early (e.g. when the user navigates away from a settings dialog).

NDISourcesAsync(CancellationToken)

Asynchronously gets an array of available NDI video/audio sources, with cancellation support.

public Task<NDISourceInfo[]> NDISourcesAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token observed between retry attempts and during the inter-attempt back-off. The native libndi find_wait_for_sources blocking call cannot itself be interrupted mid-call; cancellation latency is therefore bounded by the per-attempt wait window (3000 ms on Android, near-instant on desktop) plus the 500 ms back-off when applicable.

Returns

Task<NDISourceInfo[]>

A task that completes with the discovered sources, or faults with OperationCanceledException if cancellation fires.

ONVIF_ListSourcesAsync(TimeSpan?, CancellationTokenSource?)

Asynchronously discovers ONVIF-compliant devices on the local network.

public Task<Uri[]> ONVIF_ListSourcesAsync(TimeSpan? timeout, CancellationTokenSource? cts)

Parameters

timeout TimeSpan?

The maximum time to wait for device responses. If null, defaults to 2 seconds. Increase this value for larger networks or slow-responding devices.

cts CancellationTokenSource?

Optional cancellation token source to abort the discovery operation. If null, a new cancellation token source is created internally.

Returns

Task<Uri[]>

A task that represents the asynchronous operation. The task result contains an array of Uri objects representing the service URLs of discovered ONVIF devices.

Remarks

This method uses WS-Discovery to find ONVIF devices on the network. Each returned URI represents the device service endpoint that can be used to establish a connection for camera control and streaming.

For connecting to discovered devices, use the ONVIFClientX class from VisioForge.Core.ONVIFX namespace for full device management capabilities including PTZ control, event handling, and profile management.

SpinnakerSources()

Gets an array of available FLIR/Teledyne Spinnaker-compatible machine vision cameras.

public SpinnakerCameraInfo[] SpinnakerSources()

Returns

SpinnakerCameraInfo[]

An array of VisioForge.Core.Types.X.Sources.SpinnakerCameraInfo objects representing available Spinnaker cameras.

Remarks

This method discovers FLIR/Teledyne cameras using the Spinnaker SDK, supporting GigE Vision, USB3 Vision, and 10GigE interfaces. The enumeration provides comprehensive camera information including device model, vendor, serial number, sensor dimensions, maximum resolution, and firmware version.

The method automatically performs enumeration on first call if the internal cache is empty, and every later call returns that result for the life of the process. Clear does not empty this one, deliberately: enumeration initializes and deinitializes every camera through the Spinnaker singleton, so repeating it mid-session would stop a stream already running.

Requires the FLIR Spinnaker SDK to be installed on the system.

SpinnakerSourcesAsync()

Asynchronously gets an array of available FLIR/Teledyne Spinnaker-compatible machine vision cameras.

public Task<SpinnakerCameraInfo[]> SpinnakerSourcesAsync()

Returns

Task<SpinnakerCameraInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.SpinnakerCameraInfo objects representing available Spinnaker cameras.

Remarks

This method discovers FLIR/Teledyne cameras using the Spinnaker SDK. The enumeration is performed on a background thread to avoid blocking the calling thread.

Requires the FLIR Spinnaker SDK to be installed on the system.

StartAudioSinkMonitor()

Starts monitoring for audio output device changes on the current thread.

public void StartAudioSinkMonitor()

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnAudioSinkAdded and VisioForge.Core.DeviceEnumerator.OnAudioSinkRemoved events when audio output devices are connected or disconnected.

On Linux, this method performs a one-time enumeration instead of continuous monitoring.

StartAudioSinkMonitorAsync()

Asynchronously starts monitoring for audio output device changes.

public Task StartAudioSinkMonitorAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnAudioSinkAdded and VisioForge.Core.DeviceEnumerator.OnAudioSinkRemoved events when audio output devices are connected or disconnected.

No permission is requested here, on any platform: listing and opening audio OUTPUTS needs no microphone grant, and asking for one raised a microphone prompt in a playback-only app (#1242). VisioForge.Core.DeviceEnumerator.AudioOutputsAsync(System.Nullable{VisioForge.Core.Types.X.Output.AudioOutputDeviceAPI},System.Threading.CancellationToken) never asked either; this is the same contract.

StartAudioSourceMonitor()

Starts monitoring for audio capture device changes on the current thread.

public void StartAudioSourceMonitor()

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnAudioSourceAdded and VisioForge.Core.DeviceEnumerator.OnAudioSourceRemoved events when audio input devices are connected or disconnected.

On Linux, this method performs a one-time enumeration instead of continuous monitoring.

StartAudioSourceMonitorAsync()

Asynchronously starts monitoring for audio capture device changes.

public Task StartAudioSourceMonitorAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnAudioSourceAdded and VisioForge.Core.DeviceEnumerator.OnAudioSourceRemoved events when audio input devices are connected or disconnected.

On Apple platforms (macOS, iOS), this method automatically requests microphone access permission.

StartNDISourceWatch()

Starts the background watcher that polls libndi for NDI source changes and fires VisioForge.Core.DeviceEnumerator.NDISourcesChanged when the network set changes. Idempotent — calling twice with no intervening VisioForge.Core.DeviceEnumerator.StopNDISourceWatch is a no-op for the second call.

public void StartNDISourceWatch()

Remarks

On Android the watcher reuses the persistent libndi find instance created by VisioForge.Core.DeviceEnumerator.NDISourcesAsync, so subscribers see the same warm mDNS state callers of the snapshot API see. The first notification fires after the cold-start window (NDI_FIND_INITIAL_WAIT_MS, ~5 s) if it hasn't already happened.

StartVideoSourceMonitor()

Starts monitoring for video capture device changes on the current thread.

public void StartVideoSourceMonitor()

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnVideoSourceAdded and VisioForge.Core.DeviceEnumerator.OnVideoSourceRemoved events when video capture devices are connected or disconnected.

On Linux, this method performs a one-time enumeration instead of continuous monitoring.

StartVideoSourceMonitorAsync()

Asynchronously starts monitoring for video capture device changes.

public Task StartVideoSourceMonitorAsync()

Returns

Task

A task that represents the asynchronous operation.

Remarks

Once started, the monitor will raise VisioForge.Core.DeviceEnumerator.OnVideoSourceAdded and VisioForge.Core.DeviceEnumerator.OnVideoSourceRemoved events when video capture devices are connected or disconnected.

On Apple platforms (macOS), this method automatically requests camera access permission.

StopNDISourceWatch()

Signals the background watcher to stop and waits briefly for it to exit. Safe to call when the watcher is not running.

public void StopNDISourceWatch()

Remarks

The watcher's tightest blocking call is find_wait_for_sources with a 10-second timeout, so worst-case Stop latency is ~10 s — but most stops resolve far faster because the wait short-circuits as soon as the source list moves. VisioForge.Core.DeviceEnumerator.StopNDISourceWatch is also invoked automatically from VisioForge.Core.DeviceEnumerator.Dispose so callers don't need to track lifetime themselves unless they want finer control.

VideoSources()

Gets an array of available video capture devices (cameras, webcams, and capture cards).

public VideoCaptureDeviceInfo[] VideoSources()

Returns

VideoCaptureDeviceInfo[]

An array of VisioForge.Core.Types.X.Sources.VideoCaptureDeviceInfo objects representing available video capture devices.

Remarks

This method automatically performs device enumeration on first call if the internal cache is empty. Subsequent calls return cached results unless VisioForge.Core.DeviceEnumerator.Clear is called.

Supported video sources vary by platform:

  • Windows: DirectShow, Media Foundation, UVC cameras
  • Linux: V4L2, libcamera, UVC cameras
  • macOS: AVFoundation cameras
  • iOS: Built-in cameras via AVFoundation
  • Android: Camera API devices

VideoSourcesAsync(CancellationToken)

Asynchronously gets an array of available video capture devices (cameras, webcams, and capture cards).

public Task<VideoCaptureDeviceInfo[]> VideoSourcesAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<VideoCaptureDeviceInfo[]>

A task that represents the asynchronous operation. The task result contains an array of VisioForge.Core.Types.X.Sources.VideoCaptureDeviceInfo objects representing available video capture devices.

Remarks

On Apple platforms (macOS), this method automatically requests camera access permission before performing enumeration. The method runs device enumeration on a background thread.

NDISourcesChanged

Raised when the set of NDI sources visible on the network changes, after VisioForge.Core.DeviceEnumerator.StartNDISourceWatch has been called. The event carries the full current snapshot plus per-item Added / Removed diffs vs the previous notification.

public event EventHandler<NDISourcesChangedEventArgs> NDISourcesChanged

Event Type

EventHandler<NDISourcesChangedEventArgs>

Remarks

Threading: fired from the background watcher thread that calls NDIlib_find_wait_for_sources. UI consumers must marshal to their UI thread (Activity.RunOnUiThread, Dispatcher, etc.) — the SDK does not do that for them.

Reliability: NDI sources are dropped from the internal libndi table after ~5–10 seconds without an mDNS heartbeat, so the Removed diff has a small detection delay vs the moment a sender actually went off-air. This matches the behaviour of every other NDI receiver and is not configurable per the SDK contract.

Platforms: currently implemented on Android. On other platforms the watcher is a no-op (VisioForge.Core.DeviceEnumerator.StartNDISourceWatch succeeds silently, no events are raised) — for desktop, use the GStreamer DeviceMonitor change signals directly until a cross-platform implementation lands.

OnAudioSinkAdded

Occurs when a new audio output device (speaker/headphones) is added to the system.

public event EventHandler<AudioOutputDeviceInfo> OnAudioSinkAdded

Event Type

EventHandler<AudioOutputDeviceInfo>

Remarks

This event is triggered when the device monitor detects a newly connected audio output device. The event argument contains detailed information about the added device.

OnAudioSinkRemoved

Occurs when an audio output device (speaker/headphones) is removed from the system.

public event EventHandler<AudioOutputDeviceInfo> OnAudioSinkRemoved

Event Type

EventHandler<AudioOutputDeviceInfo>

Remarks

This event is triggered when the device monitor detects that an audio output device has been disconnected. The event argument contains information about the removed device.

OnAudioSourceAdded

Occurs when a new audio capture device (microphone) is added to the system.

public event EventHandler<AudioCaptureDeviceInfo> OnAudioSourceAdded

Event Type

EventHandler<AudioCaptureDeviceInfo>

Remarks

This event is triggered when the device monitor detects a newly connected audio input device. The event argument contains detailed information about the added device including its name, API type, and internal identifier.

OnAudioSourceRemoved

Occurs when an audio capture device (microphone) is removed from the system.

public event EventHandler<AudioCaptureDeviceInfo> OnAudioSourceRemoved

Event Type

EventHandler<AudioCaptureDeviceInfo>

Remarks

This event is triggered when the device monitor detects that an audio input device has been disconnected. The event argument contains information about the removed device.

OnDecklinkSignalLost

Occurs when the DeckLink device loses input signal.

public event EventHandler<EventArgs> OnDecklinkSignalLost

Event Type

EventHandler<EventArgs>

Remarks

This event is triggered when the DeckLink hardware detects a loss of video/audio input signal. This commonly occurs when an SDI or HDMI cable is disconnected or the source device is powered off. Applications should handle this event to notify users or switch to alternative sources.

OnDeviceAdded

Occurs when a device is added to the system.

public event EventHandler<EventArgs> OnDeviceAdded

Event Type

EventHandler<EventArgs>

Remarks

This event is raised after a USB device is detected and connected. There is a brief delay (approximately 500ms) to allow the device to fully initialize before the event is triggered. Duplicate events within 3 seconds are filtered to prevent event flooding.

OnDeviceEnumerationCompleted

Occurs when the initial enumeration of a device list has finished.

public event EventHandler<DeviceEnumerationCompletedEventArgs> OnDeviceEnumerationCompleted

Event Type

EventHandler<DeviceEnumerationCompletedEventArgs>

Remarks

Raised once per StartVideoSourceMonitor / StartAudioSourceMonitor / StartAudioSinkMonitor call (and their asynchronous overloads), after that call's enumeration pass has finished and before it returns. It reports the pass, not the final contents of the list: two overlapping starts each raise it, and the one that finishes last is the one whose list is complete. The device-list getters do not raise it - they enumerate as part of answering, and a completion in the middle of that would point at an unfinished list. An application that starts a monitor without awaiting it can show "enumerating..." until this arrives, filling its UI from OnVideoSourceAdded, OnAudioSourceAdded and OnAudioSinkAdded in the meantime. On Android there is no video-source monitor to start, so only AudioSources and AudioOutputs are ever reported there.

The synchronous overloads raise it on the calling thread. The asynchronous ones raise it from the continuation after their last await, which resumes on the caller's synchronization context - the UI thread when the call was made from one, a thread-pool thread otherwise. A subscriber that cannot assume either has to marshal accordingly.

OnDeviceRemoved

Occurs when a device is removed from the system.

public event EventHandler<EventArgs> OnDeviceRemoved

Event Type

EventHandler<EventArgs>

Remarks

This event is raised when a USB device is disconnected. There is a brief delay (approximately 300ms) to allow pending operations to complete before the event is triggered.

OnVideoSourceAdded

Occurs when a new video capture device (camera/webcam) is added to the system.

public event EventHandler<VideoCaptureDeviceInfo> OnVideoSourceAdded

Event Type

EventHandler<VideoCaptureDeviceInfo>

Remarks

This event is triggered when the device monitor detects a newly connected video capture device. The event argument contains detailed information about the added device including its name, supported formats, resolutions, and API type.

OnVideoSourceRemoved

Occurs when a video capture device (camera/webcam) is removed from the system.

public event EventHandler<VideoCaptureDeviceInfo> OnVideoSourceRemoved

Event Type

EventHandler<VideoCaptureDeviceInfo>

Remarks

This event is triggered when the device monitor detects that a video capture device has been disconnected. The event argument contains information about the removed device.