Updated on 2022-03-13 GMT+08:00

CreateVdecApi

Syntax

int CreateVdecApi(IDVPPAPI*& pIDVPPAPI, int singleton)

Function

Obtains a VDEC API instance, which is equivalent to the handle to the VDEC executor. The caller can use the obtained VDEC API instance to call CreateVdecApi for video decoding. Cross-function calling and cross-thread calling are supported.

Input

  • IDVPPAPI pointer reference. The input pointer must be NULL.
  • The singleton is reserved for internal use to implement a single pIDVPPAPI instance in the future. It is recommended that the caller set the parameter to 0 currently.

Output

IDVPPAPI pointer reference. The output pointer may be or may not be NULL. If a DVPP API instance fails to be obtained, the output pointer is NULL. If a DVPP API instance is successfully obtained, the output pointer is not NULL.

Return Value

  • 0: success
  • –1: failure

Instructions

The caller creates the IDVPPAPI object pointer, which is initialized to NULL. The IDVPPAPI object pointer is passed by calling the CreateVdecApi function. If the application is successful, CreateVdecApi returns the DvppApi instance. Otherwise, NULL is returned. The caller needs to verify the return value.

Restriction

The caller is responsible for the life cycle of the VDEC API instance, including the application and release, which are implemented by using CreateVdecApi and DestroyVdecApi, respectively.