IVideoDeviceManager
Video device management methods.
EnumerateVideoDevices
Gets a list of all video devices on the system.
public abstract DeviceInfo[] EnumerateVideoDevices();
Return Values
- On success: Returns a DeviceInfo array that contains all video devices on the system.
- On failure: Returns an empty list.
GetCapability
Gets detailed video frame information for the specified video format of the video capture device.
public abstract int GetCapability(string deviceIdUTF8, uint deviceCapabilityNumber, out VideoFormat capability);
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 for the specified index.
Parameters
- deviceIdUTF8
- The ID of the video capture device.
- deviceCapabilityNumber
- The index of the video format. If the return value of NumberOfCapabilities is i, then the value range of this parameter is [0, i).
- capability
- Output parameter. Indicates the specific information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat.
Return Values
- 0: Success.
- < 0: Failure. See Error Codes for details and resolution suggestions.
GetDevice
Gets the currently used video capture device.
public abstract int GetDevice(ref string deviceIdUTF8);
Parameters
- deviceIdUTF8
- Output parameter. Device ID.
Return Values
- 0: Success.
- < 0: Failure. See Error Codes for details and resolution suggestions.
NumberOfCapabilities
Gets the number of video formats supported by the specified video capture device.
public abstract int NumberOfCapabilities(string deviceIdUTF8);
A video capture device may support multiple video formats, each with different combinations of frame width, frame height, and frame rate. You can call this method to get how many video formats are supported by the specified video capture device, and then call GetCapability to get detailed video frame information for each format.
Parameters
- deviceIdUTF8
- ID of the video capture device.
Return Values
- > 0: Success. Returns the number of video formats supported by the device. For example, if the specified camera supports 10 different formats, the return value is 10.
- ≤ 0: Failure. See Error Codes for details and resolution suggestions.
SetDevice
Specifies the video capture device by device ID.
public abstract int SetDevice(string deviceIdUTF8);
- Plugging or unplugging a device does not change its device ID.
- (Windows and macOS only)
Parameters
- deviceIdUTF8
- Device ID. You can get it by calling the EnumerateVideoDevices method.
Return Values
- 0: Success.
- < 0: Failure. See Error Codes for details and resolution suggestions.