LiteAVSDK
Tencent Cloud LVB SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
V2TXLivePusherObserver

Detailed Description

Live pusher callback notification.
Some V2TXLivePusher callback notifications can be received, including the pusher status, volume callback, statistics, warnings, and error messages.


Data Structure Documentation

◆ com::tencent::live2::V2TXLivePusherObserver

class com::tencent::live2::V2TXLivePusherObserver

Public Member Functions

void onError (int code, String msg, Bundle extraInfo)
 
void onWarning (int code, String msg, Bundle extraInfo)
 
void onCaptureFirstAudioFrame ()
 
void onCaptureFirstVideoFrame ()
 
void onMicrophoneVolumeUpdate (int volume)
 
void onPushStatusUpdate (V2TXLivePushStatus status, String msg, Bundle extraInfo)
 
void onStatisticsUpdate (V2TXLivePusherStatistics statistics)
 
void onSnapshotComplete (Bitmap image)
 
void onGLContextCreated ()
 
int onProcessVideoFrame (V2TXLiveVideoFrame srcFrame, V2TXLiveVideoFrame dstFrame)
 
void onGLContextDestroyed ()
 
void onSetMixTranscodingConfig (int code, String msg)
 

Member Function Documentation

◆ onError()

void onError ( int  code,
String  msg,
Bundle  extraInfo 
)
inline

Live pusher error notification, which is called back when the pusher encounters an error.

Parameters
codeError code V2TXLiveCode.
msgError message.
extraInfoExtended information.

◆ onWarning()

void onWarning ( int  code,
String  msg,
Bundle  extraInfo 
)
inline

Live pusher warning notification.

Parameters
codeWarning code V2TXLiveCode.
msgWarning message.
extraInfoExtended information.

◆ onCaptureFirstAudioFrame()

void onCaptureFirstAudioFrame ( )
inline

Callback notification indicating that collection of the first audio frame is complete.

◆ onCaptureFirstVideoFrame()

void onCaptureFirstVideoFrame ( )
inline

Callback notification indicating that collection of the first video frame is complete.

◆ onMicrophoneVolumeUpdate()

void onMicrophoneVolumeUpdate ( int  volume)
inline

Microphone-collected volume callback.

Attention
This callback notification is received after enableVolumeEvaluation is called.
Parameters
volumeCurrent volume value for collection.

◆ onPushStatusUpdate()

void onPushStatusUpdate ( V2TXLivePushStatus  status,
String  msg,
Bundle  extraInfo 
)
inline

Callback notification of the pusher connection status.

Parameters
statusPusher connection status V2TXLivePushStatus .
msgConnection status message.
extraInfoExtended information.

◆ onStatisticsUpdate()

void onStatisticsUpdate ( V2TXLivePusherStatistics  statistics)
inline

Live pusher statistics callback.

Parameters
statisticsPusher statistics V2TXLivePusherStatistics .

◆ onSnapshotComplete()

void onSnapshotComplete ( Bitmap  image)
inline

Screenshot callback

Attention
This callback notification will be received after calling snapshot() .
Parameters
imageCaptured video image

◆ onGLContextCreated()

void onGLContextCreated ( )
inline

Callback of created the OpenGL context in the SDK

◆ onProcessVideoFrame()

int onProcessVideoFrame ( V2TXLiveVideoFrame  srcFrame,
V2TXLiveVideoFrame  dstFrame 
)
inline

Custom video processing callback

Attention
You will receive this callback only after you call V2TXLivePusher#enableCustomVideoProcess(boolean, V2TXLiveDef.V2TXLivePixelFormat, V2TXLiveDef.V2TXLiveBufferType) to enable custom video processing.

Case 1: The beauty filter component generates new textures. If the beauty filter component you use generates a new texture frame (for the processed image) during image processing, please set dstFrame.textureId to a new texture ID in the callback API.

    @Override
    public void onGLContextCreated() {
        mFURenderer.onSurfaceCreated();
        mFURenderer.setUseTexAsync(true);
    }
    @Override
    public int onProcessVideoFrame(V2TXLiveVideoFrame srcFrame, V2TXLiveVideoFrame dstFrame) {
        dstFrame.texture.textureId = mFURenderer.onDrawFrameSingleInput(
                            srcFrame.texture.textureId, srcFrame.width, srcFrame.height);
        return 0;
    }
    @Override
    public void onGLContextDestroyed() {
        mFURenderer.onSurfaceDestroyed();
    }

Case 2: The third-party beauty filter component doesn’t generate new textures. If the third-party beauty filter component you use does not generate new textures and you need to manually set an input texture and an output texture for the component, please consider the following scheme:

int onProcessVideoFrame(V2TXLiveVideoFrame srcFrame, V2TXLiveVideoFrame dstFrame) {
    thirdparty_process(srcFrame.texture.textureId, srcFrame.width, srcFrame.height, dstFrame.texture.textureId);
    return 0;
}
Parameters
srcFrameFor images before processing
dstFrameFor images after processing

◆ onGLContextDestroyed()

void onGLContextDestroyed ( )
inline

Callback of destroying the OpenGL context in the SDK

◆ onSetMixTranscodingConfig()

void onSetMixTranscodingConfig ( int  code,
String  msg 
)
inline

Callback of setting On-Cloud MixTranscoding parameters, which corresponds to the setMixTranscodingConfig API.

Parameters
code0: successful; other values: failed
msgError message