Live pusher callback notification.
Some V2TXLivePusher callback notifications can be received, including the pusher status, volume callback, statistics, warnings, and error messages.
◆ liteav::V2TXLivePusherObserver
class liteav::V2TXLivePusherObserver |
Public Member Functions |
virtual | ~V2TXLivePusherObserver () |
|
virtual void | onError (int32_t code, const char *msg, void *extraInfo) |
|
virtual void | onWarning (int32_t code, const char *msg, void *extraInfo) |
|
virtual void | onCaptureFirstAudioFrame () |
|
virtual void | onCaptureFirstVideoFrame () |
|
virtual void | onMicrophoneVolumeUpdate (int32_t volume) |
|
virtual void | onPushStatusUpdate (V2TXLivePushStatus state, const char *msg, void *extraInfo) |
|
virtual void | onStatisticsUpdate (V2TXLivePusherStatistics statistics) |
|
virtual void | onSnapshotComplete (const char *image, int length, int width, int height, V2TXLivePixelFormat format) |
|
virtual void | onRenderVideoFrame (const V2TXLiveVideoFrame *videoFrame) |
|
virtual int | onProcessVideoFrame (V2TXLiveVideoFrame *srcFrame, V2TXLiveVideoFrame *dstFrame) |
|
virtual void | onScreenCaptureStarted () |
|
virtual void | onScreenCaptureStoped (int reason) |
|
◆ ~V2TXLivePusherObserver()
◆ onCaptureFirstAudioFrame()
virtual void onCaptureFirstAudioFrame |
( |
| ) |
|
|
inlinevirtual |
Callback notification indicating that collection of the first audio frame is complete.
◆ onCaptureFirstVideoFrame()
virtual void onCaptureFirstVideoFrame |
( |
| ) |
|
|
inlinevirtual |
Callback notification indicating that collection of the first video frame is complete.
◆ onError()
virtual void onError |
( |
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Live pusher error notification, which is called back when the pusher encounters an error.
- Parameters
-
code | Error code V2TXLiveCode. |
msg | Error message. |
extraInfo | Extended information. |
◆ onMicrophoneVolumeUpdate()
virtual void onMicrophoneVolumeUpdate |
( |
int32_t |
volume | ) |
|
|
inlinevirtual |
Microphone-collected volume callback.
- Attention
- This callback notification is received after enableVolumeEvaluation is called.
- Parameters
-
volume | Current volume value for collection. |
◆ onProcessVideoFrame()
Callback of video data for custom pre-processing
- Attention
- You can call V2TXLivePusher#enableCustomVideoProcess to enable/disable custom video pre-processing. Only the YUV420 format is supported on Windows currently.
- Parameters
-
srcFrame | Used to carry images captured by SDK via the camera |
dstFrame | Used to receive video images processed by third-party beauty filters |
◆ onPushStatusUpdate()
virtual void onPushStatusUpdate |
( |
V2TXLivePushStatus |
state, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Callback notification of the pusher connection status.
- Parameters
-
status | Pusher connection status V2TXLivePushStatus . |
msg | Connection status message. |
extraInfo | Extended information. |
◆ onRenderVideoFrame()
Custom video rendering callback
- Attention
- You will receive this callback after calling enableCustomVideoRender to enable local custom video rendering.
- Parameters
-
◆ onScreenCaptureStarted()
virtual void onScreenCaptureStarted |
( |
| ) |
|
|
inlinevirtual |
The SDK returns this callback when you call startScreenCapture and other APIs to start screen sharing.
◆ onScreenCaptureStoped()
virtual void onScreenCaptureStoped |
( |
int |
reason | ) |
|
|
inlinevirtual |
The SDK returns this callback when you call stopScreenCapture to stop screen sharing.
- Parameters
-
reason | Reason. 0 : the user stopped screen sharing; 1 : screen sharing stopped because the shared window was closed. |
◆ onSnapshotComplete()
virtual void onSnapshotComplete |
( |
const char * |
image, |
|
|
int |
length, |
|
|
int |
width, |
|
|
int |
height, |
|
|
V2TXLivePixelFormat |
format |
|
) |
| |
|
inlinevirtual |
Screenshot callback
- Attention
- This callback notification will be received after calling V2TXLivePusher#snapshot() .
- Parameters
-
image | Screenshot data. If it is nullptr , it indicates that the SDK failed to take the screenshot. |
length | Screenshot data length. In BGRA32 format, length = width * height * 4. |
width | Screenshot width |
height | Screenshot height |
format | Screenshot data format. Only TRTCVideoPixelFormat_BGRA32 is supported now. |
◆ onStatisticsUpdate()
Live pusher statistics callback.
- Parameters
-
◆ onWarning()
virtual void onWarning |
( |
int32_t |
code, |
|
|
const char * |
msg, |
|
|
void * |
extraInfo |
|
) |
| |
|
inlinevirtual |
Live pusher warning notification.
- Parameters
-
code | Warning code V2TXLiveCode. |
msg | Warning message. |
extraInfo | Extended information. |