public class AlivcLivePushConfig
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
AlivcLivePushConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addWaterMark(java.lang.String path,
float x,
float y,
float width)
Add a watermark.
|
void |
clearWaterMark() |
AlivcImageFormat |
getAlivcExternMainImageFormat() |
AlivcSoundFormat |
getAlivcExternMainSoundFormat() |
int |
getAudioBitRate() |
protected boolean |
getAudioCaptureWithoutMix() |
protected int |
getAudioChannels() |
protected AlivcEncodeModeEnum |
getAudioEncodeMode()
Query the encoding mode of the audio.
|
protected int |
getAudioFormat() |
AlivcAudioAACProfileEnum |
getAudioProfile() |
protected AlivcAudioSampleRateEnum |
getAudioSamepleRate()
Query the audio sample rate.
|
AlivcBeautyLevelEnum |
getBeautyLevel() |
int |
getCameraType()
Query the camera type.
|
protected int |
getConnectRetryCount()
Query the maximum number of reconnections.
|
protected int |
getConnectRetryInterval()
Query the interval between two consecutive reconnections.
|
protected int |
getExposure() |
java.lang.String |
getExtraInfo()
Query extra auxiliary data.
|
protected int |
getFps()
Query the frame rate.
|
protected int |
getHeight() |
protected int |
getInitialVideoBitrate()
Query the initial bitrate of the video before encoding.
|
android.content.Intent |
getMediaProjectionPermissionResultData() |
protected int |
getMinFps() |
protected int |
getMinVideoBitrate()
Query the minimum bitrate of the video after encoding.
|
java.lang.String |
getNetworkPoorPushImage() |
java.lang.String |
getPausePushImage() |
AlivcPreviewDisplayMode |
getPreviewDisplayMode() |
int |
getPreviewOrientation()
Query the stream ingest mode.
|
protected int |
getPreviewRotation()
Set the rotation angle of the camera during preview.
|
AlivcQualityModeEnum |
getQualityMode() |
boolean |
getRequireRenderContextNotify() |
protected AlivcResolutionEnum |
getResolution() |
int |
getSendDataTimeout() |
protected int |
getTargetVideoBitrate()
Query the bitrate to be used after video encoding.
|
protected int |
getVideoEncodeGop() |
protected AlivcEncodeModeEnum |
getVideoEncodeMode()
Query the encoding mode of the video.
|
protected int |
getVideoFormat() |
(package private) java.util.ArrayList<WaterMarkInfo> |
getWaterMarkInfos() |
protected int |
getWidth() |
boolean |
isAudioOnly()
The audio-only stream ingest.
|
protected boolean |
isAutoFocus()
Query whether the autofocus feature is enabled.
|
boolean |
isBeautyOn()
Query whether beautification is enabled.
|
boolean |
isEnableAutoResolution() |
boolean |
isEnableBitrateControl() |
protected boolean |
isEnableNarrowbandHDForScreenPusher() |
boolean |
isExternMainStream()
Specify whether to ingest an external stream as a main stream.
|
protected boolean |
isFlash()
Query whether the flash is enabled.
|
protected boolean |
isFocusBySensor() |
protected boolean |
isPreviewMirror()
Query whether the preview mirroring mode is enabled.
|
protected boolean |
isPushMirror()
Query whether the mirroring mode is enabled during stream ingest.
|
boolean |
isVideoOnly()
The video-only stream ingest.
|
void |
removeWaterMark(java.lang.String path) |
void |
setAlivcExternMainImageFormat(AlivcImageFormat alivcExternMainImageFormat) |
void |
setAlivcExternMainSoundFormat(AlivcSoundFormat alivcExternMainSoundFormat) |
void |
setAudioBitRate(int audioBitRate) |
void |
setAudioCaptureWithoutMix(boolean on) |
void |
setAudioChannels(AlivcAudioChannelEnum audioChannels)
Set the number of sound channels used for audio collection.
|
void |
setAudioEncodeMode(AlivcEncodeModeEnum audioEncodeMode)
Set the encoding mode for the audio.
|
protected void |
setAudioFormat(int audioFormat) |
void |
setAudioOnly(boolean audioOnly)
Enable the audio-only stream ingest.
|
void |
setAudioProfile(AlivcAudioAACProfileEnum audioProfile) |
void |
setAudioSamepleRate(AlivcAudioSampleRateEnum audioSameple)
Set the audio sample rate.
|
void |
setAutoFocus(boolean autoFocus)
Specify whether to enable the autofocus feature.
|
void |
setBeautyLevel(AlivcBeautyLevelEnum beautyLevel) |
void |
setBeautyOn(boolean mBeautyOn)
Specify whether to enable beautification.
|
void |
setCameraType(AlivcLivePushCameraTypeEnum cameraType)
Set the camera type.
|
void |
setConnectRetryCount(int mConnectRetryCount)
Set the maximum number of reconnections in the range from 1 to 100.
|
void |
setConnectRetryInterval(int mConnectRetryInterval)
Set the interval between two consecutive reconnections in the range from 0 to 10000, excluding 0.
|
void |
setEnableAutoResolution(boolean enableAutoResolution) |
void |
setEnableBitrateControl(boolean enableBitrateControl) |
void |
setEnableNarrowbandHDForScreenPusher(boolean enable)
是否在抓屏推流场景下打开窄带高清(更低的带宽,更高的清晰度)开关
|
void |
setExposure(int mExposure)
设置曝光度 [0,100],默认0
|
void |
setExternMainStream(boolean externMainStream) |
void |
setExternMainStream(boolean externMainStream,
AlivcImageFormat format,
AlivcSoundFormat soundFormat) |
void |
setExtraInfo(java.lang.String extraInfo)
Configure extra auxiliary data, such as a user ID, for troubleshooting.
|
void |
setFlash(boolean flash)
Specify whether to enable the flash.
|
void |
setFocusBySensor(boolean focusBySensor)
The sensor-based focusing.
|
void |
setFps(AlivcFpsEnum fps)
Set the frame rate of the video that is collected.
|
void |
setInitialVideoBitrate(int initialVideoBitrate)
Set the initial bitrate of the video before encoding in the range from 100 to 5000.
|
static void |
setMediaProjectionPermissionResultData(android.content.Intent mediaProjectionPermissionResultData) |
void |
setMinFps(AlivcFpsEnum minFps)
Set the minimum frame rate of the video that is collected.
|
void |
setMinVideoBitrate(int minBitRate)
Set the minimum bitrate of the video after encoding in the range from 100 to 5000.
|
void |
setNetworkPoorPushImage(java.lang.String path) |
void |
setPausePushImage(java.lang.String path) |
void |
setPreviewDisplayMode(AlivcPreviewDisplayMode mPreviewDisplayMode) |
void |
setPreviewMirror(boolean mirror)
Enable the preview mirroring mode.
|
void |
setPreviewOrientation(AlivcPreviewOrientationEnum previewOrientation)
Set the stream ingest mode.
|
void |
setPreviewRotation(AlivcPreviewRotationEnum rotation) |
void |
setPushMirror(boolean pushMirror)
Specify whether to enable the mirroring mode during stream ingest.
|
void |
setQualityMode(AlivcQualityModeEnum quality) |
void |
setRequireRenderContextNotify(boolean need) |
void |
setResolution(AlivcResolutionEnum resolution)
Set the resolution.
|
void |
setSendDataTimeout(int sendDataTimeout)
Set the timeout period for stream ingest over Real-Time Messaging Protocol (RTMP).
|
void |
setTargetVideoBitrate(int targetBitRate)
Set the bitrate to be used after video encoding in the range from 100 to 5000.
|
void |
setUseAliPlayerForBGM(boolean useAliPlayerForBGM)
设置背景音乐使用阿里播放器来播放,默认使用内置播放器
内置播放器支持大部分场景,若有需要特别的格式,可以切换至阿里播放器,需要app添加5.4.1及以上版本的依赖
|
void |
setVideoEncodeGop(AlivcVideoEncodeGopEnum videoEncodeGop)
Set the size of the group of pictures (GOP).
|
void |
setVideoEncodeMode(AlivcEncodeModeEnum mVideoEncodeMode)
Set the encoding mode for the video.
|
protected void |
setVideoFormat(int videoFormat) |
void |
setVideoOnly(boolean audioOnly)
Enable the audio-only stream ingest.
|
protected boolean |
useAliPlayerForBGM() |
private static final int RESOLUTION_ALIGN
public static final java.lang.String CONFIG
private AlivcResolutionEnum mResolution
private AlivcFpsEnum mFps
private int mTargetVideoBitrate
private int mMinVideoBitrate
private int mInitialVideoBitrate
private AlivcAudioSampleRateEnum mAudioSamepleRate
private AlivcPreviewOrientationEnum mPreviewOrientation
private AlivcPreviewRotationEnum mPreviewRotation
private AlivcPreviewDisplayMode mPreviewDisplayMode
private AlivcLivePushCameraTypeEnum mCameraType
private boolean mPreviewMirror
private boolean mPushMirror
private boolean mAudioOnly
private boolean mVideoOnly
private boolean mAutoFocus
private boolean mFocusBySensor
private boolean mBeautyOn
private int mBeautyWhite
private int mBeautyBuffing
private int mBeautyCheekPink
private int mBeautyBrightness
private int mBeautyRuddy
private int mBeautyThinFace
private int mBeautyBigEye
private int mBeautyShortenFace
private boolean mFlash
private int mWidth
private int mHeight
private int mConnectRetryCount
private int mConnectRetryInterval
private long mPtsMaxDiff
private int mMaxTimeoutCount
private AlivcAudioChannelEnum mAudioChannels
private AlivcEncodeModeEnum mVideoEncodeMode
private AlivcEncodeModeEnum mAudioEncodeMode
private int mVideoFormat
private int mAudioFormat
private AlivcImageFormat mAlivcExternMainImageFormat
private AlivcSoundFormat mAlivcExternMainSoundFormat
private AlivcVideoEncodeGopEnum mVideoEncodeGop
private int mExposure
private boolean mUseAliPlayerForBGM
private boolean enableNarrowbandHDForScreenPusher
private AlivcFpsEnum minFps
private boolean enableBitrateControl
private boolean enableAutoResolution
private boolean initBitFlag
private boolean minBitFlag
private boolean targetBitFlag
private boolean externMainStream
private int sendDataTimeout
private AlivcQualityModeEnum qualityMode
private AlivcBeautyLevelEnum beautyLevel
private AlivcAudioAACProfileEnum audioProfile
private int audioBitRate
private static android.content.Intent mediaProjectionPermissionResultData
private java.lang.String mPausePushImagePath
private java.lang.String mNetworkPoorPushImagePath
private boolean requireGLSharedContext
private boolean mAudioCaptureWithouMix
private java.lang.String mExtraInfo
private java.util.ArrayList<WaterMarkInfo> waterMarkInfos
protected int getVideoFormat()
protected void setVideoFormat(int videoFormat)
protected int getAudioFormat()
protected void setAudioFormat(int audioFormat)
protected AlivcResolutionEnum getResolution()
public void setResolution(AlivcResolutionEnum resolution)
resolution
- The resolution. A custom resolution and the following resolutions are supported: 180P, 240P, 360P, 480P, 540P, 720P, and 1080P.public java.lang.String getExtraInfo()
public void setExtraInfo(java.lang.String extraInfo)
extraInfo
- protected int getFps()
public void setFps(AlivcFpsEnum fps)
fps
- The frame rate.protected int getTargetVideoBitrate()
public void setTargetVideoBitrate(int targetBitRate)
targetBitRate
- The bitrate to be used after video encoding.protected int getMinVideoBitrate()
public void setMinVideoBitrate(int minBitRate)
minBitRate
- protected AlivcAudioSampleRateEnum getAudioSamepleRate()
public void setAudioSamepleRate(AlivcAudioSampleRateEnum audioSameple)
audioSameple
- The audio sample rate.public int getPreviewOrientation()
public void setPreviewOrientation(AlivcPreviewOrientationEnum previewOrientation)
previewOrientation
- The stream ingest mode.protected int getPreviewRotation()
public void setPreviewRotation(AlivcPreviewRotationEnum rotation)
public int getCameraType()
public void setCameraType(AlivcLivePushCameraTypeEnum cameraType)
cameraType
- The camera type.protected boolean isPreviewMirror()
public void setPreviewMirror(boolean mirror)
mirror
- The preview mirroring mode.public boolean isAudioOnly()
public void setAudioOnly(boolean audioOnly)
audioOnly
- The audio-only stream ingest.public boolean isVideoOnly()
public void setVideoOnly(boolean audioOnly)
audioOnly
- The audio-only stream ingest.protected boolean isAutoFocus()
public void setAutoFocus(boolean autoFocus)
autoFocus
- The autofocus feature.protected boolean isFocusBySensor()
public void setFocusBySensor(boolean focusBySensor)
focusBySensor
- public boolean isBeautyOn()
public void setBeautyOn(boolean mBeautyOn)
mBeautyOn
- Specify whether to enable beautification.protected boolean isFlash()
public void setFlash(boolean flash)
flash
- Enable the flash.public void addWaterMark(java.lang.String path, float x, float y, float width)
path
- The path of the watermark image.x
- The x-coordinate of the upper-left corner of the watermark. The x-coordinate is represented by the proportion of the watermark width to the screen width. The proportion value ranges from 0 to 1.y
- The y-coordinate of the upper-left corner of the watermark. The y-coordinate is represented by the proportion of the watermark height to the screen height. The proportion value ranges from 0 to 1.width
- The width of the watermark. The width is represented by the proportion of the watermark width to the screen width. The proportion value ranges from 0 to 1.public void clearWaterMark()
public void removeWaterMark(java.lang.String path)
public int getSendDataTimeout()
public void setSendDataTimeout(int sendDataTimeout)
sendDataTimeout
- The timeout period. Unit: milliseconds.public void setPausePushImage(java.lang.String path)
public void setNetworkPoorPushImage(java.lang.String path)
public java.lang.String getPausePushImage()
public java.lang.String getNetworkPoorPushImage()
protected int getInitialVideoBitrate()
public void setInitialVideoBitrate(int initialVideoBitrate)
initialVideoBitrate
- The initial bitrate of the video before encoding.protected int getConnectRetryCount()
public void setConnectRetryCount(int mConnectRetryCount)
mConnectRetryCount
- protected int getConnectRetryInterval()
public void setConnectRetryInterval(int mConnectRetryInterval)
mConnectRetryInterval
- The interval between two consecutive reconnections. Unit: milliseconds.protected boolean isPushMirror()
public void setPushMirror(boolean pushMirror)
pushMirror
- The mirroring mode during stream ingest.protected AlivcEncodeModeEnum getVideoEncodeMode()
public void setVideoEncodeMode(AlivcEncodeModeEnum mVideoEncodeMode)
mVideoEncodeMode
- The encoding mode.protected AlivcEncodeModeEnum getAudioEncodeMode()
public void setAudioEncodeMode(AlivcEncodeModeEnum audioEncodeMode)
audioEncodeMode
- The encoding mode.protected int getWidth()
protected int getHeight()
protected int getAudioChannels()
public void setAudioChannels(AlivcAudioChannelEnum audioChannels)
audioChannels
- The number of sound channels.protected int getVideoEncodeGop()
public void setVideoEncodeGop(AlivcVideoEncodeGopEnum videoEncodeGop)
videoEncodeGop
- The size of GOP.protected int getExposure()
public void setUseAliPlayerForBGM(boolean useAliPlayerForBGM)
useAliPlayerForBGM
- 默认值falseprotected boolean useAliPlayerForBGM()
public void setEnableNarrowbandHDForScreenPusher(boolean enable)
enable
- 默认值trueprotected boolean isEnableNarrowbandHDForScreenPusher()
public void setExposure(int mExposure)
mExposure
- The exposure value. Valid values: [0,100].java.util.ArrayList<WaterMarkInfo> getWaterMarkInfos()
protected int getMinFps()
public void setMinFps(AlivcFpsEnum minFps)
minFps
- The minimum frame rate of the video that is collected.public AlivcAudioAACProfileEnum getAudioProfile()
public void setAudioProfile(AlivcAudioAACProfileEnum audioProfile)
public int getAudioBitRate()
public void setAudioBitRate(int audioBitRate)
public void setQualityMode(AlivcQualityModeEnum quality)
public AlivcQualityModeEnum getQualityMode()
public AlivcBeautyLevelEnum getBeautyLevel()
public void setBeautyLevel(AlivcBeautyLevelEnum beautyLevel)
public android.content.Intent getMediaProjectionPermissionResultData()
public static void setMediaProjectionPermissionResultData(android.content.Intent mediaProjectionPermissionResultData)
public boolean isEnableBitrateControl()
public void setEnableBitrateControl(boolean enableBitrateControl)
public boolean isEnableAutoResolution()
public void setEnableAutoResolution(boolean enableAutoResolution)
public boolean isExternMainStream()
public void setExternMainStream(boolean externMainStream)
public void setExternMainStream(boolean externMainStream, AlivcImageFormat format, AlivcSoundFormat soundFormat)
public AlivcImageFormat getAlivcExternMainImageFormat()
public void setAlivcExternMainImageFormat(AlivcImageFormat alivcExternMainImageFormat)
public AlivcSoundFormat getAlivcExternMainSoundFormat()
public void setAlivcExternMainSoundFormat(AlivcSoundFormat alivcExternMainSoundFormat)
public AlivcPreviewDisplayMode getPreviewDisplayMode()
public void setPreviewDisplayMode(AlivcPreviewDisplayMode mPreviewDisplayMode)
public void setRequireRenderContextNotify(boolean need)
public boolean getRequireRenderContextNotify()
public void setAudioCaptureWithoutMix(boolean on)
protected boolean getAudioCaptureWithoutMix()