venc_query_status

Applicability

Product

Supported (√/x)

Atlas A3 training products / Atlas A3 inference products

Atlas A2 training products / Atlas A2 inference products

Atlas training products

x

Atlas inference products

Atlas 200I/500 A2 inference products

Function Usage

Queries the status of an encoding channel.

Prototype

  • C Prototype
    1
    hi_s32 hi_mpi_venc_query_status(hi_venc_chn chn, hi_venc_chn_status *status);
    
  • Python Function
    1
    status, ret = acl.himpi.venc_query_status(chn)
    

Parameter Description

Parameter

Description

chn

Int, decoding channel ID.

  • Atlas inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256.
  • Atlas A2 training products / Atlas A2 inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.
  • Atlas 200I/500 A2 inference products : The value range of this parameter is [0, 128). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 128.
  • Atlas A3 training products / Atlas A3 inference products : The value range of this parameter is [0, 256). The JPEGD and VDEC functions share the same channels, and the maximum number of channels is 256. Among them, a maximum of 256 JPEGD decoding channels and 32 VDEC decoding channels are supported.

Return Value Description

Return Value

Description

status

Dict, encoding channel status hi_venc_chn_status.

ret

Int, error code.

Restrictions

  • Ensure that a channel has been created. Otherwise, a failure is returned.
  • The output status points to the following information:
    • In the encoding channel status dictionary, left_pics indicates the number of remaining frames to be encoded. Before any attempt to reset an encoding channel, use this API call to make sure that all frames have been encoded.
    • In the encoding channel status dictionary, left_stream_bytes indicates the number of remaining bytes in the stream buffer.

      Before any attempt to reset an encoding channel, use this API call to ensure that the stream has been completely encoded.

    • In the encoding channel status dictionary, left_stream_frames indicates the number of remaining frames in the stream buffer.

      Before any attempt to reset an encoding channel, use this API call to ensure that the stream has been completely encoded.

    • In the encoding channel status dictionary, cur_packs indicates the number of packets of the current frame. Prior to the acl.himpi.venc_get_stream call, use this API call to ensure that cur_packs is greater than 0.

      For stream fetching in packet mode, the current frame could be incomplete. For stream fetching in frame mode, cur_packs indicates the number of packets of a complete frame (the value 0 indicates that no frame is available). When you want to obtain the streams by frames, you need to query the number of packets for a complete frame by calling the query function after the select function is called successfully. In this case, cur_packs represents the number of packets contained in a current complete frame.

    • In the encoding channel status dictionary, left_recv_pics indicates the number of remaining frames to be received after the acl.himpi.venc_start_chn call.
    • In the encoding channel status dictionary, left_enc_pics indicates the number of remaining frames to be encoded after the acl.himpi.venc_start_chn call.
    • If no receive limit is specified in the acl.himpi.venc_start_chn call, the values of left_recv_pics and left_enc_pics are always 0.

Reference

For the API call sequence, see JPEGE and VENC.