Table of Contents

Class VideoCaptureDeviceInfo

Namespace
VisioForge.Core.Types.VideoCapture
Assembly
VisioForge.Core.dll

Provides comprehensive information about a video capture device and its capabilities.

public class VideoCaptureDeviceInfo

Inheritance

Inherited Members

Remarks

This class implements a lazy-loading pattern where detailed device information is only retrieved when first accessed. It contains information about supported video/audio formats, available dialogs, crossbar support, and other device-specific capabilities.

Constructors

VideoCaptureDeviceInfo(string)

Initializes a new instance of the VisioForge.Core.Types.VideoCapture.VideoCaptureDeviceInfo class.

public VideoCaptureDeviceInfo(string name)

Parameters

name string

The display name of the video capture device.

Properties

AudioFormats

Gets the list of supported audio formats if the device has audio capabilities.

public List<string> AudioFormats { get; }

Property Value

List<string>

Remarks

This property triggers lazy initialization when first accessed. Only populated if VisioForge.Core.Types.VideoCapture.VideoCaptureDeviceInfo.AudioOutput is true.

AudioOutput

Gets a value indicating whether the video capture device has an audio output pin.

public bool AudioOutput { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. Some video capture devices include built-in microphones or audio inputs.

CrossbarAvailable

Gets a value indicating whether a crossbar is available for input switching.

public bool CrossbarAvailable { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. Crossbars are typically found in capture cards that support multiple input sources.

DevicePath

Gets the system path or identifier for the device.

public string DevicePath { get; }

Property Value

string

Remarks

This property triggers lazy initialization when first accessed.

DeviceType

Gets the type of the capture device.

public DeviceType DeviceType { get; }

Property Value

DeviceType

Remarks

This property triggers lazy initialization when first accessed.

DialogCaptureDisplay

Gets a value indicating whether the device supports a capture display configuration dialog.

public bool DialogCaptureDisplay { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. This dialog typically controls display-related settings during capture.

DialogCaptureFormat

Gets a value indicating whether the device supports a capture format configuration dialog.

public bool DialogCaptureFormat { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. This dialog allows configuration of video format, resolution, and frame rate.

DialogCaptureSource

Gets a value indicating whether the device supports a capture source configuration dialog.

public bool DialogCaptureSource { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. This dialog typically controls input source selection and device-specific settings.

DialogCompressorAbout

Gets a value indicating whether the device supports a compressor information dialog.

public bool DialogCompressorAbout { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. This dialog typically displays information about the compression codec.

DialogCompressorConfig

Gets a value indicating whether the device supports a compressor configuration dialog.

public bool DialogCompressorConfig { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed. This dialog allows configuration of compression settings if the device includes hardware compression.

DialogDefault

Gets a value indicating whether the device supports a default configuration dialog.

public bool DialogDefault { get; }

Property Value

bool

Remarks

This property triggers lazy initialization when first accessed.

Initiated

Gets a value indicating whether the device information has been initialized.

public bool Initiated { get; }

Property Value

bool

Remarks

Used internally to track the lazy initialization state.

Name

Gets or sets the display name of the video capture device.

public string Name { get; set; }

Property Value

string

TVTuner

Gets the name of the associated TV tuner, if any.

public string TVTuner { get; }

Property Value

string

Remarks

This property triggers lazy initialization when first accessed.

VideoFormats

Gets the list of supported video formats from the primary output pin.

public List<VideoCaptureDeviceFormat> VideoFormats { get; }

Property Value

List<VideoCaptureDeviceFormat>

Remarks

This property triggers lazy initialization when first accessed. The formats include various resolutions, frame rates, and pixel formats supported by the device.

VideoFormatsAllPins

Gets the video formats available on all output pins of the device.

public List<Tuple<string, List<VideoCaptureDeviceFormat>>> VideoFormatsAllPins { get; }

Property Value

List<Tuple<string, List<VideoCaptureDeviceFormat>>>

Remarks

This property triggers lazy initialization when first accessed. Some devices may have multiple output pins with different format capabilities.

Methods

CanStart()

Checks whether the device can start capture or preview operations.

public bool CanStart()

Returns

bool

true if the device can start; otherwise, false.

Remarks

This method raises the VisioForge.Core.Types.VideoCapture.VideoCaptureDeviceInfo.OnCanStart event to allow external validation.

Fill(string, DeviceType, string, bool, bool, List<VideoCaptureDeviceFormat>, List<Tuple<string, List<VideoCaptureDeviceFormat>>>, List<string>)

Populates the device information with capability details.

public void Fill(string devicePath, DeviceType deviceType, string tvTuner, bool audioOutput, bool crossbar, List<VideoCaptureDeviceFormat> videoFormats, List<Tuple<string, List<VideoCaptureDeviceFormat>>> videoFormatsAllPins, List<string> audioFormats)

Parameters

devicePath string

The system path or identifier for the device.

deviceType DeviceType

The type of capture device.

tvTuner string

The name of any associated TV tuner.

audioOutput bool

Indicates whether the device has audio output capabilities.

crossbar bool

Indicates whether a crossbar is available for input switching.

videoFormats List<VideoCaptureDeviceFormat>

List of supported video formats from the primary pin.

videoFormatsAllPins List<Tuple<string, List<VideoCaptureDeviceFormat>>>

Video formats for all output pins.

audioFormats List<string>

List of supported audio formats.

FillDialogs(bool, bool, bool, bool, bool, bool)

Sets the availability of various device configuration dialogs.

public void FillDialogs(bool default_, bool captureDisplay, bool captureFormat, bool captureSource, bool compressorConfig, bool compressorAbout)

Parameters

default_ bool

Indicates if a default property page is available.

captureDisplay bool

Indicates if a capture display property page is available.

captureFormat bool

Indicates if a capture format property page is available.

captureSource bool

Indicates if a capture source property page is available.

compressorConfig bool

Indicates if a compressor configuration property page is available.

compressorAbout bool

Indicates if a compressor about property page is available.

GetHDFormat()

Attempts to find and return the best HD format supported by the device.

public Tuple<VideoCaptureDeviceFormat, VideoFrameRate> GetHDFormat()

Returns

Tuple<VideoCaptureDeviceFormat, VideoFrameRate>

A tuple containing the HD format and preferred frame rate, or null if no HD format is available.

Remarks

This method prioritizes 1920x1080 (Full HD) over 1280x720 (HD) and prefers 30fps over 25fps. If the preferred frame rates are not available, it returns the first available frame rate.

ToString()

Returns a string representation of the device.

public override string ToString()

Returns

string

The device name.

OnCanStart

Occurs when checking if the device can start capture or preview.

public event EventHandler<OnDeviceCanStartEventArgs> OnCanStart

Event Type

EventHandler<OnDeviceCanStartEventArgs>

Remarks

Subscribers can use this event to perform additional validation before device usage.

OnInitiateRequired

Occurs when device information needs to be initialized.

public event EventHandler<EventArgs> OnInitiateRequired

Event Type

EventHandler<EventArgs>

Remarks

This event is raised when any property requiring device details is accessed for the first time.