Agora Java API Reference for Android

Classes | Public Member Functions | List of all members
io.agora.rtc2.IVideoEffectObject Interface Reference

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

## Classes
enum | VIDEO_EFFECT_ACTION
| Actions that can be performed on video effect nodes. More...
enum | VIDEO_EFFECT_NODE_ID
| Types of video effect nodes that can be applied. More...

## Public Member Functions
int | addOrUpdateVideoEffect (int nodeId, String templateName)
| Adds or updates a video effect with specified node ID and template. More...
int | removeVideoEffect (int nodeId)
| Removes a video effect with specified node ID. More...
int | performVideoEffectAction (int nodeId, VIDEO_EFFECT_ACTION actionId)
| Performs an action on a specified video effect node. More...
int | setVideoEffectFloatParam (String option, String key, float value)
| Sets a float parameter for the video effect. More...
int | setVideoEffectIntParam (String option, String key, int value)
| Sets an integer parameter for the video effect. More...
int | setVideoEffectBoolParam (String option, String key, boolean value)
| Sets a boolean parameter for the video effect. More...
float | getVideoEffectFloatParam (String option, String key)
| Gets a float parameter for the video effect. More...
int | getVideoEffectIntParam (String option, String key)
| Gets an integer parameter for the video effect. More...
boolean | getVideoEffectBoolParam (String option, String key)
| Gets a boolean parameter for the video effect. More...

## Detailed Description

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

Since
  v4.6.0

## Member Function Documentation

## ◆ addOrUpdateVideoEffect()

int io.agora.rtc2.IVideoEffectObject.addOrUpdateVideoEffect | ( | int | nodeId,
|  | String | templateName
| ) |  |

Adds or updates a video effect 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
  templateName | The name of the effect template. If set to null or empty string, the SDK loads the default parameter configuration from the resource bundle.

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");

Returns
  - 0: Success
  - <0: Failure. See error codes in AgoraBaseConstants

## ◆ removeVideoEffect()

int io.agora.rtc2.IVideoEffectObject.removeVideoEffect | ( | int | nodeId | ) |

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

int io.agora.rtc2.IVideoEffectObject.performVideoEffectAction | ( | int | nodeId,
|  | VIDEO_EFFECT_ACTION | actionId
| ) |  |

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

int io.agora.rtc2.IVideoEffectObject.setVideoEffectFloatParam | ( | String | option,
|  | String | key,
|  | float | value
| ) |  |

Sets a float parameter for the video effect.

Since
  v4.6.0

Parameters

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

Returns
  - 0: Success
  - <0: Failure

## ◆ setVideoEffectIntParam()

int io.agora.rtc2.IVideoEffectObject.setVideoEffectIntParam | ( | String | option,
|  | String | key,
|  | int | value
| ) |  |

Sets an integer parameter for the video effect.

Since
  v4.6.0

Parameters

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

Returns
  - 0: Success
  - <0: Failure

## ◆ setVideoEffectBoolParam()

int io.agora.rtc2.IVideoEffectObject.setVideoEffectBoolParam | ( | String | option,
|  | String | key,
|  | boolean | value
| ) |  |

Sets a boolean parameter for the video effect.

Since
  v4.6.0

Parameters

  option | The category identifier of the parameter.
  key | The key name of the parameter.
  value | The boolean value to set.

Returns
  - 0: Success
  - <0: Failure

## ◆ getVideoEffectFloatParam()

float io.agora.rtc2.IVideoEffectObject.getVideoEffectFloatParam | ( | String | option,
|  | String | key
| ) |  |

Gets a float parameter for the video effect.

Since
  v4.6.0

Parameters

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

Returns
  The current parameter value or 0.0f on failure.

## ◆ getVideoEffectIntParam()

int io.agora.rtc2.IVideoEffectObject.getVideoEffectIntParam | ( | String | option,
|  | String | key
| ) |  |

Gets an integer parameter for the video effect.

Since
  v4.6.0

Parameters

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

Returns
  The current parameter value or 0 on failure.

## ◆ getVideoEffectBoolParam()

boolean io.agora.rtc2.IVideoEffectObject.getVideoEffectBoolParam | ( | String | option,
|  | String | key
| ) |  |

Gets a boolean parameter for the video effect.

Since
  v4.6.0

Parameters

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

Returns
  The current parameter value or false on failure.

io.agora.rtc2.IVideoEffectObject.addOrUpdateVideoEffect
int addOrUpdateVideoEffect(int nodeId, String templateName)
Adds or updates a video effect with specified node ID and template.
io.agora.rtc2.IVideoEffectObject.removeVideoEffect
int removeVideoEffect(int nodeId)
Removes a video effect with specified node ID.