setFaceShapeBeautyOptions [1/2]
Sets the face shape options and specifies the media source.
public abstract int setFaceShapeBeautyOptions(
boolean enabled, FaceShapeBeautyOptions options, Constants.MediaSourceType sourceType);
- Since
- v4.5.0
Calling this method allows for modifying various parts of the face, achieving slimming, enlarging eyes, slimming nose, and other minor cosmetic effects all at once using preset parameters, supporting fine-tuning the overall modification intensity.
Both this methods and setFaceShapeBeautyOptions [2/2] can be used to set beauty effects options, the difference is that this method supports specifying the media source to apply the beauty effects.
Call timing
Call this method after calling enableVideo.
Restrictions
- This method only applies to Android 4.4 or later.
- This method relies on the image enhancement dynamic library
libagora_clear_vision_extension.so. If the dynamic library is deleted, the function cannot be enabled normally. - This feature has high requirements on device performance. When calling this method, the SDK automatically checks the capabilities of the current device.
Parameters
- enabled
- Whether to enable the face shape effect:
true: Enable the face shape effect.false: (Default) Disable the face shape effect.
- options
- Face shaping style options, see FaceShapeBeautyOptions.
- sourceType
- The type of the media source to which the filter effect is applied. See MediaSourceType.Attention: In this method, this parameter supports only the following two settings:
- Use the default value PRIMARY_CAMERA_SOURCE if you use camera to capture local video.
- Set this parameter to CUSTOM_VIDEO_SOURCE if you use custom video source.
Returns
- 0: Success.
- < 0: Failure.
- -4: The current device does not support this feature. Possible reasons include:
- The current device capabilities do not meet the requirements for image enhancement. Agora recommends you replace it with a high-performance device.
- The current device version is lower than Android 4.4 and does not support this feature. Agora recommends you replace the device or upgrade the operating system.
- -4: The current device does not support this feature. Possible reasons include: