IVideoDeviceManager
Video device management methods.
EnumerateVideoDevices
Enumerates the video devices.
public abstract DeviceInfo[] EnumerateVideoDevices();
Details
Returns
- Success: A DeviceInfo array including all video devices in the system.
- Failure: An empty array.
GetCapability
Gets the detailed video frame information of the video capture device in the specified video format.
public abstract int GetCapability(string deviceIdUTF8, uint deviceCapabilityNumber, out VideoFormat capability);
Details
After calling NumberOfCapabilities to get the number of video formats supported by the video capture device, you can call this method to get the specific video frame information supported by the specified index number.
Parameters
- deviceIdUTF8
- The ID of the video capture device.
- deviceCapabilityNumber
- The index number of the video format. If the return value of NumberOfCapabilities is i, the value range of this parameter is [0,i).
- capability
- An output parameter. Indicates the specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat.
Returns
- 0: Success.
- < 0: Failure.
GetDevice
Retrieves the current video capture device.
public abstract int GetDevice(ref string deviceIdUTF8);
Details
Parameters
- deviceIdUTF8
- An output parameter. The device ID.
Returns
- 0: Success.
- < 0: Failure.
NumberOfCapabilities
Gets the number of video formats supported by the specified video capture device.
public abstract int NumberOfCapabilities(string deviceIdUTF8);
Details
Video capture devices may support multiple video formats, and each format supports different combinations of video frame width, video frame height, and frame rate.
You can call this method to get how many video formats the specified video capture device can support, and then call GetCapability to get the specific video frame information in the specified video format.
Parameters
- deviceIdUTF8
- The ID of the video capture device.
Returns
- > 0: Success. Returns the number of video formats supported by this device. For example: If the specified camera supports 10 different video formats, the return value is 10.
- ≤ 0: Failure.
SetDevice
Specifies the video capture device with the device ID.
public abstract int SetDevice(string deviceIdUTF8);
Details
- Plugging or unplugging a device does not change its device ID.
- This method is for Windows and macOS only.
Parameters
- deviceIdUTF8
-
The device ID. You can get the device ID by calling EnumerateVideoDevices.
Returns
- 0: Success.
- < 0: Failure.