hi_mpi_isp_set_pub_attr
The
The
Description
Sets the public attributes of the ISP library, such as the cropping resolution and frame rate.
Prototype
hi_s32 hi_mpi_isp_set_pub_attr(hi_vi_pipe vi_pipe, const hi_isp_pub_attr *pub_attr)
Restrictions
- Call hi_mpi_isp_mem_init to initialize the internal resources of the ISP library before calling this API.
- A running ISP supports the dynamic cropping of the start position of an image.
- After this API is called, the processing in the ISP library is as follows:The ISP firmware determines whether the WDR mode, image resolution, and frame rate are changed. If no, the ISP exits the switching process. If yes, the ISP firmware calls pfn_cmos_set_wdr_mode and pfn_cmos_set_image_mode registered by hi_mpi_isp_sensor_reg_callback to change the sensor mode.
- If the sensor mode is not changed (the return value of the callback function is -2), check whether the cropping width and height of the ISP is changed. If yes, the ISP firmware switches the resolution and calls the callback function pfn_cmos_sensor_init registered by hi_mpi_isp_sensor_reg_callback to reconfigure the sensor. If no, the sensor mode remains unchanged.
- If the sensor mode is changed (the return value of the callback function is 0), the ISP firmware calls the callback function pfn_cmos_sensor_init registered by hi_mpi_isp_sensor_reg_callback to reconfigure the sensor.
- You can adjust the implementation of the callback function pfn_cmos_set_image_mode to adjust the sequence of switching the sensor modes. If only the 5M 30 FPS and 1080p 60 FPS initialization sequences are provided for the sensor, 1080p 30 FPS operation can be achieved through cropping 5M 30 FPS or reducing the frame rate from 1080p 60 FPS by modifying the pfn_cmos_set_image_mode function.
- When the linear mode or frame WDR mode is switched to, the return value of pfn_cmos_set_image_mode is also determined. Therefore, different image_mode values should be used for the linear mode and WDR mode to ensure successful mode switchover.
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
vi_pipe |
Input |
VI pipe ID. Value range: [0, 12) |
pub_attr |
Input |
Public attributes of the ISP. |
Returns
- 0: success
- Other values: failure. For details, see ISP System Control Return Codes.
Parent topic: ISP System Control and 3A Algorithm Registration