IVideoDeviceManager

Video device management methods.

enumerateVideoDevices

Gets the list of all video devices in the system.

abstract enumerateVideoDevices(): VideoDeviceInfo[];

Return Values

  • If the method call succeeds: returns an array of VideoDeviceInfo containing all video devices in the system.
  • If the method call fails: returns an empty list.

getCapability

Gets the detailed video frame information of the video capture device under the specified video format.

abstract getCapability(
    deviceIdUTF8: string,
    deviceCapabilityNumber: number
  ): VideoFormat;

After calling numberOfCapabilities to get the number of supported video formats of the video capture device, you can call this method to get the detailed video frame information supported by 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, the valid range for this parameter is [0, i).

Return Values

Detailed information of the specified video format, including width (px), height (px), and frame rate (fps). See VideoFormat.

getDevice

Gets the currently used video capture device.

abstract getDevice(): string;

Return Values

The video capture device.

numberOfCapabilities

Gets the number of video formats supported by the specified video capture device.

abstract numberOfCapabilities(deviceIdUTF8: string): number;

A video capture device may support multiple video formats, each supporting different combinations of frame width, frame height, and frame rate. You can call this method to get the number of video formats supported by the specified video capture device, and then call getCapability to get the specific frame information under a given format.

Parameters

deviceIdUTF8
The ID of the video capture device.

Return Values

  • > 0: The method call succeeds. Returns the number of video formats supported by the device. For example, if the specified camera supports 10 different video formats, the return value is 10.
  • ≤ 0: The method call fails. See Error Codes for details and resolution suggestions.

setDevice

Specifies the video capture device by device ID.

abstract setDevice(deviceIdUTF8: string): number;
Note:
  • Plugging or unplugging the device does not change the device ID.

Parameters

deviceIdUTF8
Device ID. You can get it by calling the enumerateVideoDevices method. Maximum length is MaxDeviceIdLengthType.

Return Values

  • 0: The method call succeeds.
  • < 0: The method call fails. See Error Codes for details and resolution suggestions.