hi_mpi_vi_get_chn_frame

The Atlas 200/300/500 Inference Product does not support this API.

The Atlas Training Series Product does not support this API.

Description

Obtains video image information from a specified VI channel. The image information includes the width, height, pixel format, timestamp, and addresses of YUV components.

Restrictions

  • Images can be obtained through this API only when the channel is enabled and the queue depth is not 0.
  • The images can be released after being obtained for multiple times. However, you are advised to call the release API each time after you call this API.
  • The obtained address information comes from the temporary buffer used in the module. Call hi_mpi_vi_release_chn_frame to release the buffer after using it.
  • You can wait for readable image information in select or epoll mode by calling hi_mpi_vi_get_chn_fd. After video input data is available, obtain images by calling hi_mpi_vi_get_chn_frame in non-blocking mode.

Prototype

hi_s32 hi_mpi_vi_get_chn_frame(hi_vi_pipe vi_pipe, hi_vi_chn vi_chn, hi_video_frame_info *frame_info, hi_s32 milli_sec)

Parameters

Parameter

Input/Output

Description

vi_pipe

Input

Pipe ID.

Value range: [0, 12)

vi_chn

Input

VI channel ID.

Value range: [0, 1)

frame_info

Input

Structure of the VI frame information.

milli_sec

Input

Timeout parameter. The options are as follows:
  • -1: blocking mode. In this mode, the program waits until images are obtained.
  • 0: non-blocking mode
  • > 0: timeout interval (ms). If no image is obtained within the configured timeout interval, timeout occurs.

Returns