Agora RTC Objective-C API Reference Refactor

Public Types | Public Member Functions
ICameraCapturer Class Referenceabstract

Inherits RefCountInterface.

## Public Types
enum | CAMERA_SOURCE { CAMERA_BACK, CAMERA_FRONT, CAMERA_EXTRA }
enum | CAMERA_STATE { CAMERA_STARTED, CAMERA_STOPPED }

## Public Member Functions
virtual int | setDeviceOrientation (VIDEO_ORIENTATION orientation, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | setCaptureFormat (const VideoFormat &capture_format, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual VideoFormat | getCaptureFormat ()=0
virtual int | registerCameraObserver (ICameraCaptureObserver *observer, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual int | unregisterCameraObserver (ICameraCaptureObserver *observer)=0

## Detailed Description

The ICameraCapturer class, which provides access to a camera capturer.

## Member Enumeration Documentation

## ◆ CAMERA_SOURCE

enum 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_EXTRA | The camera source is the extra camera.

## ◆ CAMERA_STATE

enum CAMERA_STATE

The camera state.

Enumerator
CAMERA_STARTED | The camera source is started.
CAMERA_STOPPED | The camera source is stopped.

## Constructor & Destructor Documentation

## ◆ ~ICameraCapturer()

~ICameraCapturer | ( |  | ) |
| inline protected

## Member Function Documentation

## ◆ setDeviceOrientation()

virtual int setDeviceOrientation | ( | VIDEO_ORIENTATION | orientation,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| 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 int setCaptureFormat | ( | const VideoFormat & | capture_format,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| 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 getCaptureFormat | ( |  | ) |
| pure virtual

Gets the format of the video captured by the camera.

Returns
  VideoFormat.

## ◆ registerCameraObserver()

virtual int registerCameraObserver | ( | ICameraCaptureObserver * | observer,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Register a camera observer.

Parameters

  observer | Instance of the capture observer.

## ◆ unregisterCameraObserver()

virtual int unregisterCameraObserver | ( | ICameraCaptureObserver * | observer | ) |
| pure virtual

Unregisters the camera observer.

Parameters

  observer | Instance of the capture observer.

## ◆ AddRef()

virtual void AddRef | ( |  | ) | const
| pure virtual inherited

## ◆ Release()

virtual RefCountReleaseStatus Release | ( |  | ) | const
| pure virtual inherited

## ◆ HasOneRef()

virtual bool HasOneRef | ( |  | ) | const
| pure virtual inherited