---
title: acl.himpi.pngd_send_stream
description: "| c函数原型 | hi\_s32 hi\_mpi\_pngd\_send\_stream(hi\_pngd\_chn chn, const hi\_img\_stream \*stream, hi\_pic\_info \*png\_pic\_info, hi\_s32 milli\_sec) |"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/aadgp/aclpythondevg_01_0539.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/aadgp/aclpythondevg_01_0539.html
indexId: 32dba9b0dfbfe34e162e19e0feea4e55c87e173c49623b20e80126770228151d108
---
# acl.himpi.pngd_send_stream

| c函数原型 | hi\_s32 hi\_mpi\_pngd\_send\_stream(hi\_pngd\_chn chn, const hi\_img\_stream \*stream, hi\_pic\_info \*png\_pic\_info, hi\_s32 milli\_sec) |
| --- | --- |
| Python函数 | ret = acl.himpi.pngd\_send\_stream(chn, stream, png\_pic\_info, milli\_sec) |
| 函数功能 | 解码前，向解码通道发送码流数据及存放解码结果的buffer。 |
| 输入说明 | chn ：解码通道号。 该参数的取值范围为[0, 128)，通道总数最多128。 stream(hi\_img\_stream)：输入码流信息。该字典内的addr参数配置的地址为Device上的内存地址。 png\_pic\_info(hi\_pic\_info)：输出图片信息字典。 milli\_sec：超时时间，单位是毫秒。 \-1：阻塞方式 0：非阻塞方式 >0：超时方式，配置具体的超时时间。超时时间受操作系统影响，一般偏差在操作系统的一个时间片内，例如，操作系统的一个时间片为4ms，用户设置的milli\_sec参数值为1，则实际的超时时间在1ms到5ms范围内。在CPU负载高场景下，超时时间仍可能存在波动。 |
| 返回值说明 | ret：int，错误码。 返回0表示成功。 返回非0表示失败，参见PNGD图像解码返回码。 |
| 约束说明 | 发送数据前必须保证通道已经被创建，否则直接返回通道未创建的错误码HI\_ERR\_PNGD\_UNEXIST。如果在发送码流过程中销毁通道，就会立刻返回错误码HI\_ERR\_PNGD\_UNEXIST。 发送码流时需要送入整张png图片。否则，解码会出现错误。 以非阻塞方式发送码流，如果码流缓冲区已满，会立刻返回错误码HI\_ERR\_PNGD\_BUF\_FULL。 以超时方式发送码流，到达设定的超时时间还不能成功发送码流会返回错误码HI\_ERR\_PNGD\_BUF\_FULL。 图像解码时，对输入、输出图片的要求请参见功能及约束说明。 解码时，输入输出内存必须使用acl.himpi.dvpp\_malloc接口和acl.himpi.dvpp\_free接口进行申请和释放，输入输出内存均需要在调用acl.himpi.pngd\_get\_image\_data接口获取结果之后才能进行释放。 |
