summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-07-03 00:50:31 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-10-20 21:28:23 +0200
commit673222f6f296cf4b9785cd9a1f445f5790cd8e01 (patch)
treebed8e2e4b143fa62e5175b24ab36b76aa88a53fb
parent23b31323e49efd89d1ef40ceb9488579069929e6 (diff)
live, snapshot: Add option to disable AEWB
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-rw-r--r--live.c17
-rw-r--r--snapshot.c17
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. */