Agora RTC Objective-C API Reference Refactor

Public Member Functions
IVideoRenderer Class Referenceabstract

Inherits IVideoSinkBase.

## Public Member Functions
virtual int | setRenderMode (media::base::RENDER_MODE_TYPE renderMode)=0
virtual int | setRenderMode (void *view, media::base::RENDER_MODE_TYPE renderMode)=0
virtual int | setRotation (agora::rtc::VIDEO_ORIENTATION rotation)=0
virtual int | setRotation (void *view, agora::rtc::VIDEO_ORIENTATION rotation)=0
virtual int | setMirror (bool mirror)=0
virtual int | setMirror (void *view, bool mirror)=0
virtual int | setView (void *view)=0
virtual int | addView (void *view, const Rectangle &cropArea)=0
virtual int | unsetView ()=0
virtual int | removeView (void *view)=0
virtual int | setProperty (const char *key, const void *buf, int buf_size)
virtual int | getProperty (const char *key, void *buf, int buf_size)
virtual int | onFrame (const media::base::VideoFrame &videoFrame)=0
virtual bool | isExternalSink ()
virtual bool | onDataStreamWillStart ()
virtual void | onDataStreamWillStop ()
virtual bool | applyMirror ()
virtual bool | applyRotation ()

## Detailed Description

The `IVideoRenderer` class.

## Member Function Documentation

## ◆ setRenderMode() [1/2]

virtual int setRenderMode | ( | media::base::RENDER_MODE_TYPE | renderMode | ) |
| pure virtual

Sets the render mode.

Parameters

  renderMode | The video render mode.

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

## ◆ setRenderMode() [2/2]

virtual int setRenderMode | ( | void * | view,
|  | media::base::RENDER_MODE_TYPE | renderMode
| ) |  |
| pure virtual

Sets the render mode of the view.

Parameters

  view | the view to set render mode.
  renderMode | The video render mode.

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

## ◆ setRotation() [1/2]

virtual int setRotation | ( | agora::rtc::VIDEO_ORIENTATION | rotation | ) |
| pure virtual

Sets the render rotation.

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

## ◆ setRotation() [2/2]

virtual int setRotation | ( | void * | view,
|  | agora::rtc::VIDEO_ORIENTATION | rotation
| ) |  |
| pure virtual

Sets the render rotation.

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

## ◆ setMirror() [1/2]

virtual int setMirror | ( | bool | mirror | ) |
| pure virtual

Sets whether to mirror the video.

Parameters

  mirror | Whether to mirror the video: `true`: Mirror the video. `false`: Do not mirror the video.

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

## ◆ setMirror() [2/2]

virtual int setMirror | ( | void * | view,
|  | bool | mirror
| ) |  |
| pure virtual

Sets whether to mirror the video.

Parameters

  view | the view to set mirror mode.
  mirror | Whether to mirror the video: `true`: Mirror the video. `false`: Do not mirror the video.

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

## ◆ setView()

virtual int setView | ( | void * | view | ) |
| pure virtual

Sets the video display window.

Parameters

  view | The pointer to the video display window.

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

## ◆ addView()

virtual int addView | ( | void * | view,
|  | const Rectangle & | cropArea
| ) |  |
| pure virtual

Sets the video display window.

Parameters

  view | The pointer to the video display window.
  cropArea | (Optional) Sets the relative location of the region to show. See Rectangle.

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

## ◆ unsetView()

virtual int unsetView | ( |  | ) |
| pure virtual

Stops rendering the video view on the window.

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

## ◆ removeView()

virtual int removeView | ( | void * | view | ) |
| pure virtual

remove rendering the video view on the window.

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

## ◆ setProperty()

virtual int setProperty | ( | const char * | key,
|  | const void * | buf,
|  | int | buf_size
| ) |  |
| inlinevirtualinherited

Sets a private property in the `IVideoFilter` class.

Parameters

  key | The pointer to the property name.
  buf | The pointer to the buffer of this private property.
  buf_size | The buffer size of this private property.

Returns
  - The actual size of the private property, if the method call succeeds.
  - -1, if the method call fails.

## ◆ getProperty()

virtual int getProperty | ( | const char * | key,
|  | void * | buf,
|  | int | buf_size
| ) |  |
| inlinevirtualinherited

Gets a private property in the `IVideoFilter` class.

Parameters

  key | The pointer to the property name.
  buf | The pointer to the buffer of this private property.
  buf_size | The buffer size of this private property.

Returns
  - The actual size of the private property, if the method call succeeds.
  - -1, if the method call fails.

## ◆ onFrame()

virtual int onFrame | ( | const media::base::VideoFrame & | videoFrame | ) |
| pure virtualinherited

Occurs when the `IVideoSinkBase` object receives the video frame.

Parameters

  videoFrame | The reference to the video frame.

## ◆ isExternalSink()

virtual bool isExternalSink | ( |  | ) |
| inlinevirtualinherited

Used internally to distinguish between external and internal sinks. External application should not override this interface.

## ◆ onDataStreamWillStart()

virtual bool onDataStreamWillStart | ( |  | ) |
| inlinevirtualinherited

This function is invoked right before data stream starts. Custom sink can override this function for initialization.

Returns
  - `true`, if initialization succeeds.
  - `false`, if initialization fails.

## ◆ onDataStreamWillStop()

virtual void onDataStreamWillStop | ( |  | ) |
| inlinevirtualinherited

This function is invoked right before data stream stops. Custom sink can override this function for deinitialization.

## ◆ applyMirror()

virtual bool applyMirror | ( |  | ) |
| inlinevirtualinherited

Whether to mirror the video frame.

Returns
  - true: mirror the video frame.
  - false: do not mirror the video frame.

## ◆ applyRotation()

virtual bool applyRotation | ( |  | ) |
| inlinevirtualinherited

Whether to rotate the video frame.

Returns
  - true: rotate the video frame.
  - false: do not rotate the video frame.

## ◆ AddRef()

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

## ◆ Release()

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

## ◆ HasOneRef()

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