高通camera驱动分析 (6)

在imx230_lib.c中,最后将所有的参数设置都放入sensor_lib_t类型的结构体sensor_lib_ptr中,定义函数imx230_ofilm_open_lib()来返回sensor_lib_ptr的地址,供外界调用。

结构体sensor_lib_t涵盖了关于camera设置的几乎全部信息。如下:
typedef struct {
  /* sensor slave info */
  struct msm_camera_sensor_slave_info *sensor_slave_info;
  /* sensor info */
  struct msm_sensor_init_params *sensor_init_params;
  /* name of the AF actuator (if any)*/
  char* actuator_name;
  /* name of the eeprom (if any)*/
  char* eeprom_name;
  /* sensor output settings */
  sensor_output_t *sensor_output;
  /* sensor output register address */
  struct msm_sensor_output_reg_addr_t *output_reg_addr;
  /* sensor exposure gain register address */
  struct msm_sensor_exp_gain_info_t *exp_gain_info;
  /* sensor aec info */
  sensor_aec_data_t *aec_info;
  /* sensor snapshot exposure wait frames info */
  uint16_t snapshot_exp_wait_frames;
  /* number of frames to skip after start stream info */
  uint16_t sensor_num_frame_skip;
  /* number of frames to skip after start HDR stream info */
  uint16_t sensor_num_HDR_frame_skip;
  /* sensor pipeline delay */
  uint32_t sensor_max_pipeline_frame_delay;
  /* sensor exposure table size */
  uint16_t exposure_table_size;
  /* sensor lens info */
  sensor_lens_info_t *default_lens_info;
  /* csi lane params */
  struct csi_lane_params_t *csi_lane_params;
  /* csi cid params */
  struct msm_camera_csid_vc_cfg *csi_cid_params;
  /* sensor port info that consists of cid mask and fourcc mapaping */
  sensor_stream_info_array_t *sensor_stream_info_array;
  /* csi cid params size */
  uint16_t csi_cid_params_size;
  /* init settings */
  struct sensor_lib_reg_settings_array *init_settings_array;
  /* start settings */
  struct msm_camera_i2c_reg_setting *start_settings;
  /* stop settings */
  struct msm_camera_i2c_reg_setting *stop_settings;
  /* group on settings */
  struct msm_camera_i2c_reg_setting *groupon_settings;
  /* group off settings */
  struct msm_camera_i2c_reg_setting *groupoff_settings;
  /* resolution config table */
  struct sensor_res_cfg_table_t *sensor_res_cfg_table;
  /* resolution settings */
  struct sensor_lib_reg_settings_array *res_settings_array;
  struct sensor_lib_out_info_array     *out_info_array;
  struct sensor_lib_csi_params_array   *csi_params_array;
  struct sensor_lib_crop_params_array  *crop_params_array;
  struct sensor_lib_chromatix_array    *chromatix_array;
  /* video_hdr mode info*/
  struct sensor_lib_meta_data_info_array *meta_data_out_info_array;
  /* exposure funtion table */
  sensor_exposure_table_t *exposure_func_table;
  /* exposure info */
  sensor_exposure_info_t exposure_info;
  /* flag to sync exp and gain */
  uint8_t sync_exp_gain;
  /* video hdr func table */
  sensor_video_hdr_table_t *video_hdr_awb_lsc_func_table;
  /* scale size tbl count*/
  uint8_t scale_tbl_cnt;
  /* function to get scale size tbl*/
  int32_t (*get_scale_tbl)(msm_sensor_dimension_t *);
  /* supported Scene mode */
  uint32_t *sensor_supported_scene_mode;
  /* supported effect mode */
  uint32_t *sensor_supported_effect_mode;
  /* sensor pipeline immediate delay */
  uint32_t sensor_max_immediate_frame_delay;
  /* library specific data */
  void *data;
} sensor_lib_t;

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwsdsz.html