diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-16 15:48:30 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-05-01 12:13:56 +0200 |
commit | f030d07589524d07d5eaf7c2dfff607656889b8b (patch) | |
tree | be57ed8735b8ffbc6fb9cd7ca461f037c1e61978 /live.c | |
parent | b0e966a8488e19fcc1c7eb86a217c5f7675a4da0 (diff) |
iq: Make the IQ parameters configurable
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'live.c')
-rw-r--r-- | live.c | 26 |
1 files changed, 25 insertions, 1 deletions
@@ -325,9 +325,21 @@ static void usage(const char *argv0) printf("-b, --buffers n Use n display buffers\n"); printf("-h, --help Show this help screen\n"); printf("-s, --skip n Skip display of n frames out of n+1\n"); + printf(" --aewb param=value Set AEWB algorithm parameter 'param' to 'value'\n"); + printf("\nSupported AEWB parameters are:\n"); + printf("- exposure-def Exposure time default value\n"); + printf("- exposure-min Exposure time minimum value\n"); + printf("- exposure-max Exposure time maximum value\n"); + printf("- gain-def Sensor gain default value\n"); + printf("- gain-min Sensor gain minimum value\n"); + printf("- gain-max Sensor gain maximum value\n"); + printf("- mean-level Mean luminance target level (float [0-1])\n"); } +#define OPT_AEWB_PARAM 256 + static struct option opts[] = { + { "aewb", 1, 0, OPT_AEWB_PARAM }, { "help", 0, 0, 'h' }, { "skip", 1, 0, 's' }, { 0, 0, 0, 0 } @@ -339,6 +351,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu struct v4l2_buffers_pool *pool = NULL; struct v4l2_pix_format format; struct timespec start, end; + struct iq_params iq_params; unsigned int buffers = 3; struct v4l2_rect rect; int exit_code = EXIT_FAILURE; @@ -347,6 +360,8 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu int ret; int c; + iq_params_init(&iq_params); + while ((c = getopt_long(argc, argv, "b:hs:", opts, NULL)) != -1) { switch (c) { case 'b': @@ -358,6 +373,15 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu case 's': frame_skip = atoi(optarg); break; + case OPT_AEWB_PARAM: + ret = iq_params_parse(&iq_params, optarg); + if (ret < 0) { + printf("%s AEWB argument %s.\n", + ret == -ERANGE ? "out-of-range" : "invalid", + optarg); + return 1; + } + break; default: printf("Invalid option -%c\n", c); printf("Run %s -h for help.\n", argv[0]); @@ -401,7 +425,7 @@ 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); + iq = iq_init(isp, &iq_params); if (iq == NULL) { printf("error: unable to initialize image quality tuning\n"); goto cleanup; |