Bug fix for DVS. Signed-off-by: Hu Gang <gang.a.hu@intel.com>
authorHu Gang <gang.a.hu@intel.com>
Thu, 10 Feb 2011 06:02:42 +0000 (14:02 +0800)
committerHu Gang <gang.a.hu@intel.com>
Thu, 10 Feb 2011 06:03:22 +0000 (14:03 +0800)
gst-libs/atomisphal/mfld_cam.c

index 5a1a3b8..59ac312 100644 (file)
@@ -91,6 +91,7 @@ struct mfld_driver_t
   //GThread *thread;
   pthread_t thread;
   unsigned int width, height, fourcc;
+  ci_adv_dis_vector dvs_vector;
 };
 
 struct buffer
@@ -479,8 +480,10 @@ set_capture_correction (int fd, int mode)
 
   if (tmp_mode & (1 << CAM_CAPTURE_CORRECTION_DVS)) {
     if (mode & (1 << CAM_CAPTURE_CORRECTION_DVS)) {
+      mfld_driver.dvs_enabled = 1;
       ret = cam_driver_set_dvs (fd, ON);
     } else {
+      mfld_driver.dvs_enabled = 0;
       ret = cam_driver_set_dvs (fd, OFF);
     }
   }
@@ -1100,6 +1103,9 @@ libmfld_cam_init (GstV4l2MFLDAdvCI * advci)
   mfld_driver.mmap = 1;
   mfld_driver.g_3a_started = 0;
 
+  mfld_driver.dvs_vector.x = 0;
+  mfld_driver.dvs_vector.y = 0;
+
   mfldadvci = advci;
 
   /* Initalize the 3A library */
@@ -1471,11 +1477,16 @@ cam_capture_frames (int fd, struct v4l2_buffer *buffer,
 
     /* DIS and DVS processing */
     if (dis_enabled || mfld_driver.dvs_enabled) {
+      ci_adv_dis_vector *dvs_vector;
       cam_driver_dbg ("Begin cam_dis_get_statices\n");
       mfldadvci->dis_read_statistics ();        //read_dis_stats_from_xmem();
 
       cam_driver_dbg ("Begin cam_dis_still_process\n");
-      mfldadvci->dis_process (0);       /* dis_vector only valid in video mode */
+      if (mfld_driver.mode == CI_ISP_MODE_VIDEO)
+       dvs_vector = &mfld_driver.dvs_vector;
+      else
+       dvs_vector = NULL;
+      mfldadvci->dis_process (dvs_vector);       /* dis_vector only valid in video mode */
       if (dis_enabled) {
         mfldadvci->dis_calc_still (&vectors[frame_cnt], frame_cnt);
         cam_copy_v4l2buf_to_user (&bufs[frame_cnt], buffer);