diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | snapshot.c | 22 |
2 files changed, 23 insertions, 1 deletions
@@ -7,7 +7,7 @@ LDFLAGS := -Lisp LIBS := -lomap3isp -lrt OBJ_LIVE := live.o events.o iq.o videoout.o -OBJ_SNAP := snapshot.o events.o +OBJ_SNAP := snapshot.o events.o iq.o %.o : %.c $(CC) $(CFLAGS) -c -o $@ $< @@ -49,6 +49,7 @@ #include "isp/v4l2-pool.h" #include "events.h" +#include "iq.h" #define MEDIA_DEVICE "/dev/media0" @@ -95,9 +96,21 @@ static struct snapshot snap = { .skip = 2, }; +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 */ @@ -493,6 +506,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu ops.snapshot_ready = snapshot_process; ops.watch_fd = __events_watch_fd; ops.unwatch_fd = __events_unwatch_fd; + ops.aewb_ready = __iq_aewb_process; isp = omap3_isp_open(MEDIA_DEVICE, &ops); if (isp == NULL) { @@ -510,6 +524,12 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu if (ret < 0) goto cleanup; + iq = iq_init(isp); + if (iq == NULL) { + printf("error: unable to initialize image quality tuning\n"); + goto cleanup; + } + /* Start the viewfinder if needed. */ if (vf.enabled) { ret = omap3_isp_viewfinder_start(isp); @@ -560,6 +580,8 @@ cleanup: omap3_isp_close(isp); if (vf.enabled) viewfinder_cleanup(isp); + if (iq) + iq_cleanup(iq); return exit_code; } |