hi_mpi_vi_get_chn_frame
The
The
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
- This API can be called only after a VI pipe is created by calling hi_mpi_vi_create_pipe.
- 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:
|
Returns
- 0: success
- Other values: failure. For details, see VI Return Codes.
Parent topic: VI