Agora RTC Objective-C API Reference Refactor

Public Member Functions
IScreenCapturer Class Referenceabstract

Inherits RefCountInterface.

## Public Member Functions
virtual int | initWithWindowId (view_t windowId, const Rectangle &regionRect)=0
virtual int | setContentHint (VIDEO_CONTENT_HINT contentHint)=0
virtual int | updateScreenCaptureRegion (const Rectangle &regionRect)=0
virtual void | setScreenOrientation (VIDEO_ORIENTATION orientation)=0
virtual void | setFrameRate (int rate)=0

## Detailed Description

The IScreenCapturer class, which provides access to the screen capturer.

## Constructor & Destructor Documentation

## ◆ ~IScreenCapturer()

~IScreenCapturer | ( |  | ) |
| inlineprotected

## Member Function Documentation

## ◆ initWithWindowId()

virtual int initWithWindowId | ( | view_t | windowId,
|  | const Rectangle & | regionRect
| ) |  |
| pure virtual

Initializes the screen capturer by specifying a window ID.

This method shares a whole or part of a window specified by the window ID.

Note
  This method applies to Windows and macOS only.

Parameters

  windowId | The ID of the window to be shared. This parameter specifies which window you want to share.
  regionRect | The reference to the relative location of the region to the window. See agora::rtc::Rectangle &regionRect "regionRect". If the specified region overruns the window, only the region within the screen will be captured. If you set `width` or `height` as 0, the whole window will be captured. Note that the coordinates of rectangle are relative to the window and follows system specifications.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setContentHint()

virtual int setContentHint | ( | VIDEO_CONTENT_HINT | contentHint | ) |
| pure virtual

Sets the content hint for screen sharing.

A content hint suggests the type of the content being shared, so that the SDK applies different optimization algorithms to different types of content.

Parameters

  contentHint | The content hint for screen capture: VIDEO_CONTENT_HINT.

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

## ◆ 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.

## ◆ setScreenOrientation()

virtual void setScreenOrientation | ( | VIDEO_ORIENTATION | orientation | ) |
| pure virtual

Set orientation of the captured screen image

Parameters

  VIDEO_ORIENTATION | orientaion of the device 0(by default), 90, 180, 270

## ◆ setFrameRate()

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

Set frame rate of the screen capture source

Parameters

  rate | frame rate (in fps)

## ◆ AddRef()

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

## ◆ Release()

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

## ◆ HasOneRef()

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