Agora C++ API Reference for All Platforms
agora::rtc::IVideoDeviceManager Class Referenceabstract

#include <IAgoraRtcEngine.h>

Public Member Functions

virtual IVideoDeviceCollectionenumerateVideoDevices ()=0
 
virtual int startDeviceTest (view_t hwnd)=0
 
virtual int stopDeviceTest ()=0
 
virtual int setDevice (const char deviceId[MAX_DEVICE_ID_LENGTH])=0
 
virtual int getDevice (char deviceId[MAX_DEVICE_ID_LENGTH])=0
 
virtual void release ()=0
 

Protected Member Functions

virtual ~IVideoDeviceManager ()
 

Detailed Description

Video device management methods.

The IVideoDeviceManager interface class tests the video device interfaces. Instantiate an AVideoDeviceManager class to get an IVideoDeviceManager interface.

Constructor & Destructor Documentation

◆ ~IVideoDeviceManager()

virtual agora::rtc::IVideoDeviceManager::~IVideoDeviceManager ( )
inlineprotectedvirtual

Member Function Documentation

◆ enumerateVideoDevices()

virtual IVideoDeviceCollection * agora::rtc::IVideoDeviceManager::enumerateVideoDevices ( )
pure virtual

Enumerates the video devices (for macOS and Windows only).

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

Returns

◆ startDeviceTest()

virtual int agora::rtc::IVideoDeviceManager::startDeviceTest ( view_t  hwnd)
pure virtual

Starts the video-capture device test (for macOS and Windows only).

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

Parameters
hwndThe window handle used to display the screen.
Returns
  • 0: Success.
  • < 0: Failure.

◆ stopDeviceTest()

virtual int agora::rtc::IVideoDeviceManager::stopDeviceTest ( )
pure virtual

Stops the video-capture device test (for macOS and Windows only).

Returns
  • 0: Success.
  • < 0: Failure.

◆ setDevice()

virtual int agora::rtc::IVideoDeviceManager::setDevice ( const char  deviceId[MAX_DEVICE_ID_LENGTH])
pure virtual

Sets a device with the device ID (for macOS and Windows only).

Parameters
deviceIdPointer to the video-capture device ID. Call the enumerateVideoDevices method to get it.
Note
Plugging or unplugging the device does not change the device ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getDevice()

virtual int agora::rtc::IVideoDeviceManager::getDevice ( char  deviceId[MAX_DEVICE_ID_LENGTH])
pure virtual

Gets the video-capture device that is in use (for macOS and Windows only).

Parameters
deviceIdPointer to the video-capture device ID.
Returns
  • 0: Success.
  • < 0: Failure.

◆ release()

virtual void agora::rtc::IVideoDeviceManager::release ( )
pure virtual

Releases all IVideoDeviceManager resources (for macOS and Windows only).