diff --git a/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java b/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java index 9462122c8..82786f636 100644 --- a/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java +++ b/FaceUnity/src/main/java/com/yunbao/faceunity/FaceManager.java @@ -71,7 +71,7 @@ public class FaceManager implements SensorEventListener { * 配置美颜SDK */ public void initFURender(Context context) { - + initFaceUnity(context); mFURenderer = FURenderer.getInstance(); mFURenderer.setInputTextureType(FUInputTextureEnum.FU_ADM_FLAG_COMMON_TEXTURE); mFURenderer.setCameraFacing(CameraFacingEnum.CAMERA_FRONT); @@ -105,9 +105,11 @@ public class FaceManager implements SensorEventListener { } }); } - public void loadConfig(){ + + public void loadConfig() { initFaceBeauty(); } + public void initFaceBeauty() { FaceBeautyDataFactory faceBeautyDataFactory; faceBeautyDataFactory = new FaceBeautyDataFactory(); @@ -115,9 +117,9 @@ public class FaceManager implements SensorEventListener { for (String key : configMap.keySet()) { if ("FilterViewHolder_".equals(key)) { for (FaceBeautyFilterBean filter : faceBeautyDataFactory.getBeautyFilters()) { - if (filter.getKey().equals(configMap.get(key))&&!"origin".equals(configMap.get(key))) { - faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")))/100, filter.getDesRes()); - Log.i(TAG, "test: 设置滤镜 ="+filter.getKey()+" val = "+configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")); + if (filter.getKey().equals(configMap.get(key)) && !"origin".equals(configMap.get(key))) { + faceBeautyDataFactory.onFilterSelected(filter.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get("FilterViewHolder_" + configMap.get(key) + "_val"))) / 100, filter.getDesRes()); + Log.i(TAG, "test: 设置滤镜 =" + filter.getKey() + " val = " + configMap.get("FilterViewHolder_" + configMap.get(key) + "_val")); break; } } @@ -125,17 +127,17 @@ public class FaceManager implements SensorEventListener { String name = key.replace("BeautySkinViewHolder_", ""); for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) { if (bean.getKey().equals(name)) { - faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); - Log.i(TAG, "test: 设置美颜 = "+bean.getKey()+" val = "+configMap.get(key)); + faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); + Log.i(TAG, "test: 设置美颜 = " + bean.getKey() + " val = " + configMap.get(key)); break; } } - }else if(key.startsWith("BeautyShapeViewHolder")){ + } else if (key.startsWith("BeautyShapeViewHolder")) { String name = key.replace("BeautyShapeViewHolder_", ""); for (FaceBeautyBean bean : faceBeautyDataFactory.getShapeBeauty()) { if (bean.getKey().equals(name)) { - faceBeautyDataFactory.updateParamIntensity(bean.getKey(),Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); - Log.i(TAG, "test: 设置美肤 = "+bean.getKey()+" val = "+configMap.get(key)); + faceBeautyDataFactory.updateParamIntensity(bean.getKey(), Double.parseDouble((String) Objects.requireNonNull(configMap.get(key)))); + Log.i(TAG, "test: 设置美肤 = " + bean.getKey() + " val = " + configMap.get(key)); break; } } @@ -277,6 +279,7 @@ public class FaceManager implements SensorEventListener { } catch (Exception e) { e.printStackTrace(); } + isInit = false; } diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 9486571a2..dd1ba1385 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -272,7 +272,7 @@ public class AppContext extends CommonAppContext { }); configSPApp(); //初始化美颜SDK - FaceManager.initFaceUnity(this); + // FaceManager.initFaceUnity(this); } /** diff --git a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java index 4d769c79c..d04997f10 100644 --- a/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LivePushRyViewHolder.java @@ -504,13 +504,13 @@ public class LivePushRyViewHolder extends AbsRyLivePushViewHolder implements ITX RCRTCVideoStreamConfig videoConfigBuilder = RCRTCVideoStreamConfig.Builder.create() //设置分辨率 - .setVideoResolution(RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_1080_1920) + .setVideoResolution(RCRTCParamsType.RCRTCVideoResolution.RESOLUTION_480_720) //设置帧率 - .setVideoFps(RCRTCParamsType.RCRTCVideoFps.Fps_24) + .setVideoFps(RCRTCParamsType.RCRTCVideoFps.Fps_30) //设置最小码率,480P下推荐200 .setMinRate(250) //设置最大码率,480P下推荐900 - .setMaxRate(10000) + .setMaxRate(5000) .build(); // 创建本地视频显示视图 diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 527df2269..7184633c5 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -489,7 +489,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene public void run() { if (IMLoginManager.get(mContext).isHint()) { HintDialog fragment = new HintDialog(); - fragment.show(((FragmentActivity) mContext).getSupportFragmentManager(), "HintDialog"); + fragment.show(MainActivity.this.getSupportFragmentManager(), "HintDialog"); fragment.setListener(new HintDialog.HintListener() { @Override public void requestPermission() {