lib_3a_AwbGetImageEffect(ia_3a_image_effect *effect)
{
*effect = ci_adv_isp_get_image_effect();
- cam_lib_3a_dbg("%s:%d effect: %d\n", __func__, __LINE__);
+ cam_lib_3a_dbg("%s:%d effect: %d\n", __func__, __LINE__, *effect);
+
+}
+
+static void
+lib_ae_is_flash_needed(bool *useflash)
+{
+ ci_adv_ae_is_flash_necessary(useflash);
+ cam_lib_3a_dbg("%s:%d useflash: %d\n", __func__, __LINE__, *useflash);
}
mfldadvci->ae_calc_for_flash = lib_3a_ae_calc_for_flash;
mfldadvci->ae_calc_without_flash = lib_3a_calc_without_flash;
mfldadvci->ae_calc_with_flash = lib_3a_calc_with_flash;
+
+ mfldadvci->ae_is_flash_needed = lib_ae_is_flash_needed;
+
mfldadvci->ae_apply_results = lib_3a_ae;
mfldadvci->af_start = lib_3a_af_start;
case CAM_LIGHT_FLASH_MODE_ON:
case CAM_LIGHT_FLASH_MODE_FILL_IN:
case CAM_LIGHT_FLASH_MODE_RED_EYE:
- ret = cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_FLASH);
+ /* ret = cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_FLASH); */
break;
case CAM_LIGHT_FLASH_MODE_OFF:
ret = cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_OFF);
switch (mode) {
case CAM_CAPTURE_MODE_VIEWFINDER:
mfldadvci->switch_mode (ia_3a_isp_mode_preview, mfld_driver.frame_rate);
+ set_flash_mode(fd, mfld_cam_settings.flash_mode);
if (mfld_driver.ae_enabled)
//ci_adv_set_3a_mode(ia_3a_isp_mode_preview, &mfld_driver.sensor_config);
mfld_driver.first_frame = 1;
{
int index;
int frame_dis = 1, frame_cnt;
- cam_err_t ret;
-
+ cam_err_t ret = 0;
+ bool use_flash = TRUE;
+ int cur_flash_mode;
int flash_en = 0;
cam_capture_init (fd, buffer, capture_settings);
- flash_en = get_flash_status ();
-
- if (mfld_driver.mode == CAM_CAPTURE_MODE_STILL_CAPTURE &&
- flash_en == 1) {
- run_flash_sequence (fd, buffer);
+ if (mfld_driver.mode == CAM_CAPTURE_MODE_STILL_CAPTURE ) {
+ /* check flash here not in always when capturing frames */
+ flash_en = get_flash_status ();
+ get_flash_mode(&cur_flash_mode);
+ if (cur_flash_mode == CAM_LIGHT_FLASH_MODE_AUTO)
+ mfldadvci->ae_is_flash_needed(&use_flash);
+ if ((use_flash == TRUE) && (flash_en = 1)){
+ run_flash_sequence (fd, buffer);
+ }
+ else{
+ /* TODO: use indication
+ * cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_INDICATOR);
+ cam_driver_set_indication_intensity(fd, INDICATOR_INTENSITY);
+ * */
+ ret = run_normal_sequence(fd, buffer);
+ /* restore flash mode */
+ cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_OFF);
+ }
} else {
ret = run_normal_sequence(fd, buffer);
- if (ret)
- return ret;
}
+ if (ret)
+ return ret;
+
if (mfld_driver.rer_enabled && (mfld_driver.fourcc == V4L2_PIX_FMT_YUV420))
cam_do_redeye_removal (buffer);
return cam_driver_set_attribute (fd, V4L2_CID_FLASH_MODE, mode, "Flash Mode");
}
+cam_err_t
+cam_driver_set_indication_intensity (int fd,int intensity)
+{
+ cam_driver_dbg ("%s: intensity %d\n", __func__, intensity);
+
+ return cam_driver_set_attribute (fd, V4L2_CID_FLASH_INDICATOR_INTENSITY, intensity, "indication intensity");
+}