VSPhone API
  • 简体中文
  • English
  • 简体中文
  • English
  • Product Introduction
  • Product Type
  • Product Billing
  • OpenAPI
    • User Guide
    • API Documentation
    • Error Code
    • Instance Property List
    • Android device modification attribute list
    • Callback Task Business Type Codes
    • Changelog
  • Android SDK
    • Example Construction
    • API Documentation
    • Callback Functions
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Build
    • API Documentation
    • H5 SDK Callback Functions
    • Error Code
    • Change log
  • Windows PC SDK
    • Example Setup
    • API Documentation
    • Callback Functions
    • Changelog
  • Edge-Cloud Communication Development
    • AIDL Integration Method
    • System Service API (AIDL)
  • Similar to XP, LSP Hook framework
    • Xposed-like / LSPosed Framework
    • Sensor Data Dynamic Simulation
  • Related agreements

SDK Callback Overview

Cloud Phone Callbacks (SessionObserver)

Interface NameDescription
onConnectedNetwork connection successful
onDisconnectedNetwork disconnected
onCloseRemote end closed connection
onScreenChangeReceived cloud phone width, height, rotation change
onClipboardMessageReceived clipboard data from cloud phone instance
onFirstVideoFrameFirst video frame after subscribing to stream
onLocalScreenshotVideo frame callback after screenshot(true)
onNetworkQualityCurrent network quality callback
onIdeTimeoutIdle timeout for current cloud phone instance
onErrorCloud phone error callback
onCameraChangedCloud phone camera state change callback

Video Frame Callbacks (VideoRenderSink)

Interface NameDescription
onFrameVideo frame callback

Batch Streaming Callbacks (BatchControlObserver)

Interface NameDescription
onBatchPodStartResultBatch streaming result callback
onErrorBatch streaming error callback

Video Frame (VideoFrame)

Interface NameDescription
widthVideo frame width in pixels
heightVideo frame height in pixels
rotationVideo frame rotation (0°, 90°, 180°, 270°)
bufferVideo frame raw data pointer
sizeVideo frame data size in bytes

Cloud Phone Callbacks (SessionObserver)

Interface NameDescription
onConnectedNetwork connection successful
onDisconnectedNetwork disconnected
onCloseRemote end closed connection
onScreenChangeReceived cloud phone width, height, rotation change
onClipboardMessageReceived clipboard data from cloud phone instance
onFirstVideoFrameFirst video frame after subscribing to stream
onLocalScreenshotVideo frame callback after screenshot(true)
onNetworkQualityCurrent network quality callback
onIdeTimeoutIdle timeout for current cloud phone instance
onErrorCloud phone error callback
onCameraChangedCloud phone camera state change callback

Video Frame Callbacks (VideoRenderSink)

Interface NameDescription
onFrameVideo frame callback

Batch Streaming Callbacks (BatchControlObserver)

Interface NameDescription
onBatchPodStartResultBatch streaming result callback
onErrorBatch streaming error callback

Video Frame (VideoFrame)

Interface NameDescription
widthVideo frame width in pixels
heightVideo frame height in pixels
rotationVideo frame rotation (0°, 90°, 180°, 270°)
bufferVideo frame raw data pointer
sizeVideo frame data size in bytes

SDK Callback Details

Connection Success Callback

Description: Network connection successful

Signature:

void onConnected();

Disconnection Callback

Description: Network disconnected

Signature:

void onDisconnected();

Connection Close Callback

Description: Remote end closed connection

Signature:

void onClose();

Resolution Change Callback

Description: Received cloud phone width/height change

Signature:

void onScreenChange(int width, int height, int rotation);

Parameters:

ParameterTypeDescription
widthintCloud phone width
heightintCloud phone height
rotationintCloud phone rotation angle

Clipboard Callback

Description: Received clipboard data from cloud phone instance

Signature:

void onClipboardMessage(const std::string& text);

Parameters:

ParameterTypeDescription
textstringCloud phone clipboard text (UTF-8 encoded)

First Video Frame Callback

Description: First frame callback after starting cloud phone instance and subscribing to video stream

Signature:

void onFirstVideoFrame();

Local Screenshot Callback

Description: Video frame callback after calling screenshot(true)

Signature:

void onLocalScreenshot(std::shared_ptr<VideoFrame>& frame);

Parameters:

ParameterTypeDescription
framestd::shared_ptr<VideoFrame>Video frame data (see VideoFrame)

Network Quality Callback

Description: Current network quality callback

Signature:

void onNetworkQuality(int rtt);

Parameters:

ParameterTypeDescription
rttintNetwork latency (ms)

Idle Timeout Callback

Description: Idle timeout for current cloud phone instance

Signature:

void onIdeTimeout();

Cloud Phone Error Callback

Description: Cloud phone instance error callback

Signature:

void onError(int error, const std::string& msg);

Parameters:

ParameterTypeDescription
errorintError code
msgstringError description

Camera State Callback

Description: Cloud phone camera state change callback

Signature:

void onCameraChanged(bool isFront, bool isOpen);

Parameters:

ParameterTypeDescription
isFrontboolWhether front camera
isOpenboolWhether open

Video Frame Callback

Description: Real-time video frame callback

Signature:

void onFrame(std::shared_ptr<VideoFrame>& frame);

Parameters:

ParameterTypeDescription
framestd::shared_ptr<VideoFrame>Video frame data (see VideoFrame)

Batch Streaming Result Callback

Description: Batch streaming start result callback

Signature:

void onBatchPodStartResult(int error, const std::string& msg, const std::vector<std::string>& podList);

Parameters:

ParameterTypeDescription
errorintBatch streaming result
msgstringBatch streaming error message
podListstd::vectorstd::stringList of cloud phones in batch

Batch Streaming Error Callback

Description: Error callback during batch streaming

Signature:

void onError(int error, const std::string& msg);

Parameters:

ParameterTypeDescription
errorintBatch streaming result
msgstringBatch streaming error message

VideoFrame Interface

Video Frame Width

Description: Get video frame width (pixels)

Signature:

uint32_t width();

Video Frame Height

Description: Get video frame height (pixels)

Signature:

uint32_t height();

Video Frame Rotation

Description: Get video frame rotation angle (0°, 90°, 180°, 270°)

Signature:

uint32_t rotation();

Video Frame Buffer

Description: Get raw video frame data pointer

Signature:

uint8_t* buffer();

Video Frame Size

Description: Get video frame data size (bytes)

Signature:

uint32_t size();
Prev
API Documentation
Next
Changelog