Compare commits
1 Commits
master
...
gong_dev_g
Author | SHA1 | Date | |
---|---|---|---|
|
1deb197af6 |
@ -33,8 +33,7 @@ android {
|
|||||||
versionName rootProject.ext.android.versionName
|
versionName rootProject.ext.android.versionName
|
||||||
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
manifestPlaceholders = rootProject.ext.manifestPlaceholders
|
||||||
ndk {
|
ndk {
|
||||||
abiFilters "armeabi-v7a", "arm64-v8a"
|
abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
||||||
// abiFilters "armeabi-v7a", "arm64-v8a","x86","x86_64"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aaptOptions {
|
aaptOptions {
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
package com.yunbao.faceunity;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
|
|
||||||
import androidx.test.platform.app.Instrimport com.yunbao.common.utils.MobclickAgent;ntationRegistry;
|
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
||||||
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Instrumented test, which will execute on an Android device.
|
|
||||||
*
|
|
||||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
||||||
*/
|
|
||||||
@RunWith(AndroidJUnit4.class)
|
|
||||||
public class ExampleInstrumentedTest {
|
|
||||||
@Test
|
|
||||||
public void useAppContext() {
|
|
||||||
// Context of the app under test.
|
|
||||||
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
|
||||||
assertEquals("com.yunbao.faceunity.test", appContext.getPackageName());
|
|
||||||
}
|
|
||||||
}
|
|
@ -38,6 +38,9 @@ import java.util.Locale;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import cn.rongcloud.rtc.api.RCRTCEngine;
|
||||||
|
import cn.rongcloud.rtc.api.callback.IRCRTCVideoOutputFrameListener;
|
||||||
|
import cn.rongcloud.rtc.base.RCRTCVideoFrame;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 美颜模块管理类
|
* 美颜模块管理类
|
||||||
@ -175,6 +178,44 @@ public class FaceManager implements SensorEventListener {
|
|||||||
private static final int CAMERA_SWITCH_SKIP_FRAME = 0;
|
private static final int CAMERA_SWITCH_SKIP_FRAME = 0;
|
||||||
private volatile boolean mSkip;
|
private volatile boolean mSkip;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 渲染融云视频帧
|
||||||
|
*/
|
||||||
|
public void drawRongFrame(Context context) {
|
||||||
|
RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(new IRCRTCVideoOutputFrameListener() {
|
||||||
|
@Override
|
||||||
|
public RCRTCVideoFrame processVideoFrame(RCRTCVideoFrame callVideoFrame) {
|
||||||
|
//Log.i(TAG, "processVideoFrame: egl context " + EGL14.eglGetCurrentContext());
|
||||||
|
if (pauseFace) {
|
||||||
|
return callVideoFrame;
|
||||||
|
}
|
||||||
|
int width = callVideoFrame.getWidth();
|
||||||
|
int height = callVideoFrame.getHeight();
|
||||||
|
|
||||||
|
if (mIsFirstFrame) {
|
||||||
|
mIsFirstFrame = false;
|
||||||
|
//initCsvUtil(context);
|
||||||
|
mFURenderer.prepareRenderer(mFURendererListener);
|
||||||
|
}
|
||||||
|
//long start = System.nanoTime();
|
||||||
|
mFURenderer.setInputOrientation(callVideoFrame.getRotation());
|
||||||
|
FURenderOutputData data = mFURenderer.onDrawFrameInputWithReturn(callVideoFrame.getData(), width, height);
|
||||||
|
/* long time = System.nanoTime() - start;
|
||||||
|
if (mCSVUtils != null) {
|
||||||
|
mCSVUtils.writeCsv(null, time);
|
||||||
|
}*/
|
||||||
|
if (mSkippedFrames > 0 || mSkip) {
|
||||||
|
--mSkippedFrames;
|
||||||
|
return callVideoFrame;
|
||||||
|
}
|
||||||
|
if (data != null && data.getImage() != null && data.getImage().getBuffer() != null) {
|
||||||
|
callVideoFrame.setData(data.getImage().getBuffer());
|
||||||
|
}
|
||||||
|
return callVideoFrame;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录渲染工具,调试用,在processVideoFrame里使用
|
* 记录渲染工具,调试用,在processVideoFrame里使用
|
||||||
@ -237,6 +278,12 @@ public class FaceManager implements SensorEventListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 离开渲染界面时注销融云监听器,不然会绿屏
|
||||||
|
*/
|
||||||
|
public void onClose() {
|
||||||
|
RCRTCEngine.getInstance().getDefaultVideoStream().setVideoFrameListener(null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 释放资源
|
* 释放资源
|
||||||
|
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_animoji.png
Normal file
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.5 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_beauty.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.3 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_beauty_body.png
Normal file
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 1.8 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_big_head.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.4 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_fine_sticker.png
Normal file
After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 2.2 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_makeup.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.9 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/ico_home_sticker.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.9 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_baihu.png
Normal file
After Width: | Height: | Size: 276 KiB |
Before Width: | Height: | Size: 58 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_baimao.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 163 KiB |
Before Width: | Height: | Size: 131 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_douniuquan.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.8 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_frog_st.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 7.9 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_hashiqi.png
Normal file
After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_hetun.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 9.1 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_huangya.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 8.5 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_kaola.png
Normal file
After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_kuloutou.png
Normal file
After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.8 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_qgirl.png
Normal file
After Width: | Height: | Size: 78 KiB |
Before Width: | Height: | Size: 5.8 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_animoji_wuxia.png
Normal file
After Width: | Height: | Size: 128 KiB |
Before Width: | Height: | Size: 107 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_baozi.png
Normal file
After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 19 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_bluebird.png
Normal file
After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 8.7 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_fenhudie.png
Normal file
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 9.5 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_lanhudie.png
Normal file
After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 9.5 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_tiger.png
Normal file
After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 19 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_tiger_bai.png
Normal file
After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_tiger_huang.png
Normal file
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_ar_xiongmao.png
Normal file
After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 16 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_avatar_female.png
Normal file
After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 11 KiB |
BIN
FaceUnity/src/main/res/mipmap-xxhdpi/icon_avatar_male.png
Normal file
After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 2.8 KiB |
After Width: | Height: | Size: 3.5 KiB |