GetPacket

Function Usage

Template function, which requests data from a specified element in a specified service stream. When the memory is insufficient, an exception is thrown in the function. Multi-thread concurrency is not supported.

  • 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

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

Parameters

Parameter

Input/Output

Description

packet

Output

Data output by the specified element

streamName

Input

Stream name

outElement

Input

Element name

msTimeOut

Input

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

Response Parameters

Data Structure

Description

APP_ERROR

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