hi_mpi_vi_get_chn_frame

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

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

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

Restrictions

  • Images can be obtained through this API only when the channel is enabled and the queue depth is not 0.
  • The images captured for multiple times can be released. You are advised to call the release API after you call the capture API.
  • The obtained address information comes from the temporary memory used in the module. Therefore, you must call the hi_mpi_vi_release_chn_frame interface to release the memory after using the address information.
  • You can wait for the readable image information in select/epoll mode by using the hi_mpi_vi_get_chn_fd interface. After there is available video input data, you can obtain the image by using the hi_mpi_vi_get_chn_frame interface in non-block mode.

See Also

For details about the API call sequence, see Video Data Obtaining.