dependencies {//For example: the S1-04 package is as follows:implementation 'com.tencent.mediacloud:TencentEffect_S1-04:version number'//The "version number" can be seen on the official website's "SDK Download / Version History" page, for example 3.0.0.13. The "version number" can also use "latest.release",//But please note: this will keep the SDK you use always at the latest version, which may not meet your expectations on some versions with major changes. Please use "latest.release" with caution}
defaultConfig {ndk {abiFilters "armeabi-v7a", "arm64-v8a"}}

Version | Maven Address |
A1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_A1-01:version number' |
A1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_A1-02:version number' |
A1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_A1-03:version number' |
A1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_A1-04:version number' |
A1 - 05 | implementation 'com.tencent.mediacloud:TencentEffect_A1-05:version number' |
A1 - 06 | implementation 'com.tencent.mediacloud:TencentEffect_A1-06:version number' |
S1 - 00 | implementation 'com.tencent.mediacloud:TencentEffect_S1-00:version number' |
S1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_S1-01:version number' |
S1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_S1-02:version number' |
S1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_S1-03:version number' |
S1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_S1-04:version number' |
S1 - 05 | implementation 'com.tencent.mediacloud:TencentEffect_S1-05:version number' |
S1 - 06 | implementation 'com.tencent.mediacloud:TencentEffect_S1-06:version number' |
S1 - 07 | implementation 'com.tencent.mediacloud:TencentEffect_S1-07:version number' |
../assets/MotionRes../assets/lut//If it is only to trigger downloading or updating the license, without caring about the authentication result, pass null for the 4th parameter.TELicenseCheck.getInstance().setTELicense(context, URL, KEY, null);
TELicenseCheck.getInstance().setTELicense(context, URL, KEY, new TELicenseCheckListener() {@Overridepublic void onLicenseCheckFinish(int errorCode, String msg) {//Note: this callback is not necessarily on the calling threadif (errorCode == TELicenseCheck.ERROR_OK) {//Authentication succeeded} else {//Authentication failed}}});
Error Code | Description |
0 | Success. |
-1 | Invalid input parameters, such as empty URL or KEY. |
-3 | Download failure. Please check your network settings. |
-4 | TE authorization information read locally is empty, possibly due to I/O failure. |
-5 | Content of the VCUBE TEMP license file is empty, possibly due to I/O failure. |
-6 | JSON fields in the v_cube.license file are incorrect. Please contact the Tencent Cloud team to deal with it. |
-7 | Signature verification failed. Please contact the Tencent Cloud team to deal with it. |
-8 | Decryption failed. Please contact the Tencent Cloud team to deal with it. |
-9 | JSON fields in the TELicense field are incorrect. Please contact the Tencent Cloud team to deal with it. |
-10 | The TE authorization information parsed from the network is empty. Please contact the Tencent Cloud team to deal with it. |
-11 | Failed to write TE authorization information to a local file, possibly due to I/O failure. |
-12 | Download failed, and parsing local assets also failed. |
-13 | Authentication failed. Please check if the .so file is in the package or if the .so path is set correctly. |
3004/3005 | Invalid authorization. Please contact the Tencent Cloud team to deal with it. |
3015 | Bundle ID/Package Name mismatch. Check if the Bundle ID/Package Name used by your app is consistent with the applied one, and ensure you are using the correct license file. |
3018 | The license file has expired. You need to apply for a renewal from Tencent Cloud. |
Others | Please contact the Tencent Cloud team to deal with it. |
TEMenuActivity.java in the demo project.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()) { //non-main threadxmagicApi.onDestroy()}}});
xmagicApi.seteffect();
xmagicApi.onDestroy()
피드백