Agora RTC Objective-C API Reference Refactor

Public Member Functions
IVideoTrack Class Referenceabstract

Inherits RefCountInterface.

Inherited by ILocalVideoTrack, and 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, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool | removeVideoFilter (agora_refptr< IVideoFilter > filter, media::base::VIDEO_MODULE_POSITION position=media::base::POSITION_POST_CAPTURER, const char *id=NULL, aosl_ref_t ares=AOSL_REF_INVALID)=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, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual bool | removeRenderer (agora_refptr< IVideoSinkBase > videoRenderer, media::base::VIDEO_MODULE_POSITION position, aosl_ref_t ares=AOSL_REF_INVALID)=0
virtual VideoTrackType | getType ()=0
virtual int | enableVideoFilter (const char *id, bool enable, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | setFilterProperty (const char *id, const char *key, const char *json_value, aosl_ref_t ares=AOSL_REF_INVALID)
virtual int | getFilterProperty (const char *id, const char *key, char *json_value, size_t buf_size, aosl_ref_t ares=AOSL_REF_INVALID)

## Detailed Description

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

## Constructor & Destructor Documentation

## ◆ ~IVideoTrack()

~IVideoTrack | ( |  | ) |
| inline protected

## Member Function Documentation

## ◆ addVideoFilter()

virtual bool addVideoFilter | ( | agora_refptr< IVideoFilter > | filter,
|  | media::base::VIDEO_MODULE_POSITION | position = `media::base::POSITION_POST_CAPTURER`,
|  | const char * | id = `NULL`,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Adds a video filter to the video track.

Add a video filter in either of the following ways:

- Use the IMediaNodeFactory object to create a built-in video filter.
- Use a custom video filter by implementing the IVideoFilter class.

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

  filter | The video filter that you want to add to the video track.
  position | The position where the filter is added.
  id | id of the filter

Returns
  - `true`: The video filter is added successfully.
  - `false`: The video filter fails to be added.

## ◆ removeVideoFilter()

virtual bool removeVideoFilter | ( | agora_refptr< IVideoFilter > | filter,
|  | media::base::VIDEO_MODULE_POSITION | position = `media::base::POSITION_POST_CAPTURER`,
|  | const char * | id = `NULL`,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

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

Parameters

  filter | The video filter that you want to remove: `IVideoFilter`.
  position | The 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 hasVideoFilter | ( | const char * | id,
|  | media::base::VIDEO_MODULE_POSITION | position = `media::base::POSITION_POST_CAPTURER`
| ) |  |
| pure virtual

Whether a video filter exists

Parameters

  id | id of the filter

Returns
  - true: exist
  - false: not exist

## ◆ addRenderer()

virtual bool addRenderer | ( | agora_refptr< IVideoSinkBase > | videoRenderer,
|  | media::base::VIDEO_MODULE_POSITION | position,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

Adds a video renderer to the video track.

Add a video renderer in either of the following ways:

- Use the built-in video renderer by implementing the `IVideoRenderer` in the `IMediaNodeFactory` class.
- Use a custom video renderer by implementing the `IVideoSinkBase` class.

Parameters

  videoRenderer | The video renderer that you want to add: IVideoSinkBase.
  position | The 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 removeRenderer | ( | agora_refptr< IVideoSinkBase > | videoRenderer,
|  | media::base::VIDEO_MODULE_POSITION | position,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| pure virtual

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

Parameters

  videoRenderer | The video renderer that you want to remove: IVideoSinkBase.
  position | The 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 getType | ( |  | ) |
| pure virtual

Get the track type of the video track

Returns
  - VideoTrackType

Implemented in IRemoteVideoTrack, and ILocalVideoTrack.

## ◆ enableVideoFilter()

virtual int enableVideoFilter | ( | const char * | id,
|  | bool | enable,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| inline virtual

Enable / Disable specified video filter

Parameters

  id | id of the filter
  enable | enable / disable the filter with given id

Returns
  - 0: success
  - <0: failure

## ◆ setFilterProperty()

virtual int setFilterProperty | ( | const char * | id,
|  | const char * | key,
|  | const char * | json_value,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| inline virtual

set the properties of the specified video filter

Parameters

  id | id of the filter
  key | key of the property
  json_value | json str value of the property

Returns
  - 0: success
  - <0: failure

## ◆ getFilterProperty()

virtual int getFilterProperty | ( | const char * | id,
|  | const char * | key,
|  | char * | json_value,
|  | size_t | buf_size,
|  | aosl_ref_t | ares = `AOSL_REF_INVALID`
| ) |  |
| inline virtual

get the properties of the specified video filter

Parameters

  id | id of the filter
  key | key of the property
  json_value | json str value of the property

Returns
  - 0: success
  - <0: failure

## ◆ AddRef()

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

## ◆ Release()

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

## ◆ HasOneRef()

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