Merge the patch to add the sem_wait in 3A loop. Signed-off-by: Hu Gang <gang.a.hu...
authorHu Gang <gang.a.hu@intel.com>
Thu, 17 Feb 2011 02:33:43 +0000 (10:33 +0800)
committerHu Gang <gang.a.hu@intel.com>
Wed, 16 Mar 2011 15:32:12 +0000 (23:32 +0800)
gst-libs/atomisphal/mfld_cam.c

index 43f61ff..4d9ef94 100644 (file)
 #include <string.h>
 #include <sys/ioctl.h>
 
+#include <unistd.h>
+
 #include "ci_adv_pub.h"
 #include "mfld_cam.h"
 #include "mfld_driver.h"
 #include <glib.h>
 #include <pthread.h>
 #include <errno.h>
+#include <semaphore.h>
+
+sem_t g_sem_3a;
 
 /* Focus Status Map */
 static const int ci_adv_focus_status_map[][2] =
@@ -1342,6 +1347,7 @@ static gpointer
 mfldcam_3a_process (gpointer data)
 {
   for (;;) {
+    sem_wait(&g_sem_3a);
     /* Read 3A statistics */
     if (mfld_driver.ae_enabled || mfld_driver.af_enabled
         || mfld_driver.awb_enabled || mfld_driver.dis_enabled
@@ -1599,6 +1605,7 @@ run_normal_sequence(int fd, struct v4l2_buffer *buffer)
       cam_driver_dbg ("%s: Error dqbuf %d\n", __func__, frame_cnt);
       return CAM_ERR_SYS;
     }
+    sem_post(&g_sem_3a);
 
     /* DIS and DVS processing */
     if (dis_enabled || mfld_driver.dvs_enabled)