VMOS Cloud API
  • 简体中文
  • English
  • 简体中文
  • English
  • Product Introduction
  • Product Type
  • Product Billing
  • OpenAPI
    • API Documentation
    • Error Code
    • Instance Property List
    • Android Device Modification Properties List
  • Android SDK
    • Example Construction
    • Interface Description
    • Callback Function
    • Error Code
    • Changelog
  • Web H5 SDK
    • Example Build
    • API description
    • Callback Functions
    • Error Code
    • Change log
  • Windows PC SDK
    • Example Setup
    • API Documentation
    • Callback Functions
    • Changelog
  • Edge-Cloud Communication Development
    • System service interface (aidl)
    • System Service API (AIDL)
  • Similar to XP, LSP Hook framework
  • Related agreements

SDK Callback Overview

Cloud Machine Callback (SessionObserver)

Interface NameDescription
onConnectedNetwork connection successful
onDisconnectedNetwork disconnected
onCloseRemote network closed
onScreenChangeCallback for receiving cloud machine width, height, and rotation changes
onClipboardMessageCallback for receiving clipboard data from the cloud machine instance
onFirstVideoFrameCallback for the first video frame after subscribing to the video stream upon cloud machine startup
onLocalScreenshotVideo frame callback after calling screenshot(true)
onNetworkQualityCallback for current network status
onIdeTimeoutCallback for cloud machine instance idle timeout
onErrorCallback for cloud machine errors
onCameraChangedCallback for cloud machine camera status

Video Frame Callback (VideoRenderSink)

Interface NameDescription
onFrameVideo frame callback

Batch Stream Pulling Callback (BatchControlObserver)

Interface NameDescription
onBatchPodStartResultBatch stream pull result callback
onErrorBatch stream pull error callback

Video Frame (VideoFrame)

Interface NameDescription
widthVideo frame width in pixels
heightVideo frame height in pixels
rotationVideo frame rotation angle (0°, 90°, 180°, 270°)
bufferVideo frame data
sizeVideo 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)
ParameterDescription
widthCloud machine width
heightCloud machine height
rotationCloud machine rotation angle

Clipboard Callback

Description: Callback for receiving clipboard data from the cloud machine instance Syntax:

void onClipboardMessage(const std::string& text)
ParameterDescription
textCloud 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)
InterfaceDescription
frameVideo frame callback, refer to VideoFrame

Network Status Callback

Description: Callback for current network status Syntax:

void onNetworkQuality(int rtt)
ParameterDescription
rttNetwork 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)
ParameterDescription
errorError code
msgError description

Camera Status Callback

Description: Callback for cloud machine camera status Syntax:

void onCameraChanged(bool isFront, bool isOpen)
ParameterDescription
isFrontWhether it is the front camera
isOpenWhether the camera is open

Video Frame Callback

Description: Video frame callback Syntax:

void onFrame(std::shared_ptr<VideoFrame>& frame)
ParameterDescription
frameRefer 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)
ParameterDescription
errorBatch stream pull result
msgBatch stream pull error message
podListList 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)
ParameterDescription
errorBatch stream pull result
msgBatch 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()
Prev
API Documentation
Next
Changelog