Sending a Stream

Ascend 310 acldvpp or aclvdec API

Ascend 310P hi_mpi API

What You Need to Do

Configure the input stream information:

acldvppSetStreamDescData

acldvppSetStreamDescSize

acldvppSetStreamDescEos

No corresponding API. Directly assign values to the member of the hi_vdec_stream struct when configuring the input stream parameters:

hi_vdec_stream.addr

hi_vdec_stream.len

hi_vdec_stream.end_of_stream

Modify your code to configure the parameters of the input stream information by assigning values to the members of the hi_vdec_chn_attr struct.

Set hi_vdec_stream.end_of_stream to HI_TRUE, and in this case, the hi_mpi API will actively send the eos frame after all stream data is sent. To send more streams, set hi_vdec_stream.end_of_stream to HI_FALSE.

Configure the output image information:

acldvppSetPicDescData

acldvppSetPicDescSize

acldvppSetPicDescFormat

acldvppSetPicDescWidth

acldvppSetPicDescHeight

acldvppSetPicDescWidthStride

acldvppSetPicDescHeightStride

No corresponding API. Directly assign values to the members of the hi_vdec_pic_info struct when configuring the output image parameters:

hi_vdec_pic_info.vir_addr

hi_vdec_pic_info.buffer_size

hi_vdec_pic_info.pixel_format

hi_vdec_pic_info.width

hi_vdec_pic_info.height

hi_vdec_pic_info.width_stride

hi_vdec_pic_info.height_stride

hi_vdec_stream.need_display (specific to hi_mpi APIs)

Modify your code to configure the parameters of the output image information by assigning values to the members of the hi_vdec_pic_info struct.

Note that if you do not want to obtain the decoding result of a frame when using an acl API, use the aclvdecSendSkippedFrame API or set hi_vdec_stream.need_display in a hi_mpi API.

No corresponding API. The decoder does not need to be instructed to start receiving stream data.

Notify the decoder of starting receiving stream data (the API needs to be called only once per channel):

hi_mpi_vdec_start_recv_stream

Add the hi_mpi_vdec_start_recv_stream API call in your code.

aclvdecSendSkippedFrame

hi_vdec_stream.need_display (specific to hi_mpi APIs)

If you do not want to obtain the decoding result of a frame when using an acl API, use the aclvdecSendSkippedFrame API or set hi_vdec_stream.need_display in a hi_mpi API.

Call the API once per frame to send the stream to be decoded:

aclvdecSendFrame

Call the API once per frame to send the stream to be decoded:

hi_mpi_vdec_send_stream

Modify your code to send the stream using the hi_mpi_vdec_send_stream API and pass the channel ID.