기본 개념
제품 장점
시나리오
파일 유형 | 설명 |
xmagic-xxx.aar | SDK, 필수 |
../assets/ | 알고리즘 모델, 소재 리소스 패키지, 필수 |
../jniLibs | so 라이브러리, 필수 |
.aar 파일을 app 프로젝트의 libs 디렉터리에 추가합니다.../src/main/assets 디렉터리에 복사합니다. SDK 패키지의 MotionRes 폴더에 파일이 있으면 ../src/main/assets 디렉터리에도 복사합니다.../src/main/jniLibs 디렉터리에 복사합니다.build.gradle을 열고 종속 참조 테이블을 추가합니다.android{...defaultConfig {applicationId "인증된 lic 라이선스에 바인딩된 패키지 이름으로 수정"....}packagingOptions {pickFirst ’**/libc++_shared.so’}}dependencies{...compile fileTree(dir: 'libs', include: ['*.jar','*.aar'])//추가 *.aar}
dependencies{implementation 'com.google.code.gson:gson:2.8.2'}
dependencies{//예시: S1-04 패키지는 다음과 같습니다implementation 'com.tencent.mediacloud:TencentEffect_S1-04:latest.release'}
defaultConfig {ndk {abiFilters "armeabi-v7a", "arm64-v8a"}}

../assets/MotionRes../assets/lut버전 | Maven 주소 |
A1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_A1-01:latest.release' |
A1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_A1-02:latest.release' |
A1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_A1-03:latest.release' |
A1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_A1-04:latest.release' |
A1 - 05 | implementation 'com.tencent.mediacloud:TencentEffect_A1-05:latest.release' |
A1 - 06 | implementation 'com.tencent.mediacloud:TencentEffect_A1-06:latest.release' |
S1 - 00 | implementation 'com.tencent.mediacloud:TencentEffect_S1-00:latest.release' |
S1 - 01 | implementation 'com.tencent.mediacloud:TencentEffect_S1-01:latest.release' |
S1 - 02 | implementation 'com.tencent.mediacloud:TencentEffect_S1-02:latest.release' |
S1 - 03 | implementation 'com.tencent.mediacloud:TencentEffect_S1-03:latest.release' |
S1 - 04 | implementation 'com.tencent.mediacloud:TencentEffect_S1-04:latest.release' |
v_cube. license이어야 합니다.//license를 다운로드하거나 업데이트하기 위한 것일 뿐 인증 결과에 신경 쓰지 않는다면 네 번째 매개변수가 null로 전달됩니다.TELicenseCheck.getInstance().setXMagicLicense(context, URL, KEY, null);
// 네트워크에서 so 라이브러리를 다운로드한 경우 TELicenseCheck.getInstance().setTELicense를 호출하기 전에 so 경로를 설정하십시오. 그렇지 않으면 인증이 실패합니다.// XmagicApi.setLibPathAndLoad(validLibsDirectory);// so가 apk 패키지에 내장되어 있으면 위의 메소드를 호출할 필요가 없습니다.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 필드가 잘못되었습니다. 처리를 위해 Tencent Cloud 팀에 문의하십시오. |
-7 | 서명 인증 실패. 처리를 위해 Tencent Cloud 팀에 문의하십시오. |
-8 | 복호화 실패. 처리를 위해 Tencent Cloud 팀에 문의하십시오. |
-9 | TELicense 필드의 JSON 필드가 올바르지 않습니다. 처리를 위해 Tencent Cloud 팀에 문의하십시오. |
-10 | 네트워크에서 리졸브된 TE 인증 정보가 비어 있습니다. 처리를 위해 Tencent Cloud 팀에 문의하십시오. |
-11 | IO 실패로 인해 로컬 파일에 TE 인증 정보를 쓰지 못했습니다. |
-12 | 다운로드에 실패했으며 로컬 asset의 리졸브도 실패했습니다. |
-13 | 인증에 실패했습니다. 패키지에 so가 있는지 확인하거나 so 경로가 올바르게 설정되었는지 확인하십시오. |
3004/3005 | 인증이 잘못되었습니다. Tencent Cloud 팀에 문의하십시오. |
3015 | Bundle Id / Package Name이 일치하지 않습니다. App 에서 사용하는 Bundle Id / Package Name이 신청한 것과 동일한지 확인하고 올바른 인증 파일이 사용되었는지 확인하십시오. |
3018 | 인증 파일이 만료되었으므로 Tencent Cloud에 연장을 신청해야 합니다. |
기타 | Tencent Cloud 팀에 문의하십시오. |
XmagicResParser.setResPath(new File(getFilesDir(), "xmagic").getAbsolutePath());//loading// 리소스 파일을 프라이빗 디렉터리에 copy합니다. 한 번만 수행하면 됩니다.XmagicResParser.copyRes(getApplicationContext());
XmagicResParser.setResPath(다운로드한 리소스 파일 로컬 경로);
XmagicResParser.java,XmagicUIProperty.java,XmagicPanelDataManager.java 코드.<android.opengl.GLSurfaceViewandroid:id="@+id/camera_gl_surface_view"android:layout_width="match_parent"android:layout_height="match_parent" />
//카메라 초기화mPreviewMgr = new PreviewMgr();//레이아웃의 GlSurfaceView 예제를 카메라 툴 클래스에 전달mPreviewMgr.onCreate(mGlSurfaceView,false);//미리보기 텍스처 데이터 콜백 함수 가입mPreviewMgr.setCustomTextureProcessor((textureId, textureWidth, textureHeight) -> {if (mXmagicApi == null) {return textureId;}//렌더링을 위해 뷰티 필터 sdk 호출int outTexture = mXmagicApi.process(textureId, textureWidth, textureHeight);return outTexture;});//Activity의 onResume 메소드에서 카메라 실행mPreviewMgr.onResume(this, 1280, 720);
mXmagicApi = new XmagicApi(this, XmagicResParser.getResPath(),new XmagicApi.OnXmagicPropertyErrorListener());
매개변수 | 의미 |
Context context | 컨텍스트 |
String resDir | |
OnXmagicPropertyErrorListener errorListener | 콜백 함수 구현 클래스 |
mXmagicApi.setTipsListener(new XmagicTipsListener() {final XmagicToast mToast = new XmagicToast();@Overridepublic void tipsNeedShow(String tips, String tipsIcon, int type, int duration) {mToast.show(MainActivity.this, tips, duration);}@Overridepublic void tipsNeedHide(String tips, String tipsIcon, int type) {mToast.dismiss();}});
int outTexture = mXmagicApi.process(textureId, textureWidth, textureHeight);
// 사용 가능한 입력 속성은 XmagicResParser.parseRes()에서 가져오기mXmagicApi.updateProperty(XmagicProperty<?> p);
//Activity의 onPause 시 호출되며 OpenGL 스레드에서 호출되어야 합니다.mXmagicApi.onPause();
//이 메소드는 GL 스레드에서 호출되어야 합니다.mXmagicApi.onDestroy()
피드백