android/app 模块下找到 src/main/assets 文件夹,将 demo 工程中 demo/android/app/src/main/assets中的 lut 和 MotionRes 文件夹复制到您工程的android/app/src/main/assets中,如果您的工程没有 assets 文件夹可以手动创建一个。
android/app/build.gradle 文件中,添加 Android 端美颜 SDK 的依赖。具体依赖根据您选择的套餐包而定,例如您选择的是S1-04套餐,则添加如下:dependencies {implementation 'com.tencent.mediacloud:TencentEffect_S1-04:latest.release'}
<uses-native-libraryandroid:name="libOpenCL.so"android:required="false" />//true 表示libOpenCL是当前app必需的。如果没有此库,系统将不允许app安装//false 表示libOpenCL不是当前app必需的。无论有没有此库,都可以正常安装app。如果设备有此库,美颜特效SDK里的GAN类型特效能正常生效(例如童话脸、国漫脸)。如果设备没有此库,GAN类型不会生效,但也不影响SDK内其他功能的使用。//关于uses-native-library的说明,请参考Android 官网介绍:https://developer.android.com/guide/topics/manifest/uses-native-library-element

-keep class com.tencent.xmagic.** { *;}-keep class org.light.** { *;}-keep class org.libpag.** { *;}-keep class org.extra.** { *;}-keep class com.gyailib.**{ *;}-keep class com.tencent.cloud.iai.lib.** { *;}-keep class com.tencent.beacon.** { *;}-keep class com.tencent.qimei.** { *;}-keep class androidx.exifinterface.** { *;}-keep class com.tencent.effect.** { *;}

tencent_effect_flutter:git:url: https://github.com/Tencent-RTC/TencentEffect_Flutter
tencent_effect_flutter:path: path to tencent_effect_flutter
TRTCPlugin.setBeautyProcesserFactory(new XmagicProcesserFactory());
let instance = XmagicProcesserFactory()TencentRTCCloud.setBeautyProcesserFactory(factory: instance)
XmagicProcesserFactory *instance = [[XmagicProcesserFactory alloc] init];[TencentRTCCloud setBeautyProcesserFactoryWithFactory:instance];
TencentEffectApi.getApi()?.setResourcePath(resourceDir);TencentEffectApi.getApi()?.initXmagic((result) {// TODO});
TencentEffectApi.getApi()?.initXmagic(dir,(reslut) {//TODO});
TencentEffectApi.getApi()?.setLicense(licenseKey, licenseUrl, (errorCode, msg) {if (errorCode == 0) {// Success}});
_enableCustomBeautyByNative(bool open) {trtcCloud.callExperimentalAPI("{\\"api\\": \\"enableVideoProcessByNative\\", \\"params\\": {\\"enable\\": $open}}");}
文档反馈