Agora C++ API Reference for All Platforms
Public Member Functions | Protected Member Functions | List of all members
agora::rtc::IVideoTrack Class Referenceabstract

Inherits agora::RefCountInterface.

Inherited by agora::rtc::ILocalVideoTrack, and agora::rtc::IRemoteVideoTrack.

Public Member Functions

virtual bool addVideoFilter (agora_refptr< IVideoFilter > filter, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER, const char *id=NULL)=0
 
virtual bool removeVideoFilter (agora_refptr< IVideoFilter > filter, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER, const char *id=NULL)=0
 
virtual bool hasVideoFilter (const char *id, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER)=0
 
virtual bool addRenderer (agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_PRE_RENDERER)=0
 
virtual bool removeRenderer (agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_PRE_RENDERER)=0
 
virtual VideoTrackType getType ()=0
 
virtual int enableVideoFilter (const char *id, bool enable)
 
virtual int setFilterProperty (const char *id, const char *key, const char *json_value)
 
virtual int getFilterProperty (const char *id, const char *key, char *json_value, size_t buf_size)
 
- Public Member Functions inherited from agora::RefCountInterface
virtual void AddRef () const =0
 
virtual RefCountReleaseStatus Release () const =0
 
virtual bool HasOneRef () const =0
 

Protected Member Functions

 ~IVideoTrack ()
 
- Protected Member Functions inherited from agora::RefCountInterface
virtual ~RefCountInterface ()
 

Detailed Description

The IVideoTrack class defines the behavior and status of a video track.

Constructor & Destructor Documentation

◆ ~IVideoTrack()

agora::rtc::IVideoTrack::~IVideoTrack ( )
inlineprotected

Member Function Documentation

◆ addVideoFilter()

virtual bool agora::rtc::IVideoTrack::addVideoFilter ( agora_refptr< IVideoFilter filter,
media::base::VIDEO_MODULE_POSITION  position = media::base::POSITION_POST_CAPTURER,
const char *  id = NULL 
)
pure virtual

Adds a video filter to the video track.

Add a video filter in either of the following ways:

To add multiple filters, call this method multiple times. The order of the added filters depends on when the app successfully adds the filter.

Parameters
filterThe video filter that you want to add to the video track.
positionThe position where the filter is added.
idid of the filter
Returns
  • true: The video filter is added successfully.
  • false: The video filter fails to be added.

◆ removeVideoFilter()

virtual bool agora::rtc::IVideoTrack::removeVideoFilter ( agora_refptr< IVideoFilter filter,
media::base::VIDEO_MODULE_POSITION  position = media::base::POSITION_POST_CAPTURER,
const char *  id = NULL 
)
pure virtual

Removes the video filter added by addVideoFilter from the video track.

Parameters
filterThe video filter that you want to remove: IVideoFilter.
positionThe position of the filter. @id id of the filter
Returns
  • true: The video filter is removed successfully.
  • false: The video filter fails to be removed.

◆ hasVideoFilter()

virtual bool agora::rtc::IVideoTrack::hasVideoFilter ( const char *  id,
media::base::VIDEO_MODULE_POSITION  position = media::base::POSITION_POST_CAPTURER 
)
pure virtual

Whether a video filter exists

Parameters
idid of the filter
Returns
  • true: exist
  • false: not exist

◆ addRenderer()

virtual bool agora::rtc::IVideoTrack::addRenderer ( agora_refptr< IVideoSinkBase videoRenderer,
media::base::VIDEO_MODULE_POSITION  position = media::base::POSITION_PRE_RENDERER 
)
pure virtual

Adds a video renderer to the video track.

Add a video renderer in either of the following ways:

Parameters
videoRendererThe video renderer that you want to add: IVideoSinkBase.
positionThe position where the renderer is added.
Returns
  • true: The video renderer is added successfully.
  • false: The video renderer fails to be added.

◆ removeRenderer()

virtual bool agora::rtc::IVideoTrack::removeRenderer ( agora_refptr< IVideoSinkBase videoRenderer,
media::base::VIDEO_MODULE_POSITION  position = media::base::POSITION_PRE_RENDERER 
)
pure virtual

Removes the video renderer added by addRenderer from the video track.

Parameters
videoRendererThe video renderer that you want to remove: IVideoSinkBase.
positionThe position where the renderer is removed: VIDEO_MODULE_POSITION.
Returns
  • true: The video renderer is removed successfully.
  • false: The video renderer fails to be removed.

◆ getType()

virtual VideoTrackType agora::rtc::IVideoTrack::getType ( )
pure virtual

Get the track type of the video track

Returns
  • VideoTrackType

Implemented in agora::rtc::IRemoteVideoTrack, and agora::rtc::ILocalVideoTrack.

◆ enableVideoFilter()

virtual int agora::rtc::IVideoTrack::enableVideoFilter ( const char *  id,
bool  enable 
)
inlinevirtual

Enable / Disable specified video filter

Parameters
idid of the filter
enableenable / disable the filter with given id
Returns
  • 0: success
  • <0: failure

◆ setFilterProperty()

virtual int agora::rtc::IVideoTrack::setFilterProperty ( const char *  id,
const char *  key,
const char *  json_value 
)
inlinevirtual

set the properties of the specified video filter

Parameters
idid of the filter
keykey of the property
json_valuejson str value of the property
Returns
  • 0: success
  • <0: failure

◆ getFilterProperty()

virtual int agora::rtc::IVideoTrack::getFilterProperty ( const char *  id,
const char *  key,
char *  json_value,
size_t  buf_size 
)
inlinevirtual

get the properties of the specified video filter

Parameters
idid of the filter
keykey of the property
json_valuejson str value of the property
Returns
  • 0: success
  • <0: failure