diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-02-22 23:57:55 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-01 12:13:56 +0200 |
commit | de8d5a0d80daba0b840a4f9714aee238966ab0a4 (patch) | |
tree | 9d3adc8fb18ec33b34965966f339649ede834766 /snapshot.c | |
parent | 0634f8bb2e63985ebf2103318105b7185294da94 (diff) |
snapshot: Use AEWB algorithm
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'snapshot.c')
-rw-r--r-- | snapshot.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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; } |