fix[声望升级-设置竖屏]
This commit is contained in:
@@ -91,7 +91,7 @@ public class SWManager extends BaseCacheManager {
|
||||
uid = Integer.parseInt(strUid);
|
||||
}
|
||||
try {
|
||||
if(mRtcEngine==null){
|
||||
if (mRtcEngine == null) {
|
||||
// 创建 RtcEngineConfig 对象,并进行配置
|
||||
RtcEngineConfig config = new RtcEngineConfig();
|
||||
config.mContext = mContext;
|
||||
@@ -111,21 +111,20 @@ public class SWManager extends BaseCacheManager {
|
||||
mRtcEngine.startPreview();
|
||||
|
||||
cfg = new VideoEncoderConfiguration();
|
||||
|
||||
//设置默认分辨率
|
||||
switch (IMLoginManager.get(mContext).getSelectClarity()) {
|
||||
case 0:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_840x480;
|
||||
break;
|
||||
case 1:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_1280x720;
|
||||
break;
|
||||
case 2:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_1920x1080;
|
||||
break;
|
||||
}
|
||||
VideoEncoderConfiguration.VideoDimensions videoDimensions = new VideoEncoderConfiguration.VideoDimensions();
|
||||
videoDimensions.width = 720;
|
||||
videoDimensions.height = 1280;
|
||||
cfg.dimensions = videoDimensions;
|
||||
|
||||
cfg.frameRate = 20;
|
||||
cfg.bitrate = 0;
|
||||
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_ENABLED; //镜像
|
||||
//镜像
|
||||
cfg.mirrorMode = VideoEncoderConfiguration.MIRROR_MODE_TYPE.MIRROR_MODE_ENABLED;
|
||||
//设置竖屏
|
||||
cfg.orientationMode = VideoEncoderConfiguration.ORIENTATION_MODE.ORIENTATION_MODE_FIXED_PORTRAIT;
|
||||
|
||||
mRtcEngine.setVideoEncoderConfiguration(cfg);
|
||||
|
||||
// 创建一个 SurfaceView 对象,并将其作为 FrameLayout 的子对象
|
||||
@@ -158,33 +157,9 @@ public class SWManager extends BaseCacheManager {
|
||||
* 2人连麦PK:360x640
|
||||
* 3人连麦PK:左侧主播 360x640,右侧两个主播 360x320
|
||||
* 4人连麦PK:360X320
|
||||
*
|
||||
* @param selectClarity
|
||||
*/
|
||||
public void setDimensions(int selectClarity) {
|
||||
if (cfg != null && mRtcEngine != null) {
|
||||
switch (selectClarity) {
|
||||
case 0:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_840x480;
|
||||
L.eSw("VideoEncoderConfiguration.VD_840x480");
|
||||
break;
|
||||
case 1:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_1280x720;
|
||||
L.eSw("VideoEncoderConfiguration.VD_1280x720");
|
||||
break;
|
||||
case 2:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_1920x1080;
|
||||
L.eSw("VideoEncoderConfiguration.VD_1920x1080");
|
||||
break;
|
||||
case 3:
|
||||
cfg.dimensions = VideoEncoderConfiguration.VD_320x240;
|
||||
L.eSw("VideoEncoderConfiguration.VD_320x240");
|
||||
break;
|
||||
}
|
||||
mRtcEngine.setVideoEncoderConfiguration(cfg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void setDrPkNumClarity(int selectClarity) {
|
||||
if (cfg != null && mRtcEngine != null) {
|
||||
VideoEncoderConfiguration.VideoDimensions videoDimensions = new VideoEncoderConfiguration.VideoDimensions();
|
||||
@@ -211,9 +186,6 @@ public class SWManager extends BaseCacheManager {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 设置镜像模式
|
||||
*/
|
||||
@@ -344,7 +316,7 @@ public class SWManager extends BaseCacheManager {
|
||||
@Override
|
||||
public void onVideoSizeChanged(Constants.VideoSourceType source, int uid, int width, int height, int rotation) {
|
||||
super.onVideoSizeChanged(source, uid, width, height, rotation);
|
||||
L.eSw("uid:"+uid+"\nwidth:"+width+"\nheight:"+height);
|
||||
L.eSw("uid:" + uid + "\nwidth:" + width + "\nheight:" + height);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -358,7 +330,7 @@ public class SWManager extends BaseCacheManager {
|
||||
* @param toUid
|
||||
* @param channelName
|
||||
*/
|
||||
public void joinChannelDrEx(FrameLayout frameLayout, String strUid, String token, String toUid, String channelName,int position) {
|
||||
public void joinChannelDrEx(FrameLayout frameLayout, String strUid, String token, String toUid, String channelName, int position) {
|
||||
int tempUid;
|
||||
if (StringUtil.isEmpty(strUid)) {
|
||||
tempUid = 0;
|
||||
@@ -532,10 +504,13 @@ public class SWManager extends BaseCacheManager {
|
||||
}
|
||||
}
|
||||
|
||||
public interface onDrPkJoinSuccessListener{
|
||||
public interface onDrPkJoinSuccessListener {
|
||||
void joinSuccess1();
|
||||
|
||||
void joinSuccess2();
|
||||
|
||||
void joinSuccess3();
|
||||
|
||||
void joinSuccess4();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user