AliVCSDK  6.0.0
阿里云音视频SDK,为视频开发者提供一站式接入服务
com.alivc.live.pusher.AlivcLivePusher Class Reference

Live pusher abstract class. More...

Inheritance diagram for com.alivc.live.pusher.AlivcLivePusher:

Public Member Functions

void init (Context context, AlivcLivePushConfig config) throws IllegalArgumentException, IllegalStateException
 
void destroy () throws IllegalStateException
 
void setLivePusherReference (AlivcLivePusher livePusher)
 
void startPreview (SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException
 
void startPreviewAsync (SurfaceView surfaceView) throws IllegalArgumentException, IllegalStateException
 
void startPreview (Context context, FrameLayout frameLayout, boolean isAnchor) throws IllegalArgumentException, IllegalStateException
 
void stopPreview () throws IllegalStateException
 
void startPush (String url) throws IllegalArgumentException, IllegalStateException
 
void startPushAsync (String url) throws IllegalArgumentException, IllegalStateException
 
void restartPush () throws IllegalStateException
 
void restartPushAsync () throws IllegalStateException
 
void reconnectPushAsync (String url) throws IllegalStateException
 
void stopPush () throws IllegalStateException
 
void pause () throws IllegalStateException
 
void resume () throws IllegalStateException
 
void resumeAsync () throws IllegalStateException
 
void switchCamera () throws IllegalStateException
 
void setAutoFocus (boolean autoFocus) throws IllegalStateException
 
void focusCameraAtAdjustedPoint (float x, float y, boolean autoFocus) throws IllegalArgumentException, IllegalStateException
 
void setZoom (int zoom) throws IllegalArgumentException, IllegalStateException
 
int getMaxZoom () throws IllegalStateException
 
int getCurrentZoom () throws IllegalStateException
 
void setMute (boolean mute) throws IllegalStateException
 
void setFlash (boolean flash) throws IllegalStateException
 
void setPushMirror (boolean mirror) throws IllegalStateException
 
void setPreviewMirror (boolean mirror) throws IllegalStateException
 
void setTargetVideoBitrate (int targetVideoBitrate) throws IllegalArgumentException, IllegalStateException
 
void setMinVideoBitrate (int minVideoBitrate) throws IllegalArgumentException, IllegalStateException
 
boolean isCameraSupportAutoFocus ()
 
boolean isCameraSupportFlash ()
 
boolean isPushing () throws IllegalStateException
 
boolean isNetworkPushing () throws IllegalStateException
 
void setCustomDetect (AlivcLivePushCustomDetect customVideoDetect)
 
void setCustomFilter (AlivcLivePushCustomFilter customVideoFilter)
 
void setCustomAudioFilter (AlivcLivePushCustomAudioFilter customAudioFilter)
 
AlivcLivePushStats getCurrentStatus ()
 
void setLivePushErrorListener (AlivcLivePushErrorListener errorListener)
 
void setLivePushInfoListener (AlivcLivePushInfoListener infoListener)
 
void setLivePushNetworkListener (AlivcLivePushNetworkListener networkListener)
 
void setLivePushBGMListener (AlivcLivePushBGMListener pushBGMListener)
 
void setLivePushRenderContextListener (AlivcLivePusherRenderContextListener renderCtxListener)
 
AlivcLivePushStatsInfo getLivePushStatsInfo () throws IllegalStateException
 
String getPushUrl ()
 
void setPreviewOrientation (AlivcPreviewOrientationEnum orientation)
 
int setAudioEffectVoiceChangeMode (AlivcLivePushAudioEffectVoiceChangeMode mode)
 
int setAudioEffectReverbMode (AlivcLivePushAudioEffectReverbMode mode)
 
void startBGMAsync (String path) throws IllegalStateException
 
void stopBGMAsync () throws IllegalStateException
 
void pauseBGM () throws IllegalStateException
 
void resumeBGM () throws IllegalStateException
 
void setBGMLoop (boolean isLoop) throws IllegalStateException
 
void setBGMEarsBack (boolean isOpen) throws IllegalStateException
 
void setBGMVolume (int volume) throws IllegalStateException, IllegalArgumentException
 
void setCaptureVolume (int volume) throws IllegalStateException, IllegalArgumentException
 
void setAudioDenoise (boolean on)
 
int startIntelligentDenoise ()
 
int stopIntelligentDenoise ()
 
void setQualityMode (AlivcQualityModeEnum mode) throws IllegalStateException
 
void setPreviewMode (AlivcPreviewDisplayMode mode) throws IllegalStateException
 
void pauseScreenCapture () throws IllegalStateException
 
void resumeScreenCapture () throws IllegalStateException
 
AlivcLivePushError getLastError ()
 
void changeResolution (AlivcResolutionEnum resolution)
 
void addWaterMark (String path, float x, float y, float width)
 
void setWatermarkVisible (boolean visible)
 
int startCamera (SurfaceView surfaceView) throws IllegalStateException
 
void stopCamera ()
 
void setScreenOrientation (int orientation)
 
int startCameraMix (float x, float y, float w, float h)
 
void stopCameraMix ()
 
void snapshot (int count, int interval, AlivcSnapshotListener listener)
 
void inputStreamVideoPtr (long dataPtr, int width, int height, int stride, int size, long pts, int rotation)
 
void inputStreamVideoData (byte[] data, int width, int height, int stride, int size, long pts, int rotation)
 
void inputStreamAudioPtr (long dataPtr, int size, int sampleRate, int channels, long pts)
 
void inputStreamAudioData (byte[] data, int size, int sampleRate, int channels, long pts)
 
int addDynamicsAddons (String path, float x, float y, float w, float h)
 
void removeDynamicsAddons (int id)
 
void setExposure (int exposure)
 
int getCurrentExposure ()
 
int getSupportedMinExposure ()
 
int getSupportedMaxExposure ()
 
void sendMessage (String info, int repeat, int delay, boolean isKeyFrame)
 
int setLiveMixTranscodingConfig (AlivcLiveTranscodingConfig config)
 
int muteLocalCamera (boolean mute)
 
int enableSpeakerphone (boolean enable)
 
boolean isSpeakerphoneOn ()
 
String getLiveTraceId ()
 

Detailed Description

Live pusher abstract class.

Author
aliyun live push sdk
Date
2017/10/8
Note
Customers need to declare and apply for READ_PHONE_STATE permission, otherwise, the mute feature will not be effective automatically when answering calls!
See also
com.alivc.live.pusher.AlivcLivePushConfig
com.alivc.live.annotations.AlivcLiveMode
AliLive Push SDK Doc
AliLive Push SDK Interactive Doc
AliLive Push SDK License Doc

Definition at line 28 of file AlivcLivePusher.java.

Member Function Documentation

int com.alivc.live.pusher.AlivcLivePusher.addDynamicsAddons ( String  path,
float  x,
float  y,
float  w,
float  h 
)

add dynamic addons

Parameters
pathdynamic addons path, contains 'config.json'
xx Position(0~1.0f)
yy Position(0~1.0f)
wwidth(0~1.0f)
hheight(0~1.0f)
Returns
id dynamic addons id

Definition at line 1140 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.addWaterMark ( String  path,
float  x,
float  y,
float  width 
)

add water mark, start position: x[0,width) y[0,height) w(0,width], max count is 3

Parameters
pathwater mark path
xthe relative position of the x-axis position at the upper left corner of the watermark is 0-1
ythe relative position of the y-axis at the upper right corner of the watermark is 0-1
widththe relative position of watermark display width 0~1
Note
It needs to be called after startPreview

Definition at line 947 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.changeResolution ( AlivcResolutionEnum  resolution)

change resolution dynamically

Parameters
resolutionresolution

Definition at line 930 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.destroy ( ) throws IllegalStateException

destroy pusher

Exceptions
IllegalStateExceptionIf the status is invalid, such as not yet initialized

Definition at line 81 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.enableSpeakerphone ( boolean  enable)

Set current audio device output

Parameters
enabletrue:speakerphone(as default);false:earphone
Returns
0 -> success,<0 -> failed
Note
The API is not supported in the basic mode currently, and calls have no effect.

Definition at line 1276 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.focusCameraAtAdjustedPoint ( float  x,
float  y,
boolean  autoFocus 
) throws IllegalArgumentException, IllegalStateException

change camera focus at adjusted point

Parameters
xx position
yy position
autoFocusauto focus
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 320 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.getCurrentExposure ( )

Get current exposure

Returns
current exposure

Definition at line 1179 of file AlivcLivePusher.java.

AlivcLivePushStats com.alivc.live.pusher.AlivcLivePusher.getCurrentStatus ( )

get current status

Returns
current status

Definition at line 552 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.getCurrentZoom ( ) throws IllegalStateException

Get current zoom

Returns
current zoom
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 362 of file AlivcLivePusher.java.

AlivcLivePushError com.alivc.live.pusher.AlivcLivePusher.getLastError ( )

get last error

Returns
last error

Definition at line 917 of file AlivcLivePusher.java.

AlivcLivePushStatsInfo com.alivc.live.pusher.AlivcLivePusher.getLivePushStatsInfo ( ) throws IllegalStateException

get live push stats info

Returns
live push stats info
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized

Definition at line 631 of file AlivcLivePusher.java.

String com.alivc.live.pusher.AlivcLivePusher.getLiveTraceId ( )

Get live trace id

Returns
trace id
Note
The API is not supported in interactive mode currently. The call returns an empty string.

Definition at line 1304 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.getMaxZoom ( ) throws IllegalStateException

Get max zoom of camera

Returns
max zoom
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 348 of file AlivcLivePusher.java.

String com.alivc.live.pusher.AlivcLivePusher.getPushUrl ( )

get push url

Returns
push url

Definition at line 644 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.getSupportedMaxExposure ( )

Get max supported exposure

Returns
max supported exposure

Definition at line 1205 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.getSupportedMinExposure ( )

Get min supported exposure

Returns
min supported exposure

Definition at line 1192 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.init ( Context  context,
AlivcLivePushConfig  config 
) throws IllegalArgumentException, IllegalStateException

init push config

Parameters
contextcontext
configpush config
Exceptions
IllegalArgumentExceptionIf config is null or the value of config is invalid (for example, the bitrate value exceeds the range)
IllegalStateExceptionIf the status is invalid, for example, it has been initialized but has not been destroyed

Definition at line 43 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioData ( byte[]  data,
int  size,
int  sampleRate,
int  channels,
long  pts 
)

input external audio stream data

Parameters
dataaudio data byte array
sizeaudio size
sampleRateaudio sample rate
channelsaudio channels
ptsaudio data pts(US)
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
See also
com.alivc.live.pusher.AlivcLivePushConfig::setExternMainStream(boolean, com.alivc.live.pusher.AlivcImageFormat, com.alivc.live.pusher.AlivcSoundFormat)

Definition at line 1122 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.inputStreamAudioPtr ( long  dataPtr,
int  size,
int  sampleRate,
int  channels,
long  pts 
)

input external audio stream data

Parameters
dataPtraudio data ptr
sizeaudio size
sampleRateaudio sample rate
channelsaudio channels
ptsaudio data pts(US)
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
See also
com.alivc.live.pusher.AlivcLivePushConfig::setExternMainStream(boolean, com.alivc.live.pusher.AlivcImageFormat, com.alivc.live.pusher.AlivcSoundFormat)

Definition at line 1103 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoData ( byte[]  data,
int  width,
int  height,
int  stride,
int  size,
long  pts,
int  rotation 
)

input external video stream data

Parameters
datavideo image byte array
widthvideo image width
heightvideo image height
stridevideo image stride
sizevideo image size
ptsvideo image pts(us)
rotationvideo image rotation
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
See also
com.alivc.live.pusher.AlivcLivePushConfig::setExternMainStream(boolean, com.alivc.live.pusher.AlivcImageFormat, com.alivc.live.pusher.AlivcSoundFormat)

Definition at line 1084 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.inputStreamVideoPtr ( long  dataPtr,
int  width,
int  height,
int  stride,
int  size,
long  pts,
int  rotation 
)

input external video stream data

Parameters
dataPtrvideo image data ptr
widthvideo image width
heightvideo image height
stridevideo image stride
sizevideo image size
ptsvideo image pts(us)
rotationvideo image rotation
Note
Before calling, it is necessary to configure AlivcLivePushConfig::setExternMainStream to enable an external custom input stream before it can take effect
See also
com.alivc.live.pusher.AlivcLivePushConfig::setExternMainStream(boolean, com.alivc.live.pusher.AlivcImageFormat, com.alivc.live.pusher.AlivcSoundFormat)

Definition at line 1063 of file AlivcLivePusher.java.

boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportAutoFocus ( )

if camera support auto focus

Returns
camera auto focus

Definition at line 459 of file AlivcLivePusher.java.

boolean com.alivc.live.pusher.AlivcLivePusher.isCameraSupportFlash ( )

if camera support flash

Returns
camera flash

Definition at line 472 of file AlivcLivePusher.java.

boolean com.alivc.live.pusher.AlivcLivePusher.isNetworkPushing ( ) throws IllegalStateException

is network pushing

Returns
network pushing
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPush

Definition at line 500 of file AlivcLivePusher.java.

boolean com.alivc.live.pusher.AlivcLivePusher.isPushing ( ) throws IllegalStateException

is pushing

Returns
true:pushing false:not push
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPush

Definition at line 486 of file AlivcLivePusher.java.

boolean com.alivc.live.pusher.AlivcLivePusher.isSpeakerphoneOn ( )

Get current audio device output

Returns
true->speakerphone,false->earphone
Note
The API is not supported in the basic mode currently, and calls have no effect.

Definition at line 1290 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.muteLocalCamera ( boolean  mute)

mute local camera

Parameters
mutetrue->do not send video frames, false->resume to normal
Returns
0->success, not 0->failed
Note
It is used on pusher, and makes effect on subscriber
If currently set AlivcLivePushConfig::setPausePushImage, preview is normal, and subscriber will show pause image;
If currently not set AlivcLivePushConfig::setPausePushImage, preview is normal, and subscriber will show black screen;
The API is not supported in the basic mode currently, and calls have no effect.

Definition at line 1261 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.pause ( ) throws IllegalStateException

pause push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/pause

Definition at line 251 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.pauseBGM ( ) throws IllegalStateException

pause BGM

Exceptions
IllegalStateExceptioninvalid status

Definition at line 729 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.pauseScreenCapture ( ) throws IllegalStateException

pause screen capture(Open privacy settings)

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview/not startPush/pause

Definition at line 891 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.reconnectPushAsync ( String  url) throws IllegalStateException

reconnect push async

Parameters
urlpush url
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush

Definition at line 225 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.removeDynamicsAddons ( int  id)

remove dynamic addons

Parameters
iddynamic addons id

Definition at line 1153 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.restartPush ( ) throws IllegalStateException

restart push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush

Definition at line 198 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.restartPushAsync ( ) throws IllegalStateException

restart push async

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush

Definition at line 211 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.resume ( ) throws IllegalStateException

resume push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/resume

Definition at line 264 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.resumeAsync ( ) throws IllegalStateException

resume push async

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/resume

Definition at line 277 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.resumeBGM ( ) throws IllegalStateException

resume BGM

Exceptions
IllegalStateExceptioninvalid status

Definition at line 742 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.resumeScreenCapture ( ) throws IllegalStateException

resume screen capture(Close privacy settings)

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview/not startPush/pause/resume

Definition at line 904 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.sendMessage ( String  info,
int  repeat,
int  delay,
boolean  isKeyFrame 
)

Send SEI

Parameters
infoThe SEI message, recommended format is json
repeatsend frames
delaysend delay
isKeyFrameis key frame

Definition at line 1221 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setAudioDenoise ( boolean  on)

set audio denoise

Parameters
ontrue:open false:close

Definition at line 813 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectReverbMode ( AlivcLivePushAudioEffectReverbMode  mode)

set audio effect reverb mode

Parameters
modeaudio effect reverb mode
Returns
0->success, not 0->failed
Note
The call takes effect before and during streaming
See also
AlivcLivePushAudioEffectReverbMode

Definition at line 689 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.setAudioEffectVoiceChangeMode ( AlivcLivePushAudioEffectVoiceChangeMode  mode)

set audio effect voice change mode

Parameters
modeaudio effect voice change mode
Returns
0->success, not 0->failed
Note
The call takes effect before and during streaming
See also
AlivcLivePushAudioEffectVoiceChangeMode

Definition at line 673 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setAutoFocus ( boolean  autoFocus) throws IllegalStateException

set auto focus

Parameters
autoFocusauto focus
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 304 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setBGMEarsBack ( boolean  isOpen) throws IllegalStateException

set ears back

Parameters
isOpenis open
Exceptions
IllegalStateExceptioninvalid status

Definition at line 770 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setBGMLoop ( boolean  isLoop) throws IllegalStateException

set BGM loop

Parameters
isLoopis loop
Exceptions
IllegalStateExceptioninvalid status

Definition at line 756 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setBGMVolume ( int  volume) throws IllegalStateException, IllegalArgumentException

set BGM volume

Parameters
volumebgm volume, range:[0 ~ 100] default:50
Exceptions
IllegalStateExceptioninvalid state
IllegalArgumentExceptioninvalid argument

Definition at line 785 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setCaptureVolume ( int  volume) throws IllegalStateException, IllegalArgumentException

set capture volume

Parameters
volumecapture volume, range:[0 ~ 100] default:50
Exceptions
IllegalStateExceptioninvalid state
IllegalArgumentExceptioninvalid argument

Definition at line 800 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setCustomAudioFilter ( AlivcLivePushCustomAudioFilter  customAudioFilter)

Set user-defined audio processing callbacks

Parameters
customAudioFiltercustom audio filter

Definition at line 539 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setCustomDetect ( AlivcLivePushCustomDetect  customVideoDetect)

set user-defined custom video detect callback

Parameters
customVideoDetectcustom detect callback

Definition at line 513 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setCustomFilter ( AlivcLivePushCustomFilter  customVideoFilter)

set user-defined custom video filter callback

Parameters
customVideoFiltercustom video filter

Definition at line 526 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setExposure ( int  exposure)

Set camera exposure

Parameters
exposurecamera exposure

Definition at line 1166 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setFlash ( boolean  flash) throws IllegalStateException

set flash

Parameters
flashtrue:open flash false:close flash
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 390 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.setLiveMixTranscodingConfig ( AlivcLiveTranscodingConfig  config)

Set live mix transcoding config for cloud stream

Parameters
configlive mix transcoding config
Returns
0->success, not 0->failed
Note
The API is not supported in the basic mode currently, and calls have no effect.
There may be more than one anchor in a live broadcast room, and each anchor has its own stream. However, for CDN viewers, they only need a live stream along the way
Therefore, we need to mix multiple anchor streams into one standard live stream, which requires mixing and transcoding
In the connected microphone scenario, it is necessary to mix the each streams of the anchor and connected microphone viewers into a standard live stream for CDN viewers to watch
In the PK scenario, it is necessary to mix the audio and video streams of multiple anchors performing the PK into a standard live stream for CDN viewers to watch
If the host is still in the room but no longer requires mixing, please be sure to pass in null to cancel mixing, because when mixing is initiated, the cloud mixing module will start working. Failure to cancel mixing in a timely manner may cause unnecessary billing losses
See also
com.alivc.live.pusher.AlivcLiveTranscodingConfig
com.alivc.live.pusher.AlivcLivePushInfoListener::onSetLiveMixTranscodingConfig(com.alivc.live.pusher.AlivcLivePusher, boolean, String)

Definition at line 1243 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePushBGMListener ( AlivcLivePushBGMListener  pushBGMListener)

set push BGM listener

Parameters
pushBGMListenerpush BGM listener

Definition at line 604 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePusherReference ( AlivcLivePusher  livePusher)

set live pusher instance

Parameters
livePusherlive pusher instance

Definition at line 94 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePushErrorListener ( AlivcLivePushErrorListener  errorListener)

set push error listener

Parameters
errorListenerpush error listener

Definition at line 565 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePushInfoListener ( AlivcLivePushInfoListener  infoListener)

set push info listener

Parameters
infoListenerpush info listener

Definition at line 578 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePushNetworkListener ( AlivcLivePushNetworkListener  networkListener)

set push network listener

Parameters
networkListenerpush network listener

Definition at line 591 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setLivePushRenderContextListener ( AlivcLivePusherRenderContextListener  renderCtxListener)

set push render context listener

Parameters
renderCtxListenerpush render context listener

Definition at line 617 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setMinVideoBitrate ( int  minVideoBitrate) throws IllegalArgumentException, IllegalStateException

set min video bitrate(Kbps)

Parameters
minVideoBitratemin video bitrate
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush

Definition at line 446 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setMute ( boolean  mute) throws IllegalStateException

set mute

Parameters
mutetrue:mute local false:normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush

Definition at line 376 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setPreviewMirror ( boolean  mirror) throws IllegalStateException

set preview mirror

Parameters
mirrortrue:preview mirror false:normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 418 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setPreviewMode ( AlivcPreviewDisplayMode  mode) throws IllegalStateException

set preview mode

Parameters
modepreview mode
Exceptions
IllegalStateExceptioninvalid state

Definition at line 878 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setPreviewOrientation ( AlivcPreviewOrientationEnum  orientation)

set preview orientation

Parameters
orientationpreview orientation

Definition at line 657 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setPushMirror ( boolean  mirror) throws IllegalStateException

set push mirror

Parameters
mirrortrue:push mirror false:normal
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush

Definition at line 404 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setQualityMode ( AlivcQualityModeEnum  mode) throws IllegalStateException

set quality mode

Parameters
modequality mode
Exceptions
IllegalStateExceptioninvalid state

Definition at line 864 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setScreenOrientation ( int  orientation)

Set the induced screen rotation angle in screen recording mode

Parameters
orientationscreen orientation

Definition at line 999 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setTargetVideoBitrate ( int  targetVideoBitrate) throws IllegalArgumentException, IllegalStateException

Set target video bitrate(Kbps)

Parameters
targetVideoBitratetarget video bitrate
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush

Definition at line 432 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setWatermarkVisible ( boolean  visible)

set watermark visible

Parameters
visiblevisible

Definition at line 960 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.setZoom ( int  zoom) throws IllegalArgumentException, IllegalStateException

set zoom

Parameters
zoom0~getMaxZoom()
Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 334 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.snapshot ( int  count,
int  interval,
AlivcSnapshotListener  listener 
)

video stream snapshot

Parameters
count截取图片的个数,该参数仅在普通模式下生效
interval每张图片的间隔,该参数仅在普通模式下生效
listener截图回调

Definition at line 1042 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startBGMAsync ( String  path) throws IllegalStateException

start BGM async

Parameters
pathBGM path
Exceptions
IllegalStateExceptioninvalid status

Definition at line 703 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.startCamera ( SurfaceView  surfaceView) throws IllegalStateException

Enable camera preview in screen recording mode If preview is not required, fill in null for surfaceView

Parameters
surfaceViewsurfaceView
Returns
0->success, not 0->failed

Definition at line 975 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.startCameraMix ( float  x,
float  y,
float  w,
float  h 
)

Enable camera mixing in screen recording mode

Parameters
xMixed flow display x initial position (0~1.0f)
yMixed flow display y initial position (0~1.0f)
wMixed flow display width (0~1.0f)
hMixed flow display height (0~1.0f)
Returns
0->success, not 0->failed

Definition at line 1016 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.startIntelligentDenoise ( )

open intelligent denoise

Returns
0->success, not 0->failed
Note
1.To use intelligent denoise, please turn off normal denoise; Both functions are mutually exclusive
2.The intelligent denoise function is provided in the form of a plug-in. Before calling this interface, please ensure that libpluginAliDenoise.so has been integrated; Please refer to the official website documentation for plug-in acquisition methods;
3.This interface can control the intelligent denoise function during a call, and can support turning on and off intelligent denoise during a call
4.The default setting is off, which may lead to increased power consumption after being turned on. Intelligent denoise is suitable for scenarios dominated by voice communication such as conferences and education, but not for scenarios with background music
Attentions
Note
If there are lib.so conflicts related to libMNN.so, please check whether other video cloud products are used in the current project, such as the Beauty SDK/Animoji SDK
The Beauty SDK/Animoji SDK contains libMNN-related lib.so, so there is no need to import another copy externally, only libpluginAliDenoise.so is reserved,
Keep a unified copy of the global libMNN.so related database;
For details, please check the official website documentation or API documentation, or you can consult your technical classmates to help solve the problem;
See also
AliLive Push SDK Doc

Definition at line 836 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startPreview ( SurfaceView  surfaceView) throws IllegalArgumentException, IllegalStateException

start preview

Parameters
surfaceViewsurfaceView
Exceptions
IllegalArgumentExceptionIf the surfaceView is null, or the surface of the surfaceView has not been created/destroyed
IllegalStateExceptionIf the status is invalid, such as not initialized yet

Definition at line 109 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startPreview ( Context  context,
FrameLayout  frameLayout,
boolean  isAnchor 
) throws IllegalArgumentException, IllegalStateException

start preview

Parameters
contextandroid context
frameLayoutFrameLayout Container
isAnchoris anchor
Exceptions
IllegalArgumentExceptionerror argument
IllegalStateExceptionerror state
Note
Only used in the interactive mode

Definition at line 142 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startPreviewAsync ( SurfaceView  surfaceView) throws IllegalArgumentException, IllegalStateException

start Preview async

Parameters
surfaceViewsurfaceView
Exceptions
IllegalArgumentExceptionIf the surfaceView is null, or the surface of the surfaceView has not been created/destroyed
IllegalStateExceptionIf the status is invalid, such as not initialized yet

Definition at line 124 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startPush ( String  url) throws IllegalArgumentException, IllegalStateException

start push

Parameters
urlpush url
Exceptions
IllegalArgumentExceptionIf the url is empty or not in a valid url format
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview

Definition at line 170 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.startPushAsync ( String  url) throws IllegalArgumentException, IllegalStateException

start push async

Parameters
urlpush url
Exceptions
IllegalArgumentExceptionIf the url is empty or not in a valid url format
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview

Definition at line 185 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.stopBGMAsync ( ) throws IllegalStateException

stop BGM async

Exceptions
IllegalStateExceptioninvalid status

Definition at line 716 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.stopCamera ( )

Turn off camera preview in screen recording mode

Definition at line 986 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.stopCameraMix ( )

Stop camera mixing in screen recording mode

Definition at line 1027 of file AlivcLivePusher.java.

int com.alivc.live.pusher.AlivcLivePusher.stopIntelligentDenoise ( )

stop intelligent denoise

Returns
0->success, not 0->false
Note
This interface can control turning off the intelligent noise reduction function during a call

Definition at line 850 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.stopPreview ( ) throws IllegalStateException

stop preview

Exceptions
IllegalStateExceptionIf the status is invalid, such as not Initialized/not startPreview

Definition at line 155 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.stopPush ( ) throws IllegalStateException

stop push

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview/Not startPush/stopPush

Definition at line 238 of file AlivcLivePusher.java.

void com.alivc.live.pusher.AlivcLivePusher.switchCamera ( ) throws IllegalStateException

switch camera

Exceptions
IllegalStateExceptionIf the status is invalid, such as Not Initialized/Not startPreview

Definition at line 290 of file AlivcLivePusher.java.