Video Input
Video input refers to the process by which Pico-G1 receives video data through the MIPI interface and stores it in a specified memory region.
1 Video Input System

1.1.1 Typical Video Input Scenarios
- Scenario 1: Real camera input
Camera / sensor -> VI device parses timing -> physical PIPE performs image processing -> channel crops/outputs -> DDR -> VPSS / encoder / display
- Scenario 2: Multi-camera stitching / wide dynamic range
Multiple camera inputs -> multiple devices / multiple PIPEs -> grp handles the combining relationship -> stitch / WDR cooperative processing -> channels output to DDR
- Scenario 3: Software-fed image
Program generates or reads one frame of image -> virtual PIPE receives -> image processing -> channel output -> used by subsequent modules
2 Video Input API Reference
2.1 API Overview
API Reference
• xmedia_vi_init: VI initialization.
• xmedia_vi_exit: VI exit.
• xmedia_vi_set_dev_config: Set VI device attributes.
• xmedia_vi_get_dev_config: Get VI device attributes.
• xmedia_vi_enable_dev_quick_start: Enable VI device quick start.
• xmedia_vi_set_dev_mipi_phy_config: Set VI MIPI PHY manual configuration information.
• xmedia_vi_enable_dev: Enable a VI device.
• xmedia_vi_disable_dev: Disable a VI device.
• xmedia_vi_set_dev_bind_pipe: One-to-one bind a dev and a pipe.
• xmedia_vi_set_dev_unbind_pipe: One-to-one unbind a dev and a pipe.
• xmedia_vi_get_pipe_by_dev: Get the pipe bound to a dev.
• xmedia_vi_set_grp_config: Set the VI group configuration information.
• xmedia_vi_get_grp_config: Get the VI group configuration information.
• xmedia_vi_create_pipe: Create a VI PIPE.
• xmedia_vi_destroy_pipe: Destroy a VI PIPE.
• xmedia_vi_get_pipe_config: Get the VI PIPE configuration information.
• xmedia_vi_start_pipe: Enable a VI PIPE.
• xmedia_vi_stop_pipe: Disable a VI PIPE.
• xmedia_vi_set_user_pic: Set a user picture.
• xmedia_vi_enable_user_pic: Enable VI PIPE insertion of a user picture.
• xmedia_vi_disable_user_pic: Disable VI PIPE insertion of a user picture.
• xmedia_vi_set_pipe_crop_attr: Set the cropping attributes of a VI physical PIPE.
• xmedia_vi_get_pipe_crop_attr: Get the cropping attributes of a VI physical PIPE.
• xmedia_vi_set_pipe_frame_dump_attr: Set the dump attributes of a VI physical PIPE.
• xmedia_vi_get_pipe_frame_dump_attr: Get the dump attributes of a VI physical PIPE.
• xmedia_vi_acquire_pipe_frame: Acquire an image frame from a VI physical PIPE.
• xmedia_vi_release_pipe_frame: Release an image frame of a VI physical PIPE.
• xmedia_vi_set_pipe_frame_source: Set the data source of a VI physical PIPE.
• xmedia_vi_get_pipe_frame_source: Get the data source of a VI physical PIPE.
• xmedia_vi_send_pipe_frame: Send an image frame through a VI PIPE.
• xmedia_vi_set_pipe_compress_mode: Set the compression mode of a VI physical PIPE.
• xmedia_vi_get_pipe_compress_mode: Get the compression mode of a VI physical PIPE.
• xmedia_vi_set_pipe_frame_rate: Set the frame-rate control information of a VI physical PIPE.
• xmedia_vi_get_pipe_frame_rate: Get the frame-rate control information of a VI physical PIPE.
• xmedia_vi_set_pipe_low_delay_attr: Set the low-latency attributes of a VI physical PIPE.
• xmedia_vi_get_pipe_low_delay_attr: Get the low-latency attributes of a VI physical PIPE.
• xmedia_vi_query_pipe_status: Query the status of a VI PIPE.
• xmedia_vi_set_pipe_vc_number: Set the VC number of the front-end sensor or AD connected to a VI physical PIPE.
• xmedia_vi_get_pipe_vc_number: Get the VC number of the front-end sensor or AD connected to a VI physical PIPE.
• xmedia_vi_set_pipe_mirror_flip: Set the output mirror and flip enable of a VI physical PIPE.
• xmedia_vi_get_pipe_mirror_flip: Get the output mirror and flip enable of a VI physical PIPE.
• xmedia_vi_set_chn_config: Set the VI channel configuration information.
• xmedia_vi_get_chn_config: Get the VI channel configuration information.
• xmedia_vi_enable_chn: Enable a VI channel.
• xmedia_vi_disable_chn: Disable a VI channel.
• xmedia_vi_set_chn_crop_attr: Set the cropping attributes of a VI channel.
• xmedia_vi_get_chn_crop_attr: Get the cropping attributes of a VI channel.
• xmedia_vi_set_chn_compress_mode: Set the output compression mode of a VI channel.
• xmedia_vi_get_chn_compress_mode: Get the output compression mode of a VI channel.
• xmedia_vi_set_chn_frame_rate: Set the frame-rate control information of a VI channel.
• xmedia_vi_get_chn_frame_rate: Get the frame-rate control information of a VI channel.
• xmedia_vi_set_chn_depth: Set the queue depth for the user to acquire VI channel images.
• xmedia_vi_get_chn_depth: Get the queue depth for VI channel images.
• xmedia_vi_set_chn_ldc_attr: Set the VI lens distortion correction (LDC) attributes.
• xmedia_vi_get_chn_ldc_attr: Get the VI lens distortion correction (LDC) attributes.
• xmedia_vi_set_chn_spread_attr: Set the VI channel spread attributes.
• xmedia_vi_get_chn_spread_attr: Get the VI channel spread attributes.
• xmedia_vi_set_chn_low_delay_attr: Set the low-latency attributes of a VI channel.
• xmedia_vi_get_chn_low_delay_attr: Get the low-latency attributes of a VI channel.
• xmedia_vi_set_chn_wrap_attr: Set the wrap attributes of a VI channel.
• xmedia_vi_get_chn_wrap_attr: Get the wrap attributes of a VI channel.
• xmedia_vi_set_chn_dis_config: Set the DIS configuration information of a VI channel.
• xmedia_vi_get_chn_dis_config: Get the DIS configuration information of a VI channel.
• xmedia_vi_set_chn_dis_attr: Set the DIS attributes of a VI channel.
• xmedia_vi_get_chn_dis_attr: Get the DIS attributes of a VI channel.
• xmedia_vi_set_chn_fov_correction_attr: Set the field-of-view (FOV) correction attributes of a VI channel.
• xmedia_vi_get_chn_fov_correction_attr: Get the field-of-view (FOV) correction attributes of a VI channel.
• xmedia_vi_set_chn_fisheye_attr: Set the fisheye attributes of a VI channel.
• xmedia_vi_get_chn_fisheye_attr: Get the fisheye attributes of a VI channel.
• xmedia_vi_fisheye_pos_query_dst_to_src: Look up the source image coordinate from a fisheye-corrected output image coordinate.
• xmedia_vi_set_chn_stitch_attr: Set the pre-stitch correction attributes of a VI channel.
• xmedia_vi_get_chn_stitch_attr: Get the pre-stitch correction attributes of a VI channel.
• xmedia_vi_select_chn_frame: Check whether an image is present in the output channel queue.
• xmedia_vi_acquire_chn_frame: Acquire a captured image from a VI channel.
• xmedia_vi_release_chn_frame: Release one frame acquired from a VI channel.
• xmedia_vi_set_ext_chn_config: Set the VI extension channel attributes.
• xmedia_vi_get_ext_chn_config: Get the VI extension channel attributes.
• xmedia_vi_attach_pipe_vb_pool: Bind a memory pool to a specified pipe.
• xmedia_vi_detach_pipe_vb_pool: Unbind a memory pool from a specified pipe.
• xmedia_vi_attach_chn_vb_pool: Bind a memory pool to a specified channel.
• xmedia_vi_detach_chn_vb_pool: Unbind a memory pool from a specified channel.
• xmedia_vi_attach_ainr_vb_pool: Bind an ainr output memory pool to a specified pipe.
• xmedia_vi_detach_ainr_vb_pool: Unbind an ainr output memory pool from a specified pipe.
• xmedia_vi_get_pipe_fd: Get the pipe file descriptor.
• xmedia_vi_get_chn_fd: Get the chn file descriptor.
Tip
For a specific application, see sample_vio.
