Agora RTC Objective-C API Reference Refactor

Public Member Functions
IScreenCapturer2 Class Referenceabstract

Inherits RefCountInterface.

## Public Member Functions
virtual int | setScreenCaptureDimensions (const VideoDimensions &dimensions)=0
virtual int | updateScreenCaptureRegion (const Rectangle &regionRect)=0
virtual int | setFrameRate (int rate)=0
virtual int | setAudioRecordConfig (int channels, int sampleRate)=0
virtual int | setAudioVolume (uint32_t volume)=0

## Constructor & Destructor Documentation

## ◆ ~IScreenCapturer2()

virtual ~IScreenCapturer2 | ( |  | ) |
| inlineprotectedvirtual

## Member Function Documentation

## ◆ setScreenCaptureDimensions()

virtual int setScreenCaptureDimensions | ( | const VideoDimensions & | dimensions | ) |
| pure virtual

Screen capture's resolution.

Parameters

  dimensions | The reference to the captured screen's resolution in terms of width × height. If you set `width` or `height` as 0, the dimensions will be the screen's width × height.

Returns
  - 0: Success.
  - < 0: Failure.
    - ERR_INVALID_ARGUMENT if data is null.

## ◆ updateScreenCaptureRegion()

virtual int updateScreenCaptureRegion | ( | const Rectangle & | regionRect | ) |
| pure virtual

Updates the screen capture region.

Parameters

  regionRect | The reference to the relative location of the region to the screen or window. See Rectangle. If the specified region overruns the screen or window, the screen capturer captures only the region within it. If you set `width` or `height` as 0, the SDK shares the whole screen or window.

Returns
  - 0: Success.
  - < 0: Failure.
    - No screen or window is being shared.

## ◆ setFrameRate()

virtual int setFrameRate | ( | int | rate | ) |
| pure virtual

Set frame rate of the screen capture source

Parameters

  rate | frame rate (in fps)

## ◆ setAudioRecordConfig()

virtual int setAudioRecordConfig | ( | int | channels,
|  | int | sampleRate
| ) |  |
| pure virtual

Set channels and sample rate of screen audio capturing

Parameters

  channels | channels of system audio capture
  sampleRate | sample rate of system audio capture

Returns
  - 0: Sucess.
  - < 0: Failure

## ◆ setAudioVolume()

virtual int setAudioVolume | ( | uint32_t | volume | ) |
| pure virtual

Set volume of screen audio capturing

Parameters

  volume | volume of system audio capture

Returns
  - 0: Sucess.
  - < 0: Failure

## ◆ AddRef()

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

## ◆ Release()

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

## ◆ HasOneRef()

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