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

Graph::UpdateEngineConfig

Updates the parameters of a specified engine. This API is defined in graph.h.

Application scenario:

This API allows you to update the specified running parameters in the running process.

For example, in the video snapshot scenario, the running process needs to be updated based on the change of day and night. Therefore, you need to update the values for day and night to the engine by using the UpdataEngineConfig function.

Syntax

static HIAI_StatusT Graph::UpdateEngineConfig(const uint32_t& graphId, const uint32_t& engineId, const AIConfig& aiConfig, const bool& syncFlag = false)

Parameter Description

Parameter

Description

Value Range

graphId

Graph ID

-

engineId

engine ID

-

aiConfig

Configuration parameter

-

syncFlag

Synchronous or asynchronous execution. For synchronous execution, wait for the returned result.

true/false

Return Value

For details about the returned error codes, see "Error Codes."

Error Codes

No.

Error Code

Description

1

HIAI_OK

The running is OK.

2

HIAI_GRAPH_NOT_EXIST

The graph does not exist.

3

HIAI_GRAPH_MEMORY_POOL_NOT_EXISTED

The memory pool does not exist.

4

HIAI_GRAPH_MALLOC_LARGER

The buffer fails to be allocated because the size is larger than 256 MB.

5

HIAI_MEMORY_POOL_UPDATE_FAILED

The memory pool fails to be updated.

6

HIAI_GRAPH_SENDMSG_FAILED

The HDC module fails to send a message.

7

HIAI_GRAPH_MEMORY_POOL_INITED

The memory pool has been initialized.

8

HIAI_GRAPH_NO_MEMORY

There is no memory.