昇腾社区首页
中文
注册

GetPacket

函数功能

模板函数,在指定的业务流中,向指定的元件索取数据。

  • 若指定元件为appsink插件,则接收数据为Packet<std::shared_ptr<MxstBufferOutput>>。
  • 若指定其他元件,则获得相应的Meta数据,支持 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>>,Packet<std::shared_ptr<MxTextsInfoList>>。

函数原型

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

参数说明

参数名

输入/输出

说明

packet

输出

指定元件输出的数据。

streamName

输入

流名称。

elementName

输入

元件名称。

msTimeOut

输入

最长等待时间,单位毫秒,默认为3000ms(3秒)。

返回参数说明

数据结构

说明

APP_ERROR

程序执行返回的错误码,请参考“MxBase/ErrorCode/ErrorCode.h”文件。