Agora RTC Objective-C API Reference Refactor

Public Member Functions
ICameraCaptureObserver Class Reference

## Public Member Functions
virtual void | onCameraFocusAreaChanged (int imageWidth, int imageHeight, int x, int y)
virtual void | onFacePositionChanged (int imageWidth, int imageHeight, const Rectangle *vecRectangle, const int *vecDistance, int numFaces)
virtual void | onCameraExposureAreaChanged (int x, int y, int width, int height)

## Detailed Description

The ICameraCaptureObserver class, which handles camera capture events.

## Constructor & Destructor Documentation

## ◆ ~ICameraCaptureObserver()

virtual ~ICameraCaptureObserver | ( |  | ) |
| inlineprotectedvirtual

## Member Function Documentation

## ◆ onCameraFocusAreaChanged()

virtual void onCameraFocusAreaChanged | ( | int | imageWidth,
|  | int | imageHeight,
|  | int | x,
|  | int | y
| ) |  |
| inlinevirtual

Occurs when the camera focus area changes.

Note
  The SDK triggers this callback when the local user changes the camera focus position by calling the setCameraFocus method.

Parameters

  imageWidth | Width of the changed camera focus area.
  imageHeight | Height of the changed camera focus area.
  x | x coordinate of the changed camera focus area.
  y | y coordinate of the changed camera focus area.

## ◆ onFacePositionChanged()

virtual void onFacePositionChanged | ( | int | imageWidth,
|  | int | imageHeight,
|  | const Rectangle * | vecRectangle,
|  | const int * | vecDistance,
|  | int | numFaces
| ) |  |
| inlinevirtual

Reports the face detection result of the local user. Applies to Android and iOS only.

Once you enable face detection by calling setCameraFaceDetection (true), you can get the following information on the local user in real-time:

- The width and height of the local video.
- The position of the human face in the local video.
- The distance between the human face and the device screen. This value is based on the fitting calculation of the local video size and the position of the human face.

Note
  - If the SDK does not detect a face, it reduces the frequency of this callback to reduce power consumption on the local device.
  - The SDK stops triggering this callback when a human face is in close proximity to the screen.
  - On Android, the distance value reported in this callback may be slightly different from the actual distance. Therefore, Agora does not recommend using it for accurate calculation.

Parameters

  imageWidth | The width (px) of the local video.
  imageHeight | The height (px) of the local video.
  vecRectangle | A Rectangle array of length 'numFaces', which represents the position and size of the human face on the local video： `x`: The x coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the x coordinate represents the relative lateral displacement of the top left corner of the human face to the origin. `y`: The y coordinate (px) of the human face in the local video. Taking the top left corner of the captured video as the origin, the y coordinate represents the relative longitudinal displacement of the top left corner of the human face to the origin. `width`: The width (px) of the human face in the captured video. `height`: The height (px) of the human face in the captured video.
  vecDistance | An int array of length 'numFaces', which represents distance (cm) between the human face and the screen.
  numFaces | The number of faces detected. If the value is 0, it means that no human face is detected.

## ◆ onCameraExposureAreaChanged()

virtual void onCameraExposureAreaChanged | ( | int | x,
|  | int | y,
|  | int | width,
|  | int | height
| ) |  |
| inlinevirtual

Occurs when the camera exposure area changes.

The SDK triggers this callback when the local user changes the camera exposure position by calling the setCameraExposurePosition method.

Note
  This callback is for Android and iOS only.

Parameters

  x | x coordinate of the changed camera exposure area.
  y | y coordinate of the changed camera exposure area.
  width | Width of the changed camera exposure area.
  height | Height of the changed camera exposure area.

## ◆ onCameraStateChanged()

virtual void onCameraStateChanged | ( | ICameraCapturer::CAMERA_STATE | state,
|  | ICameraCapturer::CAMERA_SOURCE | source
| ) |  |
| inlinevirtual