summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-08-11 09:28:09 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-08-11 10:51:10 +0200
commita753dba7ed68896912f291f7ca01edb85a66db75 (patch)
treefc4e03efbbcfde0c876df896513cdfd387d22ef6 /options.c
parent74004e698ba7479d2cab0ecb5c2259d44072f6e0 (diff)
Add a --get-format option
The option takes a pad name as argument and returns the active format (and optional crop settings if available) for that pad. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'options.c')
-rw-r--r--options.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/options.c b/options.c
index 6fd2daf..f4a551b 100644
--- a/options.c
+++ b/options.c
@@ -35,7 +35,8 @@ static void usage(const char *argv0, int verbose)
printf("%s [options] device\n", argv0);
printf("-d, --device dev Media device name (default: %s)\n", MEDIA_DEVNAME_DEFAULT);
printf("-e, --entity name Print the device name associated with the given entity\n");
- printf("-f, --formats Comma-separated list of formats to setup\n");
+ printf("-f, --set-format Comma-separated list of formats to setup\n");
+ printf(" --get-format pad Print the active format on a given pad\n");
printf("-h, --help Show verbose help and exit\n");
printf("-i, --interactive Modify links interactively\n");
printf("-l, --links Comma-separated list of links descriptors to setup\n");
@@ -68,12 +69,14 @@ static void usage(const char *argv0, int verbose)
printf("\tdenominator Frame interval denominator\n");
}
-#define OPT_PRINT_DOT 256
+#define OPT_PRINT_DOT 256
+#define OPT_GET_FORMAT 257
static struct option opts[] = {
{"device", 1, 0, 'd'},
{"entity", 1, 0, 'e'},
- {"formats", 1, 0, 'f'},
+ {"set-format", 1, 0, 'f'},
+ {"get-format", 1, 0, OPT_GET_FORMAT},
{"help", 0, 0, 'h'},
{"interactive", 0, 0, 'i'},
{"links", 1, 0, 'l'},
@@ -136,6 +139,10 @@ int parse_cmdline(int argc, char **argv)
media_opts.print_dot = 1;
break;
+ case OPT_GET_FORMAT:
+ media_opts.pad = optarg;
+ break;
+
default:
printf("Invalid option -%c\n", opt);
printf("Run %s -h for help.\n", argv[0]);