MxInit

Function Usage

Performs global initialization such as allocating device and log resources. After all Vision SDK APIs are executed, call MxDeInit() to deinitialize the initialized global resources. For details, see Initialization and Deinitialization.

  • MxInit can be called only once per process.
  • The underlying channel resources requested by the DVPP resource pool are shared by processes. In multi-process scenarios, resources may be exhausted. Therefore, exercise caution when using the DVPP resource pool.
  • The DVPP resource pool shares bottom-layer channel resources with VideoEncoder and VideoDecoder. In extreme scenarios, resources may be used up. You are advised to initialize the resource pool size based on the actual situation.
  • This API registers the threads for monitoring the number of logs and log time. The threads are named log_filenum and log_time respectively.

Prototype

1
APP_ERROR MxInit();
1
APP_ERROR MxInit(const AppGlobalCfg &globalCfg);
1
APP_ERROR MxInit(const AppGlobalCfgExtra &globalCfgExtra); 

Parameters

Parameter

Input/Output

Description

globalCfg

Input

AppGlobalCfg type that applies to global configuration.

globalCfgExtra

Input

AppGlobalCfgExtra type that applies to global configuration.

Response Parameters

Data Structure

Description

APP_ERROR

For details about the returned error codes, see APP_ERROR Description.