fix flash and clean up
authorMarko Ollonen <marko.ollonen@ixonos.com>
Fri, 16 Nov 2012 14:54:01 +0000 (16:54 +0200)
committerMarko Ollonen <marko.ollonen@ixonos.com>
Fri, 16 Nov 2012 15:27:41 +0000 (17:27 +0200)
Change-Id: I26241909292c29073e57784861a262f2b35b0c2a

gst-libs/atomisphal/gstv4l2mfldadvci.c
gst-libs/atomisphal/mfld_cam.c
gst-libs/atomisphal/mfld_driver.h
packaging/mfldv4l2camsrc.changes

index 5343ccf..9ad9744 100644 (file)
@@ -100,7 +100,6 @@ static void
 lib_3a_dis_calc_still (struct atomisp_dis_vector * vector, int frame_number)
 {
   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
-  void (*dis_calc_still)(vector,frame_number);
   return;
 }
 
@@ -108,7 +107,6 @@ static void
 lib_3a_do_redeye_removal (ia_frame *ia_frame)
 {
   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
-  ia_redeye_correct(ia_frame);
 }
 
 static void
@@ -118,7 +116,6 @@ lib_3a_still_compose (ia_frame *com_buf,
                      struct atomisp_dis_vector vectors[])
 {
   cam_lib_3a_dbg("%s:%d\n", __func__, __LINE__);
-  ia_dis_still_compose(com_buf, bufs, frame_dis, vectors);
   return;
 }
 
index f1b3f65..72d25e2 100644 (file)
@@ -292,8 +292,6 @@ set_flash_mode (int fd, int mode)
     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); */
-      break;
     case CAM_LIGHT_FLASH_MODE_OFF:
       ret = cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_OFF);
       break;
@@ -601,9 +599,7 @@ cam_set_capture_mode (int fd, cam_capture_mode_t mode)
 {
   cam_err_t ret = CAM_ERR_NONE;
   cam_driver_dbg ("%s\n", __func__);
-  /* FIXME We need to switch the binary here ? */
   mfld_driver.first_frame = 1;
-  //return ret; /* Don't switch mode temppory for the MIPI issue */
 
   if (mfld_driver.sensor_type == SENSOR_TYPE_RAW){
     switch (mode) {
@@ -611,21 +607,18 @@ cam_set_capture_mode (int fd, cam_capture_mode_t mode)
         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;
         cam_driver_dbg ("%s: VIEWFINDER Mode is set\n", __func__);
         break;
       case CAM_CAPTURE_MODE_VIDEO_RECORD:
         mfldadvci->switch_mode (ia_3a_isp_mode_video, mfld_driver.frame_rate);
         if (mfld_driver.ae_enabled)
-          //ci_adv_set_3a_mode(ia_3a_isp_mode_video, &mfld_driver.sensor_config);
           mfld_driver.first_frame = 1;
         cam_driver_dbg ("%s: VIDEO Mode is set\n", __func__);
         break;
       case CAM_CAPTURE_MODE_STILL_CAPTURE:
         mfldadvci->switch_mode (ia_3a_isp_mode_capture, mfld_driver.frame_rate);
         if (mfld_driver.ae_enabled)
-          //ci_adv_set_3a_mode(ia_3a_isp_mode_capture, &mfld_driver.sensor_config);
           mfld_driver.first_frame = 1;
         cam_driver_dbg ("%s: STILL Mode is set\n", __func__);
         break;
@@ -1512,26 +1505,27 @@ cam_capture_init (int fd, struct v4l2_buffer *buffer,
   }
 }
 
-static int
+static bool
 get_flash_status(void)
 {
   int cur_flash_mode = CAM_LIGHT_FLASH_MODE_OFF;
-  int flash_en = 0;
+  bool flash_en = FALSE;
 
   get_flash_mode(&cur_flash_mode);
 
   switch (cur_flash_mode) {
     case CAM_LIGHT_FLASH_MODE_ON:
-       flash_en = 1;
+       flash_en = TRUE;
        break;
     case CAM_LIGHT_FLASH_MODE_AUTO:
-       /* TODO: flash-on depends on current image illuminance */
+    case CAM_LIGHT_FLASH_MODE_RED_EYE:
+       mfldadvci->ae_is_flash_needed(&flash_en);
+
        break;
     default:
        /* other mode, turn flash off */
        ;
   }
-
   return flash_en;
 }
 
@@ -1639,26 +1633,19 @@ cam_capture_frames (int fd, struct v4l2_buffer *buffer,
   int index;
   int frame_dis = 1, frame_cnt;
   cam_err_t ret  = 0;
-  bool use_flash = TRUE;
-  int cur_flash_mode;
-  int flash_en = 0;
+  bool flash_en = FALSE;
 
   cam_capture_init (fd, buffer, capture_settings);
 
   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)){
+      if (flash_en == TRUE) {
         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);
-        * */
+        //cam_driver_set_indication_intensity(fd, INDICATOR_INTENSITY);
+        //cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_INDICATOR);
         ret = run_normal_sequence(fd, buffer);
         /* restore flash mode */
         cam_driver_set_flash_mode(fd,ATOMISP_FLASH_MODE_OFF);
index 1d3de38..1e261b0 100644 (file)
@@ -25,7 +25,7 @@
 #define ON 1
 #define OFF 0
 
-#define INDICATOR_INTENSITY 20 /* 20% */
+#define INDICATOR_INTENSITY 10 /* 10% */
 
 void cam_err_print (cam_err_t err);
 
index 34dcbd1..97015bb 100644 (file)
@@ -1,3 +1,6 @@
+* Fri Nov 16 2012 Marko Ollonen <marko.ollonen@ixonos.com> accepted/trunk/20121112.215039@fe4db92
+- fix flash and clean up
+
 * Fri Nov 16 2012 Marko Ollonen <marko.ollonen@ixonos.com> accepted/trunk/20121112.215039@3e4a4f2
 - flash need request to 3A lib used in auto flash mode