hi_mpi_venc_query_status

Applicability

Product

Supported

Atlas 350 Accelerator Card

Atlas A3 training product / Atlas A3 inference product

Atlas A2 training product / Atlas A2 inference product

Atlas 200I/500 A2 inference product

Atlas inference product

Atlas training product

Function Description

Queries the status of an encoding channel.

Prototype

hi_s32 hi_mpi_venc_query_status(hi_venc_chn chn, hi_venc_chn_status *status)

Parameters

Parameter

Input/Output

Description

chn

Input

Encoding channel ID.

Atlas 350 Accelerator Card: encoding channel ID. The value range is as follows: [0, 256). The maximum number of JPEGE channels is 256.

Atlas A3 training product / Atlas A3 inference product : The value range of the encoding channel ID is [0, 256). The maximum number of JPEGE channels is 256.

Atlas A2 training product / Atlas A2 inference product : The value range of the encoding channel ID is [0, 256). The maximum number of JPEGE channels is 256.

Atlas 200I/500 A2 inference product : The value range of this parameter is [0, 128). The JPEGE, and VENC functions share the same channels, and the maximum number of channels is 128.

For the Atlas inference product , the value range of the encoding channel ID is [0, 256). The JPEGE and VENC functions share channels. The maximum number of channels is 256.

status

Output

Pointer to the encoding channel status.

Returns

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 struct, left_pics indicates the number of remaining frames to be encoded. Before any attempt to reset an encoding channel, use this API call to ensure that all frames are encoded.
    • In the encoding channel status struct, 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 is completely encoded.

    • In the encoding channel status struct, 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 is completely encoded.

    • In the encoding channel status struct, cur_packs indicates the number of packets of the current frame. Ensure that cur_packs is greater than 0 before the hi_mpi_venc_get_stream call.

      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). If you want to fetch the streams by frames, 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 structure, left_recv_pics indicates the number of remaining frames to be received after hi_mpi_venc_start_chn is called.
    • In the encoding channel status structure, left_enc_pics indicates the number of remaining frames to be encoded after hi_mpi_venc_start_chn is called.
    • If hi_mpi_venc_start_chn is called but the number of frames to be received is not specified, the values of left_recv_pics and left_enc_pics are always 0.

See Also

For details about the API call sequence and examples, see JPEGE and VENC.