summaryrefslogtreecommitdiffstats
path: root/test/grab.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-10-19 11:36:01 +0200
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2011-10-19 11:36:01 +0200
commitd18b6e21b82b4d64e1c0bf1b7526271ded38318e (patch)
treef66b0298f71cf41788ece3197e3438cec7eb3c58 /test/grab.c
parent7c9eb7f93e7f8a5c507d5986842b4dbe33f896e8 (diff)
downloadlibuca-d18b6e21b82b4d64e1c0bf1b7526271ded38318e.tar.gz
libuca-d18b6e21b82b4d64e1c0bf1b7526271ded38318e.tar.bz2
libuca-d18b6e21b82b4d64e1c0bf1b7526271ded38318e.tar.xz
libuca-d18b6e21b82b4d64e1c0bf1b7526271ded38318e.zip
Adapt libuca for pco.dimax
Diffstat (limited to 'test/grab.c')
-rw-r--r--test/grab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/grab.c b/test/grab.c
index f7a7548..76d3176 100644
--- a/test/grab.c
+++ b/test/grab.c
@@ -22,6 +22,8 @@ int main(int argc, char *argv[])
handle_error(uca_cam_set_property(cam, UCA_PROP_EXPOSURE, &val));
val = 0;
handle_error(uca_cam_set_property(cam, UCA_PROP_DELAY, &val));
+ val = UCA_TIMESTAMP_ASCII | UCA_TIMESTAMP_BINARY;
+ handle_error(uca_cam_set_property(cam, UCA_PROP_TIMESTAMP_MODE, &val));
uint32_t width, height, bits;
handle_error(uca_cam_get_property(cam, UCA_PROP_WIDTH, &width, 0));
@@ -39,8 +41,9 @@ int main(int argc, char *argv[])
char filename[FILENAME_MAX];
int counter = 0;
- while (error == UCA_NO_ERROR) {
+ while ((error == UCA_NO_ERROR) && (counter < 20)) {
error = uca_cam_grab(cam, (char *) buffer, NULL);
+ printf("error = 0x%x\n", error);
snprintf(filename, FILENAME_MAX, "frame-%08i.raw", counter++);
FILE *fp = fopen(filename, "wb");
fwrite(buffer, width*height, pixel_size, fp);