dependencies {//例如:S1-04套餐如下:implementation 'com.tencent.mediacloud:TencentEffect_S1-04:版本号'//“版本号”可以在官网的“SDK下载/版本历史”页面看到,例如 3.0.0.13。“版本号”也可以使用"latest.release" ,//但请注意:这会让您使用的SDK始终保持最新版,在一些变化比较大的版本上可能不符合您的预期,请慎重使用"latest.release"}
defaultConfig {ndk {abiFilters "armeabi-v7a", "arm64-v8a"}}

版本 | Maven 地址 |
A1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_A1-01:版本号' |
A1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_A1-02:版本号' |
A1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_A1-03:版本号' |
A1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_A1-04:版本号' |
A1 - 05 | implementation 'com.tencent.mediacloud:TencentEffect_A1-05:版本号' |
A1 - 06 | implementation 'com.tencent.mediacloud:TencentEffect_A1-06:版本号' |
S1 - 00 | implementation 'com.tencent.mediacloud:TencentEffect_S1-00:版本号' |
S1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_S1-01:版本号' |
S1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_S1-02:版本号' |
S1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_S1-03:版本号' |
S1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_S1-04:版本号' |
S1 - 05 | implementation 'com.tencent.mediacloud:TencentEffect_S1-05:版本号' |
S1 - 06 | implementation 'com.tencent.mediacloud:TencentEffect_S1-06:版本号' |
S1 - 07 | implementation 'com.tencent.mediacloud:TencentEffect_S1-07:版本号' |
..src/main/assets/MotionRes..src/main/assets/lut//如果仅仅是为了触发下载或更新license,而不关心鉴权结果,则第4个参数传入null。TELicenseCheck.getInstance().setTELicense(context, URL, KEY, null);
TELicenseCheck.getInstance().setTELicense(context, URL, KEY, new TELicenseCheckListener() {@Overridepublic void onLicenseCheckFinish(int errorCode, String msg) {//注意:此回调不一定在调用线程if (errorCode == TELicenseCheck.ERROR_OK) {//鉴权成功} else {//鉴权失败}}});
错误码 | 说明 |
0 | 成功。Success。 |
-1 | 输入参数无效,例如 URL 或 KEY 为空。 |
-3 | 下载环节失败,请检查网络设置。 |
-4 | 从本地读取的 TE 授权信息为空,可能是 IO 失败引起。 |
-5 | 读取 VCUBE TEMP License 文件内容为空,可能是 IO 失败引起。 |
-6 | v_cube.license 文件 JSON 字段不对。请联系腾讯云团队处理。 |
-7 | 签名校验失败。请联系腾讯云团队处理。 |
-8 | 解密失败。请联系腾讯云团队处理。 |
-9 | TELicense 字段里的 JSON 字段不对。请联系腾讯云团队处理。 |
-10 | 从网络解析的 TE 授权信息为空。请联系腾讯云团队处理。 |
-11 | 把 TE 授权信息写到本地文件时失败,可能是 IO 失败引起。 |
-12 | 下载失败,解析本地 asset 也失败。 |
-13 | 鉴权失败,请检查 so 是否在包里,或者已正确设置 so 路径。 |
3004/3005 | 无效授权。请联系腾讯云团队处理。 |
3015 | Bundle Id / Package Name 不匹配。检查您的 App 使用的 Bundle Id / Package Name 和申请的是否一致,检查是否使用了正确的授权文件。 |
3018 | 授权文件已过期,需要向腾讯云申请续期。 |
其他 | 请联系腾讯云团队处理。 |
TEMenuActivity.java。String resPath = new File(getFilesDir(), AppConfig.getInstance().getBeautyFileDirName()).getAbsolutePath();if (!resPath.endsWith(File.separator)) {resPath = resPath + File.separator;}AppConfig.resPathForSDK = resPath;AppConfig.lutFilterPath = resPath + "light_material/lut";AppConfig.motionResPath = resPath + "MotionRes";new Thread(() -> {Context context = getApplicationContext();int addResult = XmagicApi.addAiModeFilesFromAssets(context, AppConfig.resPathForSDK);Log.d(TAG, "copyRes, add ai model files result = " + addResult);String lutDirNameInAsset = "lut";boolean result = FileUtil.copyAssets(context, lutDirNameInAsset, AppConfig.lutFilterPath);Log.d(TAG, "copyRes, copy lut, result = " + result);String motionResDirNameInAsset = "MotionRes";boolean result2 = FileUtil.copyAssets(context, motionResDirNameInAsset, AppConfig.motionResPath);Log.d(TAG, "copyRes, copy motion res, result = " + result2);}).start();
XmagicApi xmagicApi = new XmagicApi(context, effectMode, mResPath, (errorMsg, code) -> {LogUtils.e(TAG, "createXMagicApi errorMsg = " + errorMsg + " code = " + code);});
TXUGCRecord instance = TXUGCRecord.getInstance(UGCKit.getAppContext());instance.setVideoProcessListener(new TXUGCRecord.VideoCustomProcessListener() {@Overridepublic int onTextureCustomProcess(int textureId, int width, int height) {if (xmagicApi != null) {return xmagicApi.process(textureId, width, height);}return textureId;}@Overridepublic void onDetectFacePoints(float[] floats) {}@Overridepublic void onTextureDestroyed() {if (Looper.getMainLooper() != Looper.myLooper()) { //非主线程xmagicApi.onDestroy()}}});
xmagicApi.seteffect();
xmagicApi.onDestroy()
文档反馈