Agora RTC Objective-C API Reference Refactor

Public Member Functions
IVideoDeviceManager Class Referenceabstract

## Public Member Functions
virtual IVideoDeviceCollection * | enumerateVideoDevices ()=0
virtual int | setDevice (const char deviceIdUTF8[MAX_DEVICE_ID_LENGTH])=0
virtual int | getDevice (char deviceIdUTF8[MAX_DEVICE_ID_LENGTH])=0
virtual int | startDeviceTest (view_t hwnd)=0
virtual int | stopDeviceTest ()=0
virtual void | release ()=0

## Detailed Description

The IVideoDeviceManager class.

## Constructor & Destructor Documentation

## ◆ ~IVideoDeviceManager()

virtual ~IVideoDeviceManager | ( |  | ) |
| inlinevirtual

## Member Function Documentation

## ◆ enumerateVideoDevices()

virtual IVideoDeviceCollection* enumerateVideoDevices | ( |  | ) |
| pure virtual

Enumerates the video devices.

This method returns an `IVideoDeviceCollection` object including all video devices in the system. With the `IVideoDeviceCollection` object, the application can enumerate video devices. The application must call the release method to release the returned object after using it.

Returns
  - Success: An `IVideoDeviceCollection` object including all video devices in the system.
  - Failure: NULL.

## ◆ setDevice()

virtual int setDevice | ( | const char | deviceIdUTF8[MAX_DEVICE_ID_LENGTH] | ) |
| pure virtual

Specifies the video capture device with the device ID.

Parameters

  deviceIdUTF8 | he device ID. You can get the device ID by calling `enumerateVideoDevices`. The maximum length is #MAX_DEVICE_ID_LENGTH.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ getDevice()

virtual int getDevice | ( | char | deviceIdUTF8[MAX_DEVICE_ID_LENGTH] | ) |
| pure virtual

Retrieves the current video capture device.

Parameters

  deviceIdUTF8 | Output parameter. The device ID. The maximum length is #MAX_DEVICE_ID_LENGTH_TYPE.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ startDeviceTest()

virtual int startDeviceTest | ( | view_t | hwnd | ) |
| pure virtual

Starts the video capture device test.

This method tests whether the video capture device works properly. Before calling this method, ensure that you have already called enableVideo, and the HWND window handle of the incoming parameter is valid.

Parameters

  hwnd | An Output parameter that specifies the window handle to display the video.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ stopDeviceTest()

virtual int stopDeviceTest | ( |  | ) |
| pure virtual

Stops the video capture device test.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ release()

virtual void release | ( |  | ) |
| pure virtual

Releases all the resources occupied by the `IVideoDeviceManager` object.