Overview of SDK Callbacks
Cloud Phone Callback (SessionObserver)
| Interface name | Interface description |
|---|---|
| [onConnected] (#connection-successful-callback) | Network connection successful |
| [onDisconnected] (#connection-disconnect-and-callback) | The network is disconnected |
| [onClose] (#connection-closes-the-callback) | The network remote is shut down |
| [onScreenChange] (#resolution-change-callback) | Receives callbacks to cloud phone width, height, and angle changes |
| [onClipboardMessage] (#shear-board-pullback) | Clipboard data callbacks returned by the cloud phone real column |
| [onFirstVideoFrame] (#the-first-frame-of-the-video-is-called-back) | Launch the cloud phone real stream and subscribe to the video stream to pullback the first frame of the video |
| [onLocalScreenshot] (#local-screenshot-pullback) | Callback of video frames after calling screenshot(true). |
| [onNetworkQuality] (#network-status-pullback) | Current network status pullback |
| [onIdeTimeout] (#idle-time-outtime-tunes) | Currently, there is no operation timeout callback in the cloud phone real list |
| [onError] (#error-callback) | Currently, the cloud phone has an error callback |
| [onCameraChanged] (#camera-status-pullback) | Currently, the cloud phone camera status has reverted |
Video Frame Callback (VideoRenderSink)
| Interface name | Interface description |
|---|---|
| [onFrame] (#video-frame-callback) | Video frame callback |
Batch Pull Flow Callback (BatchControlObserver)
| Interface name | Interface description |
|---|---|
| [onBatchPodStartResult] (#batch-pull-results-are-pullback) | Batch pull results are pullback |
| [onError] (#batch-pulling-error-callback) | Batch pulling error callback |
Video Frame
| Interface name | Interface description |
|---|---|
| [width] (#video-frame-width) | Video frame width, unit: PX |
| [height] (#video-frame-height) | Video frame height, unit: px |
| [rotation] (#video-frame-rotation-angle) | Video frame rotation angles (0°, 90°, 180°, 270°) |
| [buffer] (#video-frame-data) | Video frame data |
| [size] (#video-frame-size) | Video frame size |
Detailed explanation of SDK callbacks
Connection successful, callback
Description: Network connection successful Syntax:
void onConnected()
Disconnect and pullback back
Description: Network disconnected Syntax:
void onDisconnected()
Connection Closes Callback
Description: Network remote shutdown end Syntax:
void onClose()
Resolution change callback
Description: Received cloud device width and height Syntax:
void onScreenChange(int width, int height, int rotation)
| Parameters | Description |
|---|---|
| width | Cloud machine width |
| height | Cloud machine height |
| rotation | Cloud machine rotation angle |
Shear board pullback
Description: Clipboard data callback received from a cloud phone real column Syntax:
void onClipboardMessage(const std::string& text)
| Parameters | Description |
|---|---|
| text | Cloud phone clipboard text, UTF-8 encoded |
First frame recall of video
Description: Launch the cloud phone real-frame account and call back the first frame of the video after subscribing to the video stream Syntax:
void onFirstVideoFrame()
Local screenshot pullback
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 pullback
Description: Current network status callback Syntax:
void onNetworkQuality(int rtt)
| Parameters | Description |
|---|---|
| rtt | Network latency |
Idle timeout pullback
Description: Currently, there is no operation timeout callback in the cloud phone real column Syntax:
void onIdeTimeout()
Cloud Phone Error Callback
Description: Currently, there is no operation timeout callback in the cloud phone real column Syntax:
void onError(int error, const std::string& msg)
| Parameters | Description |
|---|---|
| error | Error code |
| msg | Misdescription |
Camera Status Callback
Description: Currently, there is no operation timeout callback in the cloud phone real column Syntax:
void onCameraChanged(bool isFront, bool isOpen)
| Parameters | Description |
|---|---|
| isFront | Is it the front camera? |
| isOpen | Whether to open it |
Video Frame Callback
Description: Video frame callback Syntax:
void onFrame(std::shared_ptr<VideoFrame>& frame)
| Parameters | Description |
|---|---|
| frame | Refer to VideoFrame |
Batch Pullback Results
Description: Batch pull result callback Syntax:
void onBatchPodStartResult(int error, const std::string& msg, const std::vector<std::string>& podList)
| Parameters | Description |
|---|---|
| error | Batch load pulling results |
| msg | Bulk pulling error messages |
| podList | List of cloud phones for batch pulling |
Batch Pulling Error Callback
Description: Batch pulling stream error callback Syntax:
void onError(int error, const std::string& msg)
| Parameters | Description |
|---|---|
| error | Batch load pulling results |
| msg | Bulk pulling error messages |
Video frame width
Description: Video frame width, unit: PX Syntax:
uint32_t width()
Video frame height
Description: Video frame height, unit: px Syntax:
uint32_t height()
Video Frame Rotation Angle
Description: Video frame rotation angles (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()