summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-02-22 23:57:55 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-05-01 12:13:56 +0200
commit0634f8bb2e63985ebf2103318105b7185294da94 (patch)
tree4c26351d03c4711919f22aed00c99e5c7dc49769
parent4390a8d2da94149db685da2daa22d8ed6e41d02e (diff)
live: Use AEWB algorithm
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--Makefile2
-rw-r--r--live.c22
2 files changed, 23 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cb7d846..e4de38d 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ CFLAGS := -O2 -W -Wall -I$(KDIR)/usr/include
LDFLAGS := -Lisp
LIBS := -lomap3isp -lrt
-OBJ_LIVE := live.o events.o videoout.o
+OBJ_LIVE := live.o events.o iq.o videoout.o
OBJ_SNAP := snapshot.o events.o
%.o : %.c
diff --git a/live.c b/live.c
index c4d5ffd..0144372 100644
--- a/live.c
+++ b/live.c
@@ -46,11 +46,13 @@
#include "isp/list.h"
#include "isp/omap3isp.h"
+#include "isp/stats.h"
#include "isp/tools.h"
#include "isp/v4l2.h"
#include "isp/v4l2-pool.h"
#include "events.h"
+#include "iq.h"
#include "videoout.h"
#define MEDIA_DEVICE "/dev/media0"
@@ -65,10 +67,21 @@ static unsigned int frame_skip = 0;
static struct omap3_isp_device *isp = NULL;
static struct videoout *vo = NULL;
+static struct iq_tuning *iq = NULL;
static struct events events;
/* -----------------------------------------------------------------------------
+ * Image quality
+ */
+
+static void __iq_aewb_process(struct omap3_isp_device *isp __attribute__((__unused__)),
+ const struct omap3_isp_aewb_stats *stats)
+{
+ iq_aewb_process(iq, stats);
+}
+
+/* -----------------------------------------------------------------------------
* Events
*/
@@ -135,6 +148,7 @@ static struct omap3_isp_operations isp_ops = {
.viewfinder_ready = viewfinder_process,
.watch_fd = __events_watch_fd,
.unwatch_fd = __events_unwatch_fd,
+ .aewb_ready = __iq_aewb_process,
};
/* -----------------------------------------------------------------------------
@@ -387,6 +401,12 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu
printf("viewfinder configured for %04x %ux%u\n",
view_format.code, view_format.width, view_format.height);
+ iq = iq_init(isp);
+ if (iq == NULL) {
+ printf("error: unable to initialize image quality tuning\n");
+ goto cleanup;
+ }
+
/* Initialize video output. */
vo_devname = video_out_find();
if (vo_devname == NULL) {
@@ -456,6 +476,8 @@ cleanup:
omap3_isp_close(isp);
if (vo)
vo_cleanup(vo);
+ if (iq)
+ iq_cleanup(iq);
return exit_code;
}