hi_isp_ae_exp_func

Description

Defines the AE callback function.

Definition

typedef struct {
    hi_s32 (*pfn_ae_init)(hi_s32 handle, const hi_isp_ae_param *ae_param);
    hi_s32 (*pfn_ae_run)(hi_s32 handle,
                         const hi_isp_ae_info *ae_info,
                         hi_isp_ae_result *ae_result,
                         hi_s32 reserved);
    hi_s32 (*pfn_ae_ctrl)(hi_s32 handle, hi_u32 cmd, hi_void *value);
    hi_s32 (*pfn_ae_exit)(hi_s32 handle);
} hi_isp_ae_exp_func;

Members

Member

Description

pfn_ae_init

Pointer to the callback function for initializing the AE

pfn_ae_run

Pointer to the callback function for running the AE

pfn_ae_ctrl

Pointer to the callback function for controlling the internal status of the AE.

For details about the cmd value, see hi_isp_ctrl_cmd.

pfn_ae_exit

Pointer to the callback function for destroying the AE

Restrictions

  • pfn_ae_init is called when hi_mpi_isp_init is called to initialize the AE algorithm library.
  • pfn_ae_run is called when hi_mpi_isp_run is called to run the AE algorithm library and calculate the exposure time and gain of the sensor and the digital gain of the ISP.
  • According to the design methodology, a ctrl interface is implemented in the AE algorithm library to change the internal running status. The ctrl interface provides a parameter transfer command and a VOID data transfer pointer. The ctrl interface is registered with the ISP library as a callback function pointer. The ISP control unit inexplicitly calls commands to control the internal running status of the AE algorithm library. The ctrl interface can also be called as a user interface to change the internal running status of the AE algorithm library status. For example:
    hi_s32 ae_ctrl_cmd(hi_s32 handle, hi_u32 cmd, hi_void *value)
    {
        ae_check_pointer_return(value); 
        switch (cmd) {
            case HI_ISP_WDR_MODE_SET:
                ……
                break;
            ……
        }
        return HI_SUCCESS;
    }

    When the library runs, the ISP control unit inexplicitly calls pfn_ae_ctrl to prompt the AE algorithm library to switch the WDR or linear mode, set the frame rate, and configure the sensor.

    For details of the ctrl command defined by the firmware, see hi_isp_ctrl_cmd.

  • pfn_ae_exit is called when hi_mpi_isp_exit is called to destroy the AE algorithm library.
  • Multiple instances can be initialized and run in the algorithm library. The handle parameter is used to distinguish instances. To support multiple instances, you can use different alg_lib.id to register the algorithm library for multiple times. For example:
    hi_isp_3a_alg_lib ae_lib;
    ae_lib.id = 0;
    hi_vi_pipe vi_pipe = 0;
    strncpy(ae_lib.lib_name, HI_AE_LIB_NAME, sizeof(HI_AE_LIB_NAME)); 
    hi_mpi_ae_register(vi_pipe,&ae_lib);
    ae_lib.id = 1;
    hi_mpi_ae_register(vi_pipe,&ae_lib);