Start
Function Usage
Starts the video stream engine client, including the video decoding thread and network connection.
Restrictions
Ensure that the network channel is available before calling this function.
Prototype
uint32_t Start(uint64_t surface, uint32_t width, uint32_t height, uint32_t densityDpi)
Parameters
Parameter |
Input/Output |
Class |
Description |
|---|---|---|---|
surface |
Input |
uint64_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. If the input surface is 0, the engine only receives data but does not perform video decoding. |
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: The video stream engine client is started successfully.
- VMI_CLIENT_EXEC_ORDER_FAIL: The execution order of the video stream engine client is invalid.
- VMI_CLIENT_INVALID_PARAM: The parameter is invalid.
- VMI_CLIENT_START_FAIL: The video stream engine client fails to be 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 video stream engine client is started successfully, and the program proceeds.
...
} else {
// Failed to start the video stream engine client.
...
}
}