VHLivePushConfig 发直播参数配置类

类名

VHLivePushConfig

方法

1、 构造方法

/**
 * 配合发起直播的参数
 * @Param type 发起直播的分辨率
 * @Param VHLivePushFormat.PUSH_MODE_SD // 低分辨率     352*288
 * @Param VHLivePushFormat.PUSH_MODE_HD // 普通分辨率   640*480 (默认)
 * @Param VHLivePushFormat.PUSH_MODE_XHD // 高分辨率    960*540
 * @Param VHLivePushFormat.PUSH_MODE_XXHD // 超高分辨率 1280*720
 */
public VHLivePushConfig(int type) {}

属性

1、 encodeType

/**
 * 编解码方式
 * @Param VHLivePushFormat.ENCODE_TYPE_SOFT // 软编 (默认)
 * @Param VHLivePushFormat.ENCODE_TYPE_HARD // 硬编
 * @Param VHLivePushFormat.ENCODE_TYPE_AUTO // 自动
 */
public int encodeType = VHLivePushFormat.ENCODE_TYPE_SOFT;

2、 encodeColorFormat

/**
 * 编码的颜色空间 默认YUV420SP
 */ 
public int encodeColorFormat = VHLivePushFormat.ENCODE_COLOR_FORMAT_YUV420SP_NV21;

3、 screenOri

/**
 * 横竖屏设置 (这个必须配置)
 * @Param VHLivePushFormat.SCREEN_ORI_LANDSPACE // 横屏
 * @Param VHLivePushFormat.SCREEN_ORI_PORTRAIT //  竖屏
 */
public int screenOri = VHLivePushFormat.SCREEN_ORI_LANDSPACE;

4、 videoBitrate

/**
 * 码率 默认400 * 1000
 */
public int videoBitrate = 400 * 1000;

5、 videoFrameRate

/**
 * 帧率 默认15帧
 */
public int videoFrameRate = 15;

6、 pushTimeout

/**
 * 发起超时时间 默认5秒
 */
public int pushTimeout = 5 * 1000;

7、 pushReconnectTimes

/**
 * 重连次数 默认5次
 */
 public int pushReconnectTimes = 5;

8、 streamMode

/**
 * 推流方式 默认RTMP
 */
public int streamMode = VHLivePushFormat.STREAM_MODE_RTMP;

9、 pushMode

/**
 *  发起方式
 *  public static final int STREAM_TYPE_AV = 1;
 *  public static final int STREAM_TYPE_V = 2;
 *  public static final int STREAM_TYPE_A = 3;
 */
public int pushMode = VHLivePushFormat.STREAM_TYPE_AV;