Agora C++ API Reference for All Platforms

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

Inherits agora::RefCountInterface.

## Public Types
enum | VIDEO_EFFECT_NODE_ID : uint32_t { VIDEO_EFFECT_NODE_ID::BEAUTY = 1U << 0, VIDEO_EFFECT_NODE_ID::STYLE_MAKEUP = 1U << 1, VIDEO_EFFECT_NODE_ID::FILTER = 1U << 2, VIDEO_EFFECT_NODE_ID::STICKER = 1U << 3 }
enum | VIDEO_EFFECT_ACTION { SAVE = 1, RESET = 2 }

## Public Member Functions
virtual | ~IVideoEffectObject ()
virtual int | addOrUpdateVideoEffect (uint32_t nodeId, const char *templateName)=0
virtual int | removeVideoEffect (uint32_t nodeId)=0
virtual int | performVideoEffectAction (uint32_t nodeId, VIDEO_EFFECT_ACTION actionId)=0
virtual int | setVideoEffectFloatParam (const char *option, const char *key, float param)=0
virtual int | setVideoEffectIntParam (const char *option, const char *key, int param)=0
virtual int | setVideoEffectBoolParam (const char *option, const char *key, bool param)=0
virtual float | getVideoEffectFloatParam (const char *option, const char *key)=0
virtual int | getVideoEffectIntParam (const char *option, const char *key)=0
virtual bool | getVideoEffectBoolParam (const char *option, const char *key)=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

Since
  v4.6.0

## Member Enumeration Documentation

## ◆ VIDEO_EFFECT_NODE_ID

enum agora::rtc::IVideoEffectObject::VIDEO_EFFECT_NODE_ID : uint32_t
| strong

Types of video effect nodes that can be applied.

Since
  v4.6.0

Enumerator
BEAUTY | Beauty effect node.
STYLE_MAKEUP | Style makeup effect node.
FILTER | Filter effect node.
STICKER | Sticker efftec node.

## ◆ VIDEO_EFFECT_ACTION

enum agora::rtc::IVideoEffectObject::VIDEO_EFFECT_ACTION

Actions that can be performed on video effect nodes.

Since
  v4.6.0

Enumerator
SAVE | Save the current parameters of the video effect.
RESET | Reset the video effect to its default parameters.

## Constructor & Destructor Documentation

## ◆ ~IVideoEffectObject()

virtual agora::rtc::IVideoEffectObject::~IVideoEffectObject | ( |  | ) |
| inline virtual

## Member Function Documentation

## ◆ addOrUpdateVideoEffect()

virtual int agora::rtc::IVideoEffectObject::addOrUpdateVideoEffect | ( | uint32_t | nodeId,
|  | const char * | templateName
| ) |  |
| pure virtual

Adds or updates video effects with specified node ID and template.

Since
  v4.6.0

Parameters

  nodeId | The unique identifier or combination of video effect nodes. See VIDEO_EFFECT_NODE_ID Example: Single effect: `VIDEO_EFFECT_NODE_ID::BEAUTY` Combined effects: `VIDEO_EFFECT_NODE_ID::BEAUTY | VIDEO_EFFECT_NODE_ID::STYLE_MAKEUP`

Note
  Priority Rules:
  - The `STYLE_MAKEUP` node takes precedence over `FILTER` parameters.
  - To apply `FILTER` parameters, first remove the `STYLE_MAKEUP` node:
    removeVideoEffect(VIDEO_EFFECT_NODE_ID::STYLE_MAKEUP);
    addOrUpdateVideoEffect(VIDEO_EFFECT_NODE_ID::FILTER, "template name");

Parameters

  templateName | The name of the effect template. If set to null or an empty string, the SDK loads the default configuration from the resource bundle.

Returns
  - 0: Success.
  - < 0: Failure. The specific error code can provide more details about the failure.

## ◆ removeVideoEffect()

virtual int agora::rtc::IVideoEffectObject::removeVideoEffect | ( | uint32_t | nodeId | ) |
| pure virtual

Removes a video effect with specified node ID.

Since
  v4.6.0

Parameters

  nodeId | The unique identifier of the video effect node to remove. See VIDEO_EFFECT_NODE_ID

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ performVideoEffectAction()

virtual int agora::rtc::IVideoEffectObject::performVideoEffectAction | ( | uint32_t | nodeId,
|  | VIDEO_EFFECT_ACTION | actionId
| ) |  |
| pure virtual

Performs an action on a specified video effect node.

Since
  v4.6.0

Parameters

  nodeId | The unique identifier of the video effect node. See VIDEO_EFFECT_NODE_ID
  actionId | The action to perform on the video effect. See VIDEO_EFFECT_ACTION

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setVideoEffectFloatParam()

virtual int agora::rtc::IVideoEffectObject::setVideoEffectFloatParam | ( | const char * | option,
|  | const char * | key,
|  | float | param
| ) |  |
| pure virtual

Sets a float parameter for the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.
  param | The float value to set.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setVideoEffectIntParam()

virtual int agora::rtc::IVideoEffectObject::setVideoEffectIntParam | ( | const char * | option,
|  | const char * | key,
|  | int | param
| ) |  |
| pure virtual

Sets an integer parameter for the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.
  param | The integer value to set.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ setVideoEffectBoolParam()

virtual int agora::rtc::IVideoEffectObject::setVideoEffectBoolParam | ( | const char * | option,
|  | const char * | key,
|  | bool | param
| ) |  |
| pure virtual

Sets a boolean parameter for the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.
  param | The boolean value to set. true: Enable the option. false: Disable the option.

Returns
  - 0: Success.
  - < 0: Failure.

## ◆ getVideoEffectFloatParam()

virtual float agora::rtc::IVideoEffectObject::getVideoEffectFloatParam | ( | const char * | option,
|  | const char * | key
| ) |  |
| pure virtual

Gets a float parameter from the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.

Returns
  - The float value of the parameter if it exists.
  - 0.0f if the parameter does not exist or an error occurs.

## ◆ getVideoEffectIntParam()

virtual int agora::rtc::IVideoEffectObject::getVideoEffectIntParam | ( | const char * | option,
|  | const char * | key
| ) |  |
| pure virtual

Gets an integer parameter from the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.

Returns
  - The integer value of the parameter if it exists.
  - 0 if the parameter does not exist or an error occurs.

## ◆ getVideoEffectBoolParam()

virtual bool agora::rtc::IVideoEffectObject::getVideoEffectBoolParam | ( | const char * | option,
|  | const char * | key
| ) |  |
| pure virtual

Gets a boolean parameter from the video effect.

Since
  v4.6.0

Parameters

  option | The option category of the parameter.
  key | The key name of the parameter.

Returns
  - true: The parameter is enabled.
  - false: The parameter is disabled or does not exist.

agora::rtc::IVideoEffectObject::VIDEO_EFFECT_NODE_ID::STYLE_MAKEUP
@ STYLE_MAKEUP
agora::rtc::IVideoEffectObject::VIDEO_EFFECT_NODE_ID::FILTER
@ FILTER
agora::rtc::IVideoEffectObject::addOrUpdateVideoEffect
virtual int addOrUpdateVideoEffect(uint32_t nodeId, const char *templateName)=0
Adds or updates video effects with specified node ID and template.
agora::rtc::IVideoEffectObject::removeVideoEffect
virtual int removeVideoEffect(uint32_t nodeId)=0
Removes a video effect with specified node ID.