From a30cc5c930ed2dd3fdf386eb97ee9cf40a105aa5 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Wed, 21 Oct 2015 08:51:14 +0200 Subject: Use prop parsing in grab and benchmark --- bin/tools/grab.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bin/tools/grab.c') diff --git a/bin/tools/grab.c b/bin/tools/grab.c index c6a0d71..e3dea42 100644 --- a/bin/tools/grab.c +++ b/bin/tools/grab.c @@ -33,7 +33,6 @@ typedef struct { gint n_frames; gdouble duration; - gdouble exposure_time; gchar *filename; #ifdef HAVE_LIBTIFF gboolean write_tiff; @@ -220,7 +219,6 @@ main (int argc, char *argv[]) static Options opts = { .n_frames = -1, .duration = -1.0, - .exposure_time = 0.001, .filename = NULL, #ifdef HAVE_LIBTIFF .write_tiff = FALSE, @@ -230,7 +228,6 @@ main (int argc, char *argv[]) static GOptionEntry entries[] = { { "num-frames", 'n', 0, G_OPTION_ARG_INT, &opts.n_frames, "Number of frames to acquire", "N" }, { "duration", 'd', 0, G_OPTION_ARG_DOUBLE, &opts.duration, "Duration in seconds", NULL }, - { "exposure-time", 'e', 0, G_OPTION_ARG_DOUBLE, &opts.exposure_time, "Exposure time in seconds", NULL }, { "output", 'o', 0, G_OPTION_ARG_STRING, &opts.filename, "Output file name", "FILE" }, #ifdef HAVE_LIBTIFF { "write-tiff", 't', 0, G_OPTION_ARG_NONE, &opts.write_tiff, "Write as TIFF", NULL }, @@ -261,14 +258,18 @@ main (int argc, char *argv[]) goto cleanup_manager; } - camera = uca_plugin_manager_get_camera (manager, argv[1], &error, NULL); + camera = uca_plugin_manager_get_camera (manager, argv[argc - 1], &error, NULL); if (camera == NULL) { g_print ("Error during initialization: %s\n", error->message); goto cleanup_camera; } - g_object_set (camera, "exposure-time", opts.exposure_time, NULL); + if (!uca_camera_parse_arg_props (camera, argv, argc - 1, &error)) { + g_print ("Error setting properties: %s\n", error->message); + goto cleanup_manager; + } + error = record_frames (camera, &opts); if (error != NULL) -- cgit v1.2.3