Agora Java API Reference for Android

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

`#include <NGIAgoraMediaNode.h>`

Inheritance diagram for agora::rtc::IVideoSinkBase:

## Public Member Functions
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 ()
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 `IVideoSinkBase` class is the base class for the custom video sink.

## Member Function Documentation

## ◆ setProperty()

virtual int agora::rtc::IVideoSinkBase::setProperty | ( | const char * | key,
|  | const void * | buf,
|  | int | buf_size
| ) |  |
| virtual

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 agora::rtc::IVideoSinkBase::getProperty | ( | const char * | key,
|  | void * | buf,
|  | int | buf_size
| ) |  |
| virtual

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 agora::rtc::IVideoSinkBase::onFrame | ( | const media::base::VideoFrame & | videoFrame | ) |
| pure virtual

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

Parameters

  videoFrame | The reference to the video frame.

## ◆ isExternalSink()

virtual bool agora::rtc::IVideoSinkBase::isExternalSink | ( |  | ) |
| virtual

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

## ◆ onDataStreamWillStart()

virtual bool agora::rtc::IVideoSinkBase::onDataStreamWillStart | ( |  | ) |
| virtual

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 agora::rtc::IVideoSinkBase::onDataStreamWillStop | ( |  | ) |
| virtual

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

## ◆ applyMirror()

virtual bool agora::rtc::IVideoSinkBase::applyMirror | ( |  | ) |
| virtual

Whether to mirror the video frame.

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

## ◆ applyRotation()

virtual bool agora::rtc::IVideoSinkBase::applyRotation | ( |  | ) |
| virtual

Whether to rotate the video frame.

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