Compare commits

..

No commits in common. "master" and "直播间提示优化" have entirely different histories.

5027 changed files with 70218 additions and 27562 deletions

View File

@ -5,8 +5,8 @@ apply plugin: 'kotlin-parcelize'
apply from: "../package_config.gradle" apply from: "../package_config.gradle"
android { android {
namespace "com.yunbao.faceunity" compileSdkVersion rootProject.ext.android.compileSdkVersion
compileSdk rootProject.ext.android.compileSdkVersion buildToolsVersion rootProject.ext.android.buildToolsVersion
packagingOptions { packagingOptions {
pickFirst "lib/armeabi/libyuvutils.so" pickFirst "lib/armeabi/libyuvutils.so"
pickFirst "lib/arm64-v8a/libyuvutils.so" pickFirst "lib/arm64-v8a/libyuvutils.so"
@ -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 {
@ -49,8 +48,8 @@ android {
} }
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_18 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_18 targetCompatibility JavaVersion.VERSION_1_8
} }
} }
repositories { repositories {

View File

@ -1,5 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools"
package="com.yunbao.faceunity"
>
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.CAMERA" />

View File

@ -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);
}
/** /**
* 释放资源 * 释放资源

View File

@ -1,11 +1,10 @@
package com.yunbao.common.utils; package com.yunbao.faceunity.utils;
import android.util.Log; import android.util.Log;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -152,36 +151,16 @@ public class ZipUtils {
* @param zipFileString 解压完成的Zip路径 * @param zipFileString 解压完成的Zip路径
* @throws Exception * @throws Exception
*/ */
public static void zipFolder(List<String> srcFileString, String zipFileString, List<String> filters, Runnable runnable) throws Exception { public static void zipFolder(String srcFileString, String zipFileString) throws Exception {
if (filters == null) {
filters = new ArrayList<>();
}
filters.add(new File(zipFileString).getAbsolutePath());
final List<String> tmp = new ArrayList<>(filters);
//创建ZIP //创建ZIP
ZipOutputStream outZip = new ZipOutputStream(new FileOutputStream(zipFileString)); ZipOutputStream outZip = new ZipOutputStream(new FileOutputStream(zipFileString));
new Thread(new Runnable() {
@Override
public void run() {
try {
for (String src : srcFileString) {
File file = new File(src);
//压缩
zipFiles(file.getParent() + File.separator, file.getName(), outZip, tmp);
}
//创建文件 //创建文件
File file = new File(srcFileString);
//压缩
zipFiles(file.getParent() + File.separator, file.getName(), outZip);
//完成和关闭 //完成和关闭
outZip.finish(); outZip.finish();
outZip.close(); outZip.close();
runnable.run();
} catch (Exception e) {
e.printStackTrace();
}
}
}).start();
} }
/** /**
@ -192,15 +171,9 @@ public class ZipUtils {
* @param zipOutputSteam * @param zipOutputSteam
* @throws Exception * @throws Exception
*/ */
private static void zipFiles(String folderString, String fileString, ZipOutputStream zipOutputSteam, List<String> filters) throws Exception { private static void zipFiles(String folderString, String fileString, ZipOutputStream zipOutputSteam) throws Exception {
if (zipOutputSteam == null) if (zipOutputSteam == null)
return; return;
for (String filter : filters) {
if (fileString.startsWith(filter)) {
return;
}
}
System.out.println("压缩文件:" + folderString + "|" + fileString);
File file = new File(folderString + fileString); File file = new File(folderString + fileString);
if (file.isFile()) { if (file.isFile()) {
ZipEntry zipEntry = new ZipEntry(fileString); ZipEntry zipEntry = new ZipEntry(fileString);
@ -223,7 +196,7 @@ public class ZipUtils {
} }
//子文件和递归 //子文件和递归
for (int i = 0; i < fileList.length; i++) { for (int i = 0; i < fileList.length; i++) {
zipFiles(folderString, fileString + File.separator + fileList[i], zipOutputSteam, filters); zipFiles(folderString, fileString + File.separator + fileList[i], zipOutputSteam);
} }
} }
} }

View File

@ -13,7 +13,7 @@ import com.google.gson.JsonObject;
import com.yunbao.faceunity.entity.net.FineStickerEntity; import com.yunbao.faceunity.entity.net.FineStickerEntity;
import com.yunbao.faceunity.utils.FaceUnityData; import com.yunbao.faceunity.utils.FaceUnityData;
import com.yunbao.faceunity.utils.FileUtils; import com.yunbao.faceunity.utils.FileUtils;
import com.yunbao.common.utils.ZipUtils; import com.yunbao.faceunity.utils.ZipUtils;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Some files were not shown because too many files have changed in this diff Show More