public interface ILivePusher
Modifier and Type | Method and Description |
---|---|
int |
addDynamicsAddons(java.lang.String path,
float x,
float y,
float w,
float h)
Add an animated sticker.
|
void |
changeResolution(AlivcResolutionEnum resolutionEnum)
change resolution dynamically
|
void |
destroy()
Stop the stream ingest.
|
void |
focusCameraAtAdjustedPoint(float x,
float y,
boolean autoFocus)
The coordinates of the focus point is ([0,Screen width],[0,Screen width]).
|
int |
getCurrentExposure()
Query the exposure value of the camera.
|
AlivcLivePushStats |
getCurrentStatus()
Query the current status.
|
int |
getCurrentZoom()
Query the current zoom factor.
|
AlivcLivePushError |
getLastError()
Query the recently returned error codes.
|
AlivcLivePushStatsInfo |
getLivePushStatsInfo()
Query the statistics on stream ingest.
|
int |
getMaxZoom()
Query the maximum zoom factor supported by the camera.
|
java.lang.String |
getPushUrl()
Query the ingest URL.
|
int |
getSupportedMaxExposure()
Query the maximum exposure value supported by the camera.
|
int |
getSupportedMinExposure()
Query the minimum exposure value supported by the camera.
|
void |
init(android.content.Context context,
AlivcLivePushConfig config)
Initialize the stream ingest parameters.
|
void |
inputStreamAudioData(byte[] data,
int size,
int sampleRate,
int channels,
long pts)
Customize audio data.
|
void |
inputStreamAudioPtr(long dataPtr,
int size,
int sampleRate,
int channels,
long pts)
Customize audio data.
|
void |
inputStreamVideoData(byte[] data,
int width,
int height,
int stride,
int size,
long pts,
int rotation)
Customize video data.
|
void |
inputStreamVideoPtr(long dataptr,
int width,
int height,
int stride,
int size,
long pts,
int rotation)
Customize video data.
|
boolean |
isCameraSupportAutoFocus()
Query whether autofocus is supported.
|
boolean |
isCameraSupportFlash()
Query whether the flash is supported.
|
boolean |
isNetworkPushing()
Query the current network status of stream ingest.
|
boolean |
isPushing()
Query whether a stream is being ingested.
|
void |
pause()
Pause the stream ingest.
|
void |
pauseBGM()
Pause the playback of background music.
|
void |
pauseScreenCapture()
Pause recording during stream ingest.
|
void |
reconnectPushAsync(java.lang.String url)
Reconnect and start the stream ingest.
|
void |
removeDynamicsAddons(int id)
Remove an animated sticker.
|
void |
restartPush()
Restart the stream ingest.
|
void |
restartPushAync()
Restart the stream ingest.
|
void |
resume()
Resume the stream ingest.
|
void |
resumeAsync()
Asynchronously resume the stream ingest.
|
void |
resumeBGM()
Resume the playback of background music.
|
void |
resumeScreenCapture()
Resume recording during stream ingest.
|
void |
setAudioDenoise(boolean on)
Specify whether to enable noise reduction for audio.
|
void |
setAutoFocus(boolean autoFocus)
Configure the autofocus feature.
|
void |
setBGMEarsBack(boolean isOpen)
Specify whether to enable in-ear monitoring.
|
void |
setBGMLoop(boolean isLoop)
Specify whether to enable loop playback for background music.
|
void |
setBGMVolume(int volume)
Set the volume of vocals in the mixed background music.
|
void |
setCaptureVolume(int volume)
Set the volume of music in the mixed background music.
|
void |
setExposure(int exposure)
Set the exposure value for the camera.
|
void |
setFlash(boolean flash)
Specify whether to enable the flash.
|
void |
setLivePushBGMListener(AlivcLivePushBGMListener pushBGMListener)
Set the listener for notifications about the playback of background music.
|
void |
setLivePushErrorListener(AlivcLivePushErrorListener errorListener)
Set the listener for errors related to stream ingest.
|
void |
setLivePushInfoListener(AlivcLivePushInfoListener infoListener)
Set the listener for notifications about stream ingest.
|
void |
setLivePushNetworkListener(AlivcLivePushNetworkListener networkListner)
Set the listener for notifications about the network.
|
void |
setLivePushRenderContextListener(AlivcLivePusherRenderContextListener renderCtxListener)
Set the listener for the rendering context.
|
void |
setLogDirPath(java.lang.String logDirPath)
Set the path for storing log files.
|
void |
setLogLevel(AlivcLivePushLogLevel level)
Set the log level.
|
void |
setMinVideoBitrate(int minVideoBitrate)
Set the minimum bitrate of the video after encoding in the range from 100 to 5000.
|
void |
setMute(boolean mute)
Specify whether to mute the audio during stream ingest.
|
void |
setPreviewMirror(boolean mirror)
Specify whether to enable preview mirroring.
|
void |
setPreviewMode(AlivcPreviewDisplayMode mode)
Set the preview mode.
|
void |
setPreviewOrientation(AlivcPreviewOrientationEnum orientation)
Set the stream ingest mode.
|
void |
setPushMirror(boolean mirror)
Specify whether to enable horizontal mirroring on the stream ingest client.
|
void |
setQualityMode(AlivcQualityModeEnum mode)
Set the video resolution.
|
void |
setScreenOrientation(int orientation)
Set the rotation angle for the screen during recording.
|
void |
setTargetVideoBitrate(int targetVideoBitrate)
Set the bitrate to be used after video encoding in the range from 100 to 5000.
|
void |
setWaterMarkVisible(boolean visible)
Specify whether to make watermarks visible.
|
void |
setZoom(int zoom)
Set the zoom factor.
|
void |
snapshot(int count,
int interval,
AlivcSnapshotListener listener)
The snapshot.
|
void |
startBGMAsync(java.lang.String path)
Play background music.
|
int |
startCamera(android.view.SurfaceView surfaceView)
Enable the camera preview during recording.
|
int |
startCameraMix(float x,
float y,
float w,
float h)
Enable the camera mixing during recording.
|
void |
startPreview(android.view.SurfaceView surfaceView)
Start the preview.
|
void |
startPreviewAysnc(android.view.SurfaceView surfaceView)
Asynchronously start the preview.
|
void |
startPush(java.lang.String url)
Start the stream ingest.
|
void |
startPushAysnc(java.lang.String url)
Start the stream ingest.
|
void |
stopBGMAsync()
Stop the playback of background music.
|
void |
stopCamera()
Disable the camera preview during recording.
|
void |
stopCameraMix()
Disable the camera mixing during recording.
|
void |
stopPreview()
Stop the preview.
|
void |
stopPush()
Stop the stream ingest.
|
void |
switchCamera()
Switch between the front and rear cameras.
|
void init(android.content.Context context, AlivcLivePushConfig config) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
context
- The context.config
- The configurations.java.lang.IllegalArgumentException
- The exception is thrown if the config class is unspecified or invalid. For example, the bitrate exceeds the upper limit.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is initialized but not destroyed.void destroy() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized.void startPreview(android.view.SurfaceView surfaceView) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
surfaceView
- surfaceviewjava.lang.IllegalArgumentException
- The exception is thrown if the surfaceView parameter is unspecified, or the surface is destroyed or is not created.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized.void startPreviewAysnc(android.view.SurfaceView surfaceView) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
surfaceView
- surfaceviewjava.lang.IllegalArgumentException
- The exception is thrown if the surfaceView parameter is unspecified, or the surface is destroyed or is not created.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized.void stopPreview() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void startPush(java.lang.String url) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
url
- The ingest URL.java.lang.IllegalArgumentException
- The exception is thrown if no stream ingest URL is specified or the format of the ingest URL is invalid.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void startPushAysnc(java.lang.String url) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
url
- The ingest URL.java.lang.IllegalArgumentException
- The exception is thrown if no stream ingest URL is specified or the format of the ingest URL is invalid.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void restartPush() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is stopped.void restartPushAync() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is stopped.void reconnectPushAsync(java.lang.String url) throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is stopped.void stopPush() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is stopped.void pause() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is paused.void resume() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, the stream ingest is not paused, or the stream ingest is resumed.void resumeAsync() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, the stream ingest is not paused, or the stream ingest is resumed.void switchCamera() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void setAutoFocus(boolean autoFocus) throws java.lang.IllegalStateException
autoFocus
- The autofocus feature.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void focusCameraAtAdjustedPoint(float x, float y, boolean autoFocus) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
x
- The x-coordinate of the focus point.y
- The y-coordinate of the focus point.autoFocus
- Specify whether to enable autofocus.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.java.lang.IllegalArgumentException
void setZoom(int zoom) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
zoom
- 0~getMaxZoom()java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.java.lang.IllegalArgumentException
int getMaxZoom() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.int getCurrentZoom() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void setMute(boolean mute) throws java.lang.IllegalStateException
mute
- true: muted stream ingest. false: normal stream ingest.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, or the stream ingest is not started.void setFlash(boolean flash) throws java.lang.IllegalStateException
flash
- true: enables the flash. false: disables the flash.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void setPushMirror(boolean mirror) throws java.lang.IllegalStateException
mirror
- true: enables horizontal mirroring. false: disables horizontal mirroring.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.startPushvoid setPreviewMirror(boolean mirror) throws java.lang.IllegalStateException
mirror
- true: enables preview mirroring. false: disables preview mirroring.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized or the preview is not started.void setTargetVideoBitrate(int targetVideoBitrate) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
targetVideoBitrate
- The bitrate to be used after video encoding.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, or the stream ingest is not started.java.lang.IllegalArgumentException
void setMinVideoBitrate(int minVideoBitrate) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
minVideoBitrate
- The minimum bitrate of the video after encoding.java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, or the stream ingest is not started.java.lang.IllegalArgumentException
boolean isCameraSupportAutoFocus()
boolean isCameraSupportFlash()
boolean isPushing() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, or the stream ingest is not started.boolean isNetworkPushing() throws java.lang.IllegalStateException
java.lang.IllegalStateException
AlivcLivePushStats getCurrentStatus()
void setLivePushErrorListener(AlivcLivePushErrorListener errorListener)
errorListener
- The listener for errors.void setLivePushInfoListener(AlivcLivePushInfoListener infoListener)
infoListener
- The listener for notifications.void setLivePushNetworkListener(AlivcLivePushNetworkListener networkListner)
networkListner
- The listener for notifications.void setLivePushBGMListener(AlivcLivePushBGMListener pushBGMListener)
pushBGMListener
- The listener for notifications.void setLivePushRenderContextListener(AlivcLivePusherRenderContextListener renderCtxListener)
renderCtxListener
- The listener for the rendering context.AlivcLivePushStatsInfo getLivePushStatsInfo() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized.java.lang.String getPushUrl() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, or the stream ingest is not started.void setPreviewOrientation(AlivcPreviewOrientationEnum orientation)
orientation
- The stream ingest mode.void setLogLevel(AlivcLivePushLogLevel level)
level
- java.lang.IllegalStateException
void setLogDirPath(java.lang.String logDirPath)
logDirPath
- java.lang.IllegalStateException
void startBGMAsync(java.lang.String path) throws java.lang.IllegalStateException
path
- The path for storing background music.java.lang.IllegalStateException
void stopBGMAsync() throws java.lang.IllegalStateException
java.lang.IllegalStateException
void pauseBGM() throws java.lang.IllegalStateException
java.lang.IllegalStateException
void resumeBGM() throws java.lang.IllegalStateException
java.lang.IllegalStateException
void setBGMLoop(boolean isLoop) throws java.lang.IllegalStateException
isLoop
- true: enables loop playback. false: disables loop playback.java.lang.IllegalStateException
void setBGMEarsBack(boolean isOpen) throws java.lang.IllegalStateException
isOpen
- true: enables in-ear monitoring. false: disables in-ear monitoring.java.lang.IllegalStateException
void setBGMVolume(int volume) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
volume
- The volume of vocals. Valid values: [0,100]. Default value: 50.IllegalStateException,IllegalArgumentException
java.lang.IllegalStateException
java.lang.IllegalArgumentException
void setCaptureVolume(int volume) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
volume
- The volume of music. Valid values: [0,100]. Default value: 50.IllegalStateException,IllegalArgumentException
java.lang.IllegalStateException
java.lang.IllegalArgumentException
void setAudioDenoise(boolean on) throws java.lang.IllegalStateException
on
- true: enables noise reduction. false: disables noise reduction.java.lang.IllegalStateException
void setQualityMode(AlivcQualityModeEnum mode) throws java.lang.IllegalStateException
mode
- java.lang.IllegalStateException
void setPreviewMode(AlivcPreviewDisplayMode mode) throws java.lang.IllegalStateException
mode
- java.lang.IllegalStateException
void pauseScreenCapture() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, or the stream ingest is paused.void resumeScreenCapture() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The exception is thrown if the ILivePusher object is in an invalid state. For example, the ILivePusher object is not initialized, the preview is not started, the stream ingest is not started, the stream ingest is not paused, or the stream ingest is resumed.AlivcLivePushError getLastError()
void changeResolution(AlivcResolutionEnum resolutionEnum)
void setWaterMarkVisible(boolean visible)
visible
- Specify whether to make watermarks visible.int startCamera(android.view.SurfaceView surfaceView) throws java.lang.IllegalStateException
surfaceView
- java.lang.IllegalStateException
void stopCamera()
void setScreenOrientation(int orientation)
orientation
- int startCameraMix(float x, float y, float w, float h)
x
- The initial position of the mixed stream on the x-axis. The parameter value is a floating-point number between 0 and 1.y
- The initial position of the mixed stream on the y-axis. The parameter value is a floating-point number between 0 and 1.w
- The screen width of the mixed stream. The parameter value is a floating-point number between 0 and 1.h
- The screen height of the mixed stream. The parameter value is a floating-point number between 0 and 1.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)
dataptr
- The pointer of the native memory for video images.width
- The width of video images.height
- The height of video images.size
- The size of video images.pts
- The PTS of video images. Unit: microseconds.rotation
- The rotation angle of video images.void inputStreamVideoData(byte[] data, int width, int height, int stride, int size, long pts, int rotation)
data
- The byte array of video images.width
- The width of video images.height
- The height of video images.size
- The size of video images.pts
- The PTS of video images. Unit: microseconds.rotation
- The rotation angle of video images.void inputStreamAudioPtr(long dataPtr, int size, int sampleRate, int channels, long pts)
dataPtr
- The pointer of the native memory for audio.size
- pts
- The PTS of audio. Unit: microseconds.void inputStreamAudioData(byte[] data, int size, int sampleRate, int channels, long pts)
data
- The byte array of audio.size
- pts
- The PTS of audio. Unit: microseconds.int addDynamicsAddons(java.lang.String path, float x, float y, float w, float h)
path
- The path of the animated sticker. The config.json file must be stored in the path.x
- The initial position of the animated sticker on the x-axis. The parameter value is a floating-point number between 0 and 1.y
- The initial position of the animated sticker on the y-axis. The parameter value is a floating-point number between 0 and 1.w
- The screen width of the animated sticker. The parameter value is a floating-point number between 0 and 1.h
- The screen height of the animated sticker. The parameter value is a floating-point number between 0 and 1.void removeDynamicsAddons(int id)
id
- The ID of the animated sticker.void setExposure(int exposure)
int getCurrentExposure()
int getSupportedMinExposure()
int getSupportedMaxExposure()