产品动态
关于腾讯特效 SDK V3.5 版本更新公告
关于腾讯特效 SDK V3.0 版本相关接口及素材变更公告
demo/lib下的 main.dart文件,在此文件中添加您的licenseUrl和licenseKey. 直播中使用美颜的示例代码主要在demo/lib/page/live_page.dart 和demo/lib/main.dart中。 applicationId 的值修改为您申请license信息时填写的包名。flutter pub get 。flutter pub get。pod install。bundle ID(需要和申请 license 时填写的 bundle ID 一致)。S1-04套餐,则添加如下:dependencies {implementation 'com.tencent.mediacloud:TencentEffect_S1-04:latest.release'}
android/app 模块下找到 src/main/assets 文件夹,将demo工程中demo/android/app/src/main/assets中的lut和MotionRes 复制到您工程的android/app/ src/main/assets中,如果您的工程没有assets文件夹可以手动创建一个。<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

no xxx method 的异常。-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: ../
flutter pub get
implementation 'com.tencent.mediacloud:TencentEffect_S1-04:latest.release' 中的latest.release 字段修改为最新的版本号。TencentEffect_S1-04 字段修改为您的套餐字段 。TXLivePluginManager.register(new XmagicProcesserFactory());
XmagicProcesserFactory *instance = [[XmagicProcesserFactory alloc] init];[TXLivePluginManager registerWithCustomBeautyProcesserFactory:instance];

void _initSettings(InitXmagicCallBack callBack) async {String resourceDir = await ResPathManager.getResManager().getResPath();TXLog.printlog('$TAG method is _initResource ,xmagic resource dir is $resourceDir');TencentEffectApi.getApi()?.setResourcePath(resourceDir);/// 复制资源只需要复制一次,在当前版本中如果成功复制了一次,以后就不需要再复制资源。/// Copying the resource only needs to be done once. Once it has been successfully copied in the current version, there is no need to copy it again in future versions.if (await isCopiedRes()) {callBack.call(true);return;} else {_copyRes(callBack);}}void _copyRes(InitXmagicCallBack callBack) {_showDialog(context);TencentEffectApi.getApi()?.initXmagic((result) {if (result) {saveResCopied();}_dismissDialog(context);callBack.call(result);if (!result) {Fluttertoast.showToast(msg: "initialization failed");}});}
String dir = await BeautyDataManager.getInstance().getResDir();TXLog.printlog('文件路径为:$dir');TencentEffectApi.getApi()?.initXmagic(dir,(reslut) {_isInitResource = reslut;callBack.call(reslut);if (!reslut) {Fluttertoast.showToast(msg: "初始化资源失败");}});
TencentEffectApi.getApi()?.setLicense(licenseKey, licenseUrl,(errorCode, msg) {TXLog.printlog("打印鉴权结果 errorCode = $errorCode msg = $msg");if (errorCode == 0) {//鉴权成功}});
///开启美颜操作/// 设置ture 表示开启美颜,设置false 表示关闭美颜var enableCustomVideo = await _livePusher.enableCustomVideoProcess(open);
TencentEffectApi.getApi()?.setEffect(sdkParam.effectName!, sdkParam.effectValue, sdkParam.resourcePath, sdkParam.extraInfo)
TencentEffectApi.getApi()?.updateProperty(_xmagicProperty!);///_xmagicProperty 可通过 BeautyDataManager.getInstance().getAllPannelData();获取所有的属性,需要使用美颜属性的时候可通过updateProperty方法设置属性。
TencentEffectApi.getApi()?.onPause();
TencentEffectApi.getApi()?.onResume();
TencentEffectApi.getApi()?.setOnCreateXmagicApiErrorListener((errorMsg, code) {TXLog.printlog("创建美颜对象出现错误 errorMsg = $errorMsg , code = $code");}); ///需要在创建美颜之前进行设置
TencentEffectApi.getApi()?.setAIDataListener(XmagicAIDataListenerImp());
TencentEffectApi.getApi()?.setTipsListener(XmagicTipsListenerImp());
TencentEffectApi.getApi()?.setYTDataListener((data) {TXLog.printlog("setYTDataListener $data");});
TencentEffectApi.getApi()?.setOnCreateXmagicApiErrorListener(null);TencentEffectApi.getApi()?.setAIDataListener(null);TencentEffectApi.getApi()?.setYTDataListener(null);TencentEffectApi.getApi()?.setTipsListener(null);
android/xmagic/src.mian/assets/MotionRes/2dMotionRes 目录下:
ios/Runner/xmagic/2dMotionRes.bundle 目录下。

文档反馈