昇腾社区首页
中文
注册

SendProtobuf

函数功能

发送protobuf数据给Stream的输入元件(appsrc),使用接口需要安装3.9.0版本的protobuf,安装命令为pip3 install protobuf-3.9.0

函数原型

def SendProtobuf(streamName: bytes, inPluginId: int, protobufVec: list) -> int:
    pass
def SendProtobuf(streamName: bytes, elementName: bytes, protobufVec: list) -> int:
    pass

输入参数说明

参数名

类型

说明

streamName

bytes

流的名称。

inPluginId

int

输入插件ID,即appsrc元件的编号。

protobufVec

MxProtobufIn list

发送的MxProtobufIn列表,将protobuf的key、type、value发给mxStream,其中value是将protobuf序列化后的bytes。

elementName

bytes

输入插件的名称,只支持appsrc当做输入插件。

返回参数说明

数据结构

说明

int

程序执行返回的错误码,请参考APP_ERROR说明