acl.himpi.vdec_release_frame

C Prototype

hi_s32 hi_mpi_vdec_release_frame(hi_vdec_chn chn, const hi_video_frame_info *frame_info);

Python Function

ret = acl.himpi.vdec_release_frame(chn, frame_info)

Function Usage

Releases resources after decoding is complete.

The Atlas 200/300/500 Inference Product does not support this API in the current version.

The Atlas Training Series Product does not support this API in the current version.

Input Description

chn: int, decoding channel ID.

frame_info: dict, dictionary of decoded image information, which is obtained by calling acl.himpi.vdec_get_frame. For details, see hi_video_frame_info.

Return Value

ret: int, error code.

  • 0 indicates success.
  • Other values: failure. For details, see VDEC/JPEGD Return Codes.
    • If no channel is created during image decoding, the error code HI_ERR_VDEC_UNEXIST is returned.
    • If the channel is destroyed when decoded images are being obtained, the error code HI_ERR_VDEC_UNEXIST is returned.
    • If the channel is reset when decoded images are being obtained, the error code HI_ERR_VDEC_UNEXIST is returned.
    • When decoded images are obtained in non-blocking mode, HI_ERR_VDEC_BUF_EMPTY is returned if there are no images in the buffer.
    • In timeout mode, if no hardware decoding result is fetched within the specified timeout interval, the error code HI_ERR_VDEC_BUF_EMPTY is returned. In this case, increase the timeout period or call this API repeatedly to obtain the decoding result.

Restrictions

  • Use this API in pair with acl.himpi.vdec_get_frame. Free the obtained data in a timely manner; otherwise, the decoding process will be blocked to wait for resources.
  • The data to be freed is that obtained by the acl.himpi.vdec_get_frame call without any change.