Rate This Document
Findability
Accuracy
Completeness
Readability

API Description

The APIs in the following sections are external functional interfaces of the video stream engine server, including stream output, audio playback, touch and keyboard input, and microphone features. These APIs are provided as a dynamic link library (DLL) and the header file is provided for developers to invoke. Each feature corresponds to a data type and a module.

Developers interact with the APIs by configuring structures. The configuration file of each module can be extended based on the general configuration structure. In the general configuration structure, version indicates the version number of the current module.

struct VmiConfig {
    uint32_t version;                           // Set this parameter to the current version number of each module. For details, see the VmiVersion structure.
} __attribute__((packed));

The VmiConfigEngine structure is required for starting the engine. It includes the DataCallback and the list of modules to be started.

struct VmiConfigEngine {
    DataCallback dataCallback = nullptr;        // Callback for sending server data.
    DataTypeConfig dataTypeConfig[DATA_TYPE_MAX];
} __attribute__((packed));

No functional interface is provided for data output. Instead, the DataCallback is used. DataCallback definition:

using DataCallback = int(*)(VmiDataType module, VmiCmd cmd, uint8_t *data, uint32_t size);

The DataTypeConfig array specifies whether each module needs to be initialized and the size of the memory space that needs to be reserved before the data packet header during initialization so that developers can fill in required data.

struct DataTypeConfig {
    bool shouldInit = false;
    uint32_t sendDataOffset = 0;                // Space (in bytes) reserved before the data packet header when the callback is used to send data.
} __attribute__((packed));