SDK Callback Overview
Cloud Machine Callback (SessionObserver)
| Interface Name | Description |
|---|---|
| onConnected | Network connection successful |
| onDisconnected | Network disconnected |
| onClose | Remote network closed |
| onScreenChange | Callback for receiving cloud machine width, height, and rotation changes |
| onClipboardMessage | Callback for receiving clipboard data from the cloud machine instance |
| onFirstVideoFrame | Callback for the first video frame after subscribing to the video stream upon cloud machine startup |
| onLocalScreenshot | Video frame callback after calling screenshot(true) |
| onNetworkQuality | Callback for current network status |
| onIdeTimeout | Callback for cloud machine instance idle timeout |
| onError | Callback for cloud machine errors |
| onCameraChanged | Callback for cloud machine camera status |
Video Frame Callback (VideoRenderSink)
| Interface Name | Description |
|---|---|
| onFrame | Video frame callback |
Batch Stream Pulling Callback (BatchControlObserver)
| Interface Name | Description |
|---|---|
| onBatchPodStartResult | Batch stream pull result callback |
| onError | Batch stream pull error callback |
Video Frame (VideoFrame)
| Interface Name | Description |
|---|---|
| width | Video frame width in pixels |
| height | Video frame height in pixels |
| rotation | Video frame rotation angle (0°, 90°, 180°, 270°) |
| buffer | Video frame data |
| size | Video frame size |
SDK Callback Detailed Description
Connection Success Callback
Description: Network connection successful Syntax:
void onConnected()
Disconnection Callback
Description: Network disconnected Syntax:
void onDisconnected()
Connection Closed Callback
Description: Remote network closed Syntax:
void onClose()
Resolution Change Callback
Description: Receives cloud machine width and height changes Syntax:
void onScreenChange(int width, int height, int rotation)
| Parameter | Description |
|---|---|
| width | Cloud machine width |
| height | Cloud machine height |
| rotation | Cloud machine rotation angle |
Clipboard Callback
Description: Callback for receiving clipboard data from the cloud machine instance Syntax:
void onClipboardMessage(const std::string& text)
| Parameter | Description |
|---|---|
| text | Cloud machine clipboard text, UTF-8 encoded |
First Video Frame Callback
Description: Callback for the first video frame after subscribing to the video stream upon cloud machine startup Syntax:
void onFirstVideoFrame()
Local Screenshot Callback
Description: Video frame callback after calling screenshot(true) Syntax:
void onLocalScreenshot(std::shared_ptr<VideoFrame>& frame)
| Interface | Description |
|---|---|
| frame | Video frame callback, refer to VideoFrame |
Network Status Callback
Description: Callback for current network status Syntax:
void onNetworkQuality(int rtt)
| Parameter | Description |
|---|---|
| rtt | Network latency |
Idle Timeout Callback
Description: Callback for cloud machine instance idle timeout Syntax:
void onIdeTimeout()
Cloud Machine Error Callback
Description: Callback for cloud machine errors Syntax:
void onError(int error, const std::string& msg)
| Parameter | Description |
|---|---|
| error | Error code |
| msg | Error description |
Camera Status Callback
Description: Callback for cloud machine camera status Syntax:
void onCameraChanged(bool isFront, bool isOpen)
| Parameter | Description |
|---|---|
| isFront | Whether it is the front camera |
| isOpen | Whether the camera is open |
Video Frame Callback
Description: Video frame callback Syntax:
void onFrame(std::shared_ptr<VideoFrame>& frame)
| Parameter | Description |
|---|---|
| frame | Refer to VideoFrame |
Batch Stream Pull Result Callback
Description: Batch stream pull result callback Syntax:
void onBatchPodStartResult(int error, const std::string& msg, const std::vector<std::string>& podList)
| Parameter | Description |
|---|---|
| error | Batch stream pull result |
| msg | Batch stream pull error message |
| podList | List of cloud machines in batch stream pull |
Batch Stream Pull Error Callback
Description: Batch stream pull error callback Syntax:
void onError(int error, const std::string& msg)
| Parameter | Description |
|---|---|
| error | Batch stream pull result |
| msg | Batch stream pull error message |
Video Frame Width
Description: Video frame width in pixels Syntax:
uint32_t width()
Video Frame Height
Description: Video frame height in pixels Syntax:
uint32_t height()
Video Frame Rotation Angle
Description: Video frame rotation angle (0°, 90°, 180°, 270°) Syntax:
uint32_t rotation()
Video Frame Data
Description: Video frame data Syntax:
uint8_t* buffer()
Video Frame Size
Description: Video frame size Syntax:
uint32_t size()