hi_mpi_vi_get_chn_frame
Applicability
|
Product |
Supported |
|---|---|
|
Atlas 350 Accelerator Card |
☓ |
|
|
☓ |
|
|
☓ |
|
|
√ |
|
|
☓ |
|
|
☓ |
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:
|
Returns
- 0: success
- Other values: failure. For details, see VI Return Codes.
Restrictions
- Before calling this API, you must call the hi_mpi_vi_create_pipe API to create a pipe.
- 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.