Inherits agora::RefCountInterface.
Inherited by agora::rtc::ICameraCapturerEx.
The ICameraCapturer class, which provides access to a camera capturer.
◆ CAMERA_SOURCE
The camera source.
Enumerator |
---|
CAMERA_BACK | The camera source is the rear camera.
|
CAMERA_FRONT | The camera source is the front camera.
|
◆ CAMERA_STATE
The camera state.
Enumerator |
---|
CAMERA_STARTED | The camera source is started.
|
CAMERA_STOPPED | The camera source is stopped.
|
◆ ~ICameraCapturer()
agora::rtc::ICameraCapturer::~ICameraCapturer |
( |
| ) |
|
|
inlineprotected |
◆ setCameraSource()
virtual int agora::rtc::ICameraCapturer::setCameraSource |
( |
CAMERA_SOURCE |
source | ) |
|
|
pure virtual |
Sets the camera source.
- Note
- This method applies to Android and iOS only.
- Parameters
-
source | The camera source that you want to capture. See CAMERA_SOURCE. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getCameraSource()
virtual CAMERA_SOURCE agora::rtc::ICameraCapturer::getCameraSource |
( |
| ) |
|
|
pure virtual |
Gets the camera source.
- Note
- This method applies to Android and iOS only.
- Returns
- The camera source. See CAMERA_SOURCE.
◆ switchCamera()
virtual void agora::rtc::ICameraCapturer::switchCamera |
( |
| ) |
|
|
pure virtual |
Switch the camera source
- Note
- This method applies to Android and iOS only.
◆ isZoomSupported()
virtual bool agora::rtc::ICameraCapturer::isZoomSupported |
( |
| ) |
|
|
pure virtual |
Returns whether zooming is supported by the current device.
- Note
- This method applies to Android and iOS only. This interface returns valid values only after the device is initialized.
- Returns
- true: zooming is supported.
- false: zooming is not supported or device is not initialized.
◆ setCameraZoom()
virtual int32_t agora::rtc::ICameraCapturer::setCameraZoom |
( |
float |
zoomValue | ) |
|
|
pure virtual |
Sets the zooming factor of the device.
- Note
- This method applies to Android and iOS only.
- Parameters
-
zoomValue | The zooming factor of the device. |
- Returns
- 0: Success.
- < 0: Failure.
◆ getCameraMaxZoom()
virtual float agora::rtc::ICameraCapturer::getCameraMaxZoom |
( |
| ) |
|
|
pure virtual |
Gets the max zooming factor of the device.
- Note
- This method applies to Android and iOS only.
- Returns
- The max zooming factor of the device
◆ isFocusSupported()
virtual bool agora::rtc::ICameraCapturer::isFocusSupported |
( |
| ) |
|
|
pure virtual |
Returns whether auto-focus is supported by the current device.
- Note
- This method applies to Android and iOS only. This interface returns valid values only after device is initialized.
- Returns
- true: auto-focus is supported.
- false: auto-focus is not supported or device is not initialized.
◆ setCameraFocus()
virtual int32_t agora::rtc::ICameraCapturer::setCameraFocus |
( |
float |
x, |
|
|
float |
y |
|
) |
| |
|
pure virtual |
Sets the focus area of the current device.
- Note
- This method applies to Android and iOS only.
- Returns
- 0: Success.
- < 0: Failure.
◆ isAutoFaceFocusSupported()
virtual bool agora::rtc::ICameraCapturer::isAutoFaceFocusSupported |
( |
| ) |
|
|
pure virtual |
Returns whether auto face focus is supported by the current device.
- Note
- This method applies to Android and iOS only. This interface returns valid values only after device is initialized.
- Returns
- true: auto-face-focus is supported.
- false: auto-face-focus is not supported or device is not initialized.
◆ setCameraAutoFaceFocus()
virtual int32_t agora::rtc::ICameraCapturer::setCameraAutoFaceFocus |
( |
bool |
enable | ) |
|
|
pure virtual |
Enables or disables auto face focus.
- Note
- This method applies to Android and iOS only. This interface returns valid values only after device is initialized.
- Returns
-
◆ enableFaceDetection()
virtual int32_t agora::rtc::ICameraCapturer::enableFaceDetection |
( |
bool |
enable | ) |
|
|
pure virtual |
Enables or disables auto face detection.
- Note
- This method applies to Android and iOS only. This interface returns valid values only after device is initialized.
- Returns
-
◆ isCameraFaceDetectSupported()
virtual bool agora::rtc::ICameraCapturer::isCameraFaceDetectSupported |
( |
| ) |
|
|
pure virtual |
Checks whether the camera face detect is supported.
- Returns
- true: The camera face detect is supported.
- false: The camera face detect is not supported.
◆ isCameraTorchSupported()
virtual bool agora::rtc::ICameraCapturer::isCameraTorchSupported |
( |
| ) |
|
|
pure virtual |
Checks whether the camera flash function is supported.
- Returns
- true: The camera flash function is supported.
- false: The camera flash function is not supported.
◆ setCameraTorchOn()
virtual int agora::rtc::ICameraCapturer::setCameraTorchOn |
( |
bool |
isOn | ) |
|
|
pure virtual |
Enables the camera flash.
- Parameters
-
isOn | Determines whether to enable the camera flash.
- true: Enable the flash.
- false: Do not enable the flash.
|
◆ isCameraExposurePositionSupported()
virtual bool agora::rtc::ICameraCapturer::isCameraExposurePositionSupported |
( |
| ) |
|
|
pure virtual |
Checks whether the camera exposure function is supported.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
- Since
- v2.3.2.
- Returns
-
true: The device supports the camera exposure function.
-
false: The device does not support the camera exposure function.
◆ setCameraExposurePosition()
virtual int agora::rtc::ICameraCapturer::setCameraExposurePosition |
( |
float |
positionXinView, |
|
|
float |
positionYinView |
|
) |
| |
|
pure virtual |
Sets the camera exposure position.
Ensure that you call this method after the camera starts, for example, by calling startPreview
or joinChannel
.
A successful setCameraExposurePosition method call triggers the onCameraExposureAreaChanged callback on the local client.
- Since
- v2.3.2.
- Parameters
-
positionXinView | The horizontal coordinate of the touch point in the view. |
positionYinView | The vertical coordinate of the touch point in the view. |
- Returns
-
0: Success.
-
< 0: Failure.
◆ isCameraAutoExposureFaceModeSupported()
virtual bool agora::rtc::ICameraCapturer::isCameraAutoExposureFaceModeSupported |
( |
| ) |
|
|
pure virtual |
Checks whether the camera auto exposure function is supported.
- Returns
- true: The camera auto exposure function is supported.
- false: The camera auto exposure function is not supported.
◆ setCameraAutoExposureFaceModeEnabled()
virtual int agora::rtc::ICameraCapturer::setCameraAutoExposureFaceModeEnabled |
( |
bool |
enabled | ) |
|
|
pure virtual |
Enables the camera auto exposure face function.
- Parameters
-
enabled | Determines whether to enable the camera auto exposure face mode.
- true: Enable the auto exposure face function.
- false: Do not enable the auto exposure face function.
|
- Returns
-
0: Success.
-
< 0: Failure.
◆ createDeviceInfo()
virtual IDeviceInfo* agora::rtc::ICameraCapturer::createDeviceInfo |
( |
| ) |
|
|
pure virtual |
Creates a DeviceInfo object.
- Note
- This method applies to Windows, macOS, and Linux only.
- Returns
- The pointer to IDeviceInfo: Success.
- An empty pointer NULL: Failure.
◆ initWithDeviceId()
virtual int agora::rtc::ICameraCapturer::initWithDeviceId |
( |
const char * |
deviceId | ) |
|
|
pure virtual |
Initializes the device with the device ID.
- Note
- This method applies to Windows, macOS, and Linux only.
- Parameters
-
deviceId | The pointer to the device ID. |
- Returns
- 0: Success.
- < 0: Failure.
◆ initWithDeviceName()
virtual int agora::rtc::ICameraCapturer::initWithDeviceName |
( |
const char * |
deviceName | ) |
|
|
pure virtual |
Initializes the device with the device name.
- Note
- This method applies to Windows, macOS, and Linux only.
- Parameters
-
deviceName | The pointer to the device name. |
- Returns
- 0: Success.
- < 0: Failure.
◆ setDeviceOrientation()
virtual void agora::rtc::ICameraCapturer::setDeviceOrientation |
( |
VIDEO_ORIENTATION |
orientation | ) |
|
|
pure virtual |
Set the device orientation of the capture device
- Parameters
-
VIDEO_ORIENTATION | orientaion of the device 0(by default), 90, 180, 270 |
◆ setCaptureFormat()
virtual void agora::rtc::ICameraCapturer::setCaptureFormat |
( |
const VideoFormat & |
capture_format | ) |
|
|
pure virtual |
Sets the format of the video captured by the camera.
If you do not set the video capturing format, the SDK automatically chooses a proper format according to the video encoder configuration of the video track.
- Parameters
-
capture_format | The reference to the video format: VideoFormat. |
◆ getCaptureFormat()
virtual VideoFormat agora::rtc::ICameraCapturer::getCaptureFormat |
( |
| ) |
|
|
pure virtual |
Gets the format of the video captured by the camera.
- Returns
- VideoFormat.
◆ registerCameraObserver()
Register a camera observer.
- Parameters
-
observer | Instance of the capture observer. |
◆ unregisterCameraObserver()
Unregisters the camera observer.
- Parameters
-
observer | Instance of the capture observer. |