GetPacket

Function Usage

Template function, which requests data from a specified element in the specified service flow.

  • If the specified element is the appsink plugin, the received data is Packet<std::shared_ptr<MxstBufferOutput>>.
  • If other elements are specified, the corresponding metadata is obtained, including Packet<std::shared_ptr<MxVisionList>>, Packet<std::shared_ptr<MxTensorPackageList>>, Packet<std::shared_ptr<MxObjectList>>, Packet<std::shared_ptr<MxImageMaskList>>, Packet<std::shared_ptr<MxClassList>>, Packet<std::shared_ptr<MxPoseList>>, Packet<std::shared_ptr<MxTextObjectList>>, and Packet<std::shared_ptr<MxTextsInfoList>>.

Prototype

template <class T>
APP_ERROR GetPacket(Packet<T>& packet, const std::string& streamName, const std::string& outElement, 
    const uint32_t& msTimeOut = DELAY_TIME)

Parameter Description

Parameter

Input/Output

Description

packet

Output

Data output by the specified element

streamName

Input

Stream name

elementName

Input

Element name

msTimeOut

Input

Maximum waiting time, in milliseconds. The default value is 3000 ms (3s).

Return Parameter Description

Data Structure

Description

APP_ERROR

Error code returned during program execution. For details, see the MxBase/ErrorCode/ErrorCode.h file.