Agora Java API Reference for Android

Public Types | Public Member Functions | List of all members
agora::rtc::ICameraCapturer Class Referenceabstract

`#include <NGIAgoraCameraCapturer.h>`

Inheritance diagram for agora::rtc::ICameraCapturer:

## 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
Public Member Functions inherited from agora::RefCountInterface
virtual void | AddRef () const =0
virtual RefCountReleaseStatus | Release () const =0
virtual bool | HasOneRef () const =0

## Detailed Description

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

## Member Enumeration Documentation

## ◆ CAMERA_SOURCE

enum agora::rtc::ICameraCapturer::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 agora::rtc::ICameraCapturer::CAMERA_STATE

The camera state.

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

## Member Function Documentation

## ◆ setDeviceOrientation()

virtual int agora::rtc::ICameraCapturer::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 agora::rtc::ICameraCapturer::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 agora::rtc::ICameraCapturer::getCaptureFormat | ( |  | ) |
| pure virtual

Gets the format of the video captured by the camera.

Returns
  VideoFormat.

## ◆ registerCameraObserver()

virtual int agora::rtc::ICameraCapturer::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 agora::rtc::ICameraCapturer::unregisterCameraObserver | ( | ICameraCaptureObserver * | observer | ) |
| pure virtual

Unregisters the camera observer.

Parameters

  observer | Instance of the capture observer.