MxstBufferOutput

Function Usage

Defines the buffer structure received by the stream.

Prototype

 struct MxstBufferOutput {
    APP_ERROR errorCode = APP_ERR_OK;
    std::string errorMsg;
    int dataSize = 0;
    uint32_t *dataPtr = nullptr;
    void *reservedPtr = nullptr;
    MxTools::MxpiFrameInfo mxpiFrameInfo;

    MxstBufferOutput() = default;

    explicit MxstBufferOutput(APP_ERROR errorCode, const std::string& errorMsg = "")
        : errorCode(errorCode), errorMsg(std::move(errorMsg)) {}

    void SetErrorInfo(APP_ERROR errorCodeIn, const std::string& errorMsgIn)
    {
        errorCode = errorCodeIn;
        errorMsg = errorMsgIn;
    }

    ~MxstBufferOutput()
    {
        if (dataPtr != nullptr) {
            free(dataPtr);
            dataPtr = nullptr;
        }
    }
};

Parameter Description

Parameter

Input/Output

Description

errorCode

Input

Error code

errorMsg

Input

Error message

dataSize

Input

Data size of the output buffer. The size must be the same as the actual size. Otherwise, a core dump may occur.

dataPtr

Input

Data pointer of the output buffer

mxpiFrameInfo

Input

Basic information about the output buffer

reservedPtr

Input

Reserved pointer