CreateHostBufferAndCopyData

Function Usage

Creates the MxpiBuffer (data structure transferred between plugins). This API allocates the host memory of a specified size based on the memory size specified by the user, copies the memory data transferred by the user to the host memory, and stores the host memory data and memory size in the metadata.

Prototype

1
static MxpiBuffer* MxpiBufferManager::CreateHostBufferAndCopyData(const InputParam& inputParam);

Parameters

Parameter

Description

inputParam

Data structure defined by the Buffer API. For details, see InputParam.

The value range of inputParam.dataSize is [1, 4294967296].

The key in the inputParam structure cannot be passed to ReserveMetadataGraph, ReservedVisionList, and ErrorInfo.

The value of inputParam.dataSize must be smaller than that of inputParam.ptrData; otherwise, memory overwriting occurs.

Response Parameters

Data Structure

Description

MxpiBuffer*

Data structure transferred between plugins. For details, see MxpiBuffer.