From 673222f6f296cf4b9785cd9a1f445f5790cd8e01 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 3 Jul 2012 00:50:31 +0200 Subject: live, snapshot: Add option to disable AEWB Signed-off-by: Laurent Pinchart --- live.c | 17 +++++++++++++---- snapshot.c | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/live.c b/live.c index 2c24e00..7fb4701 100644 --- a/live.c +++ b/live.c @@ -371,6 +371,7 @@ static void usage(const char *argv0) 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(" --disable-aewb Disable AEWB\n"); printf(" --saturation value Set the saturation value [0.0-2.0]\n"); printf("\nSupported AEWB parameters are:\n"); printf("- ae-delay Number of frames to skip at stream start before enabling AE\n"); @@ -390,9 +391,11 @@ static void usage(const char *argv0) #define OPT_AEWB_PARAM 256 #define OPT_SATURATION 257 +#define OPT_AEWB_DISABLE 258 static struct option opts[] = { { "aewb", 1, 0, OPT_AEWB_PARAM }, + { "disable-aewb", 0, 0, OPT_AEWB_DISABLE }, { "help", 0, 0, 'h' }, { "saturation", 1, 0, OPT_SATURATION }, { "skip", 1, 0, 's' }, @@ -411,6 +414,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu int exit_code = EXIT_FAILURE; const char *vo_devname; unsigned int colorkey; + bool enable_aewb = true; float fps; int ret; int c; @@ -428,6 +432,9 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu case 's': frame_skip = atoi(optarg); break; + case OPT_AEWB_DISABLE: + enable_aewb = false; + break; case OPT_AEWB_PARAM: ret = iq_params_parse(&iq_params, optarg); if (ret < 0) { @@ -485,10 +492,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, &iq_params); - if (iq == NULL) { - printf("error: unable to initialize image quality tuning\n"); - goto cleanup; + if (enable_aewb) { + iq = iq_init(isp, &iq_params); + if (iq == NULL) { + printf("error: unable to initialize image quality tuning\n"); + goto cleanup; + } } /* Initialize video output. */ diff --git a/snapshot.c b/snapshot.c index 8e45dfa..c8b0b27 100644 --- a/snapshot.c +++ b/snapshot.c @@ -438,6 +438,7 @@ static void usage(const char *argv0) printf("-s, --size wxh Set the snapshot capture size\n"); printf("-v, --view Enable viewfinder\n"); printf(" --aewb param=value Set AEWB algorithm parameter 'param' to 'value'\n"); + printf(" --disable-aewb Disable AEWB\n"); printf(" --saturation value Set the saturation value [0.0-2.0]\n"); printf("\nSupported AEWB parameters are:\n"); printf("- ae-delay Number of frames to skip at stream start before enabling AE\n"); @@ -457,10 +458,12 @@ static void usage(const char *argv0) #define OPT_AEWB_PARAM 256 #define OPT_SATURATION 257 +#define OPT_AEWB_DISABLE 258 static struct option opts[] = { { "aewb", 1, 0, OPT_AEWB_PARAM }, { "crop", 1, 0, 'c' }, + { "disable-aewb", 0, 0, OPT_AEWB_DISABLE }, { "format", 1, 0, 'f' }, { "help", 0, 0, 'h' }, { "interval", 1, 0, 'i' }, @@ -484,6 +487,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu struct timespec start, end; struct iq_params iq_params; int exit_code = EXIT_FAILURE; + bool enable_aewb = true; float fps; int ret; int c; @@ -559,6 +563,9 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu vf.enabled = true; snap.trigger = SNAPSHOT_TRIGGER_MANUAL; break; + case OPT_AEWB_DISABLE: + enable_aewb = false; + break; case OPT_AEWB_PARAM: ret = iq_params_parse(&iq_params, optarg); if (ret < 0) { @@ -610,10 +617,12 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu if (ret < 0) goto cleanup; - iq = iq_init(isp, &iq_params); - if (iq == NULL) { - printf("error: unable to initialize image quality tuning\n"); - goto cleanup; + if (enable_aewb) { + iq = iq_init(isp, &iq_params); + if (iq == NULL) { + printf("error: unable to initialize image quality tuning\n"); + goto cleanup; + } } /* Start the viewfinder if needed. */ -- cgit v1.2.3