diff options
Diffstat (limited to 'live.c')
-rw-r--r-- | live.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -370,6 +370,7 @@ static void usage(const char *argv0) { printf("Usage: %s [options]\n", argv0); printf("Supported options:\n"); + 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"); } @@ -385,6 +386,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu struct v4l2_mbus_framefmt view_format; struct v4l2_buffers_pool *pool = NULL; struct timespec start, end; + unsigned int buffers = 3; struct v4l2_rect rect; int exit_code = EXIT_FAILURE; const char *vo_devname; @@ -392,8 +394,11 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu int ret; int c; - while ((c = getopt_long(argc, argv, "hs:", opts, NULL)) != -1) { + while ((c = getopt_long(argc, argv, "b:hs:", opts, NULL)) != -1) { switch (c) { + case 'b': + buffers = atoi(optarg); + break; case 'h': usage(argv[0]); return 0; @@ -450,7 +455,7 @@ int main(int argc __attribute__((__unused__)), char *argv[] __attribute__((__unu goto cleanup; } - vo = vo_init(vo_devname, &vo_ops, rect.width, rect.height); + vo = vo_init(vo_devname, &vo_ops, buffers, rect.width, rect.height); if (vo == NULL) { printf("error: unable to initialize video output\n"); goto cleanup; |