Start
Function Usage
Starts the instruction stream engine and enables its rendering threads and network connection.
Restrictions
Ensure that the network channel is available before calling this API.
Prototype
uint32_t Start(uint64_t surface, uint32_t width, uint32_t height, uint32_t densityDpi)
Parameters
Parameter |
Input/Output |
Class |
Description |
|---|---|---|---|
surface |
Input |
uint32_t |
Object of the surface control transferred by the Activity. The object is converted into the ANativeWindow pointer through JNI and then converted into a value of the uint64_t type. |
width |
Input |
uint32_t |
Width of the device screen. The value is greater than 0. |
height |
Input |
uint32_t |
Height of the device screen. The value is greater than 0. |
densityDpi |
Input |
uint32_t |
Pixel density of the device screen. The value is greater than 0. |
Returns
- VMI_SUCCESS: Success.
- VMI_CLIENT_INVALID_PARAM: Invalid parameter.
- VMI_CLIENT_START_FAIL: Failed to start the instruction stream engine client.
- VMI_CLIENT_ALREADY_STARTED: The instruction stream engine client has been started.
Example Call
void Test()
{
ANativeWindow *nativeWindow = ANativeWindow_fromSurface(env, surface);
uint32_t result = Start(reinterpret_cast<uint64_t>(nativeWindow), width, height, densityDpi);
if (result == VMI_SUCCESS) {
// The instruction stream engine client is started successfully, and the program proceeds.
...
} else {
// The instruction stream engine client fails to be started.
...
}
}
Parent topic: External APIs of the Instruction Stream Engine Client