Agora Java API Reference for Android

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

Provides methods to manage and configure video effects, such as beauty, style makeup, and filter. More...

`#include <IAgoraRtcEngine.h>`

Inheritance diagram for agora::rtc::IVideoEffectObject:

## 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 }
| Types of applicable video effect nodes. More...
enum | VIDEO_EFFECT_ACTION { SAVE = 1, RESET = 2 }
| Actions that can be performed on video effect nodes. More...

## Public Member Functions
virtual int | addOrUpdateVideoEffect (uint32_t nodeId, const char *templateName)=0
| Adds or updates the video effect for the specified node ID and template. More...
virtual int | removeVideoEffect (uint32_t nodeId)=0
| Removes the video effect with the specified node ID. More...
virtual int | performVideoEffectAction (uint32_t nodeId, VIDEO_EFFECT_ACTION actionId)=0
| Performs an action on the specified video effect node. More...
virtual int | setVideoEffectFloatParam (const char *option, const char *key, float param)=0
| Sets the float parameter for video effects. More...
virtual int | setVideoEffectIntParam (const char *option, const char *key, int param)=0
| Sets an integer parameter for video effects. More...
virtual int | setVideoEffectBoolParam (const char *option, const char *key, bool param)=0
| Sets the boolean parameter for video effects. More...
virtual float | getVideoEffectFloatParam (const char *option, const char *key)=0
| Retrieves `float` type parameters in video effects. More...
virtual int | getVideoEffectIntParam (const char *option, const char *key)=0
| Retrieves integer parameters in video effects. More...
virtual bool | getVideoEffectBoolParam (const char *option, const char *key)=0
| Gets the boolean parameter in video effects. More...
Public Member Functions inherited from agora::RefCountInterface
virtual void | AddRef () const =0
virtual RefCountReleaseStatus | Release () const =0
virtual bool | HasOneRef () const =0

## Detailed Description

Provides methods to manage and configure video effects, such as beauty, style makeup, and filter.

Since
  v4.6.0

## Member Enumeration Documentation

## ◆ VIDEO_EFFECT_NODE_ID

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

Types of applicable video effect nodes.

Since
  v4.6.0

Enumerator
BEAUTY | (1): Beauty effect node.
STYLE_MAKEUP | (2): Style makeup effect node.
FILTER | (4): Filter effect 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 | (1): Save the current parameters of the video effect.
RESET | (2): Reset the video effect to default parameters.

## Member Function Documentation

## ◆ addOrUpdateVideoEffect()

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

Adds or updates the video effect for the specified node ID and template.

Since
  v4.6.0

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

Parameters

  nodeId | The unique identifier or combination of identifiers for the video effect node. See `VIDEO_EFFECT_NODE_ID`. Examples: Single effect: `VIDEO_EFFECT_NODE_ID::BEAUTY` Combined effects: `VIDEO_EFFECT_NODE_ID::BEAUTY | VIDEO_EFFECT_NODE_ID::STYLE_MAKEUP`
  templateName | The name of the effect template. If set to null or an empty string, the SDK loads the default configuration from the resource package.

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

## ◆ removeVideoEffect()

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

Removes the video effect with the 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 the specified video effect node.

Since
  v4.6.0

Parameters

  nodeId | The unique identifier of the video effect node.
  actionId | The action to perform. 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 the float parameter for video effects.

Since
  v4.6.0

Parameters

  option | The category of the parameter option.
  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 video effects.

Since
  v4.6.0

Parameters

  option | The category of the option to which the parameter belongs.
  key | The key name of the parameter.
  param | The integer parameter 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 the boolean parameter for video effects.

Since
  v4.6.0

Parameters

  option | The category of the parameter option.
  key | The key name of the parameter.
  param | The boolean value to set. `true`: Enables the option. `false`: Disables the option.

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

## ◆ getVideoEffectFloatParam()

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

Retrieves `float` type parameters in video effects.

Since
  v4.6.0

Used to retrieve the value of a `float` type parameter corresponding to the specified option and key in video effects.

Parameters

  option | The category of the option to which the parameter belongs.
  key | The key name of the parameter.

Returns
  - If the parameter exists, returns the corresponding `float` value.
  - If the parameter does not exist or an error occurs, returns 0.0f.

## ◆ getVideoEffectIntParam()

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

Retrieves integer parameters in video effects.

Since
  v4.6.0

Used to retrieve integer-type parameters in video effects.

Parameters

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

Returns
  - If the parameter exists, returns the corresponding integer value.
  - If the parameter does not exist or an error occurs, returns 0.

## ◆ getVideoEffectBoolParam()

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

Gets the boolean parameter in video effects.

Since
  v4.6.0

Parameters

  option | The option category to which the parameter belongs.
  key | The key name of the parameter.

Returns
  - `true`: The parameter is enabled.
  - `false`: The parameter is not enabled 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 the video effect for the specified node ID and template.
agora::rtc::IVideoEffectObject::removeVideoEffect
virtual int removeVideoEffect(uint32_t nodeId)=0
Removes the video effect with the specified node ID.