Agora C++ API Reference for All Platforms

Public Member Functions | List of all members
agora::rtc::IVideoFilter Class Reference

Inherits agora::rtc::IVideoFilterBase.

Inherited by agora::rtc::IExtensionVideoFilter, agora::rtc::IVideoBeautyFilter, and agora::rtc::IVideoFilterEx.

## Public Member Functions
virtual void | setEnabled (bool enable)
virtual bool | isEnabled ()
virtual int | setProperty (const char *key, const void *buf, size_t buf_size)
virtual int | getProperty (const char *key, void *buf, size_t buf_size)
virtual bool | onDataStreamWillStart ()
virtual void | onDataStreamWillStop ()
virtual bool | isExternal ()
virtual bool | isExtensionFilter ()
Public Member Functions inherited from agora::rtc::IVideoFilterBase
virtual bool | adaptVideoFrame (const media::base::VideoFrame &capturedFrame, media::base::VideoFrame &adaptedFrame)=0
Public Member Functions inherited from agora::RefCountInterface
virtual void | AddRef () const =0
virtual RefCountReleaseStatus | Release () const =0
virtual bool | HasOneRef () const =0

## Additional Inherited Members
Protected Member Functions inherited from agora::RefCountInterface
virtual | ~RefCountInterface ()

## Detailed Description

The IVideoFilter class.

This class is the intermediate node for video, which contains both the video source and the video sink. It reads video frames from the underlying video pipeline and writes video frames back after adaptation.

## Member Function Documentation

## ◆ setEnabled()

virtual void agora::rtc::IVideoFilter::setEnabled | ( | bool | enable | ) |
| inline virtual

Enables or disables the video filter.

Parameters

  enable | Whether to enable the video filter: `true`: (Default) Enable the video filter. `false`: Do not enable the video filter. If the filter is disabled, frames will be passed without adaption.

## ◆ isEnabled()

virtual bool agora::rtc::IVideoFilter::isEnabled | ( |  | ) |
| inline virtual

Checks whether the video filter is enabled.

Returns
  - `true`: The video filter is enabled.
  - `false`: The video filter is not enabled.

## ◆ setProperty()

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

## ◆ onDataStreamWillStart()

virtual bool agora::rtc::IVideoFilter::onDataStreamWillStart | ( |  | ) |
| inline virtual

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

Returns
  - `true`: The initialization succeeds.
  - `false`: The initialization fails.

## ◆ onDataStreamWillStop()

virtual void agora::rtc::IVideoFilter::onDataStreamWillStop | ( |  | ) |
| inline virtual

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

## ◆ isExternal()

virtual bool agora::rtc::IVideoFilter::isExternal | ( |  | ) |
| inline virtual

This function indicates if the filter is for internal use.

Note
  Do not override this function.

Returns
  - `true`: The filter is implemented by external users.
  - `false`: The filter is implemented by internal users.

Reimplemented in agora::rtc::IVideoFilterEx.

## ◆ isExtensionFilter()

virtual bool agora::rtc::IVideoFilter::isExtensionFilter | ( |  | ) |
| inline virtual

This function indicates if the filter is implemented by third-party providers.

Note
  Do not override this function.

Returns
  - `true`: The filter is implemented by third-party providers.
  - `false`: otherwise.

Reimplemented in agora::rtc::IExtensionVideoFilter.