summaryrefslogtreecommitdiffstats
path: root/test/grab.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-20 13:45:10 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@gmail.com>2012-06-20 13:58:03 +0200
commitfc49419b57283919654680d4ee2bc0b4a4537e3e (patch)
tree0a1d7c0a164152b33f7e0277b4347a362fc547fb /test/grab.c
parent4d07f8c3e9a99242bfbd373722731025235d1968 (diff)
downloaduca-fc49419b57283919654680d4ee2bc0b4a4537e3e.tar.gz
uca-fc49419b57283919654680d4ee2bc0b4a4537e3e.tar.bz2
uca-fc49419b57283919654680d4ee2bc0b4a4537e3e.tar.xz
uca-fc49419b57283919654680d4ee2bc0b4a4537e3e.zip
Re-implement asynchronous data acquisition
Diffstat (limited to 'test/grab.c')
-rw-r--r--test/grab.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/test/grab.c b/test/grab.c
index 2a9d9ea..c4b3f3c 100644
--- a/test/grab.c
+++ b/test/grab.c
@@ -21,12 +21,9 @@
#include <stdlib.h>
#include "uca-camera.h"
-#define handle_error(errno) {if ((errno) != UCA_NO_ERROR) printf("error at <%s:%i>\n", \
- __FILE__, __LINE__);}
-
static UcaCamera *camera = NULL;
-void sigint_handler(int signal)
+static void sigint_handler(int signal)
{
printf("Closing down libuca\n");
uca_camera_stop_recording(camera, NULL);
@@ -41,6 +38,7 @@ int main(int argc, char *argv[])
guint sensor_width, sensor_height, sensor_width_extended, sensor_height_extended;
guint roi_width, roi_height, roi_x, roi_y;
guint bits, sensor_rate;
+ gchar *name;
g_type_init();
camera = uca_camera_new("pco", &error);
@@ -55,6 +53,7 @@ int main(int argc, char *argv[])
"sensor-height", &sensor_height,
"sensor-width-extended", &sensor_width_extended,
"sensor-height-extended", &sensor_height_extended,
+ "name", &name,
NULL);
g_object_set(G_OBJECT(camera),
@@ -76,6 +75,9 @@ int main(int argc, char *argv[])
"sensor-pixelrate", &sensor_rate,
NULL);
+ g_print("Camera: %s\n", name);
+ g_free(name);
+
g_print("Sensor: %ix%i px (extended: %ix%i), ROI %ix%i @ (%i, %i) and %i Hz\n",
sensor_width, sensor_height,
sensor_width_extended, sensor_height_extended,