调整融云推流参数

This commit is contained in:
zlzw 2022-11-09 09:44:18 +08:00
parent 628d9c7a1b
commit 88e27df986
4 changed files with 18 additions and 15 deletions

View File

@ -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;
}

View File

@ -272,7 +272,7 @@ public class AppContext extends CommonAppContext {
});
configSPApp();
//初始化美颜SDK
FaceManager.initFaceUnity(this);
// FaceManager.initFaceUnity(this);
}
/**

View File

@ -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();
// 创建本地视频显示视图

View File

@ -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() {