Receiving a Stream

Ascend 310 acldvpp API

Ascend 310P hi_mpi API

What You Need to Do

The callback function has been registered when the channel description is set and it is automatically called each time when a frame of data is decoded. The memory address and memory size of the decoded data are obtained by using the corresponding Get method in the callback function.

acldvppGetPicDescData

acldvppGetPicDescWidth

acldvppGetPicDescHeight

acldvppGetPicDescWidthStride

acldvppGetPicDescHeightStride

acldvppGetPicDescFormat

acldvppGetPicDescRetCode (specific to acl APIs)

Obtain the decoding result of a frame using hi_mpi_vdec_get_frame, and then obtain the decoded data from the following members of the hi_video_frame_info struct:

hi_video_frame_info.v_frame.virt_addr[0]

hi_video_frame_info.v_frame.width

hi_video_frame_info.v_frame.height

hi_video_frame_info.v_frame.width_stride[0]

hi_video_frame_info.v_frame.height_stride[0]

hi_video_frame_info.v_frame.pixel_format

hi_video_frame_info.v_frame.frame_flag (corresponding to retCode)

Modify your code to start another thread and call the hi_mpi_vdec_get_frame API to proactively obtain the decoding result.

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

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

hi_mpi_vdec_stop_recv_stream

Add the hi_mpi_vdec_stop_recv_stream API call in your code.