glide library in the xmagic module to make it the same as the actual version number.xmagic module to make it the same as the actual version number..aar file in the libs directory of the Xmagic module with the .aar file in libs of your SDK.../src/main/assets of the Xmagic module with those in assets/ of your SDK. If there are files in the MotionRes folder of your SDK package, also copy them to the ../src/main/assets directory..so files in ../src/main/jniLibs of the Xmagic module with the .so files in jniLibs of your SDK package (you need to decompress the ZIP files in the jinLibs folder to get the .so files for arm64-v8a and armeabi-v7a).Xmagic module in the demo into your project.implementation 'com.tencent.liteav:LiteAVSDK_Enterprise:latest.release'implementation 'com.tencent.liteav:LiteAVSDK_Professional:latest.release'oncreate method in application in the project as follows:XMagicImpl.init(this);XMagicImpl.checkAuth(null);
XMagicImpl class with your obtained Tencent Effect SDK license URL and key.TCVideoRecordActivity.java as an example:TCVideoRecordActivity.java class:private XMagicImpl mXMagic;private int isPause = 0;// 0: not paused; 1: paused; 2: pausing; 3: to be terminated
onCreate method in the TCVideoRecordActivity.java class:TXUGCRecord instance = TXUGCRecord.getInstance(this);instance.setVideoProcessListener(new TXUGCRecord.VideoCustomProcessListener() {@Overridepublic int onTextureCustomProcess(int textureId, int width, int height) {if (isPause == 0 && mXMagic != null) {return mXMagic.process(textureId, width, height);}return 0;}@Overridepublic void onDetectFacePoints(float[] floats) {}@Overridepublic void onTextureDestroyed() {if (Looper.getMainLooper() != Looper.myLooper()) { // Not the main threadif (isPause == 1) {isPause = 2;if (mXMagic != null) {mXMagic.onDestroy();}initXMagic();isPause = 0;} else if (isPause == 3) {if (mXMagic != null) {mXMagic.onDestroy();}}}}});XMagicImpl.checkAuth((errorCode, msg) -> {if (errorCode == TELicenseCheck.ERROR_OK) {loadXmagicRes();} else {TXCLog.e("TAG", "Authentication failed. Check the authentication URL and key" + errorCode + " " + msg);}});
onStop method:isPause = 1;if (mXMagic != null) {mXMagic.onPause();}
onDestroy method:isPause = 3;XmagicPanelDataManager.getInstance().clearData();
onActivityResult method:if (mXMagic != null) {mXMagic.onActivityResult(requestCode, resultCode, data);}
private void loadXmagicRes() {if (XMagicImpl.isLoadedRes) {XmagicResParser.parseRes(getApplicationContext());initXMagic();return;}new Thread(() -> {XmagicResParser.setResPath(new File(getFilesDir(), "xmagic").getAbsolutePath());XmagicResParser.copyRes(getApplicationContext());XmagicResParser.parseRes(getApplicationContext());XMagicImpl.isLoadedRes = true;new Handler(Looper.getMainLooper()).post(() -> {initXMagic();});}).start();}/*** Initialize the beauty filter SDK*/private void initXMagic() {if (mXMagic == null) {mXMagic = new XMagicImpl(this, mUGCKitVideoRecord.getBeautyPanel());}else {mXMagic.onResume();}}
mBeautyPanel type in the AbsVideoRecordUI class to the RelativeLayout type and the response type of the getBeautyPanel() method to RelativeLayout. You also need to modify the corresponding XML configuration to comment out the code that reports errors.UGCKitVideoRecord class.ScrollFilterView class to delete the mBeautyPanel variable and comment out the code that reports errors.beautysettingkit modulebeautysettingkit module in the build.gradle file in the ugckit module and compile the project to comment out the code that report errors.Feedback