Agora RTC Objective-C API Reference  Refactor
Public Member Functions
IVideoFilter Class Referenceabstract

Inherits IVideoFilterBase.

Inherited by IExtensionVideoFilter, and IVideoBeautyFilter.

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 ()
 
virtual bool adaptVideoFrame (const media::base::VideoFrame &capturedFrame, media::base::VideoFrame &adaptedFrame)=0
 

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 setEnabled ( bool  enable)
inlinevirtual

Enables or disables the video filter.

Parameters
enableWhether 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 isEnabled ( )
inlinevirtual

Checks whether the video filter is enabled.

Returns
  • true: The video filter is enabled.
  • false: The video filter is not enabled.

◆ setProperty()

virtual int setProperty ( const char *  key,
const void *  buf,
size_t  buf_size 
)
inlinevirtual

Sets a private property in the IVideoFilter class.

Parameters
keyThe pointer to the property name.
bufThe pointer to the buffer of this private property.
buf_sizeThe 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,
size_t  buf_size 
)
inlinevirtual

Gets a private property in the IVideoFilter class.

Parameters
keyThe pointer to the property name.
bufThe pointer to the buffer of this private property.
buf_sizeThe 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 onDataStreamWillStart ( )
inlinevirtual

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 onDataStreamWillStop ( )
inlinevirtual

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

◆ isExternal()

virtual bool isExternal ( )
inlinevirtual

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.

◆ isExtensionFilter()

virtual bool isExtensionFilter ( )
inlinevirtual

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 IExtensionVideoFilter.

◆ adaptVideoFrame()

virtual bool adaptVideoFrame ( const media::base::VideoFrame capturedFrame,
media::base::VideoFrame adaptedFrame 
)
pure virtualinherited

Adapts the video frame.

Parameters
capturedFrameThe reference to the captured video frame that you want to adapt.
adaptedFrameThe reference to the adapted video frame.
Returns
  • true: Success.
  • false: Failure, if, for example, the IVideofilter object drops the video frame.

Implemented in IExtensionVideoFilter.

◆ AddRef()

virtual void AddRef ( ) const
pure virtualinherited

◆ Release()

virtual RefCountReleaseStatus Release ( ) const
pure virtualinherited

◆ HasOneRef()

virtual bool HasOneRef ( ) const
pure virtualinherited