summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 16:08:50 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-02-03 16:08:50 +0100
commitb66531ac0b9d78a4540920922b0aad02a99b7a24 (patch)
tree9f691b0972158cee2b808a00081ed63a833dadfe /test
parent3994e7e9e476bc575b14a1b1705f1cfa65e1ae6c (diff)
downloadlibuca-b66531ac0b9d78a4540920922b0aad02a99b7a24.tar.gz
libuca-b66531ac0b9d78a4540920922b0aad02a99b7a24.tar.bz2
libuca-b66531ac0b9d78a4540920922b0aad02a99b7a24.tar.xz
libuca-b66531ac0b9d78a4540920922b0aad02a99b7a24.zip
Fix up callback
Diffstat (limited to 'test')
-rw-r--r--test/grab-async.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/grab-async.c b/test/grab-async.c
index 35ae5a4..7ce8b01 100644
--- a/test/grab-async.c
+++ b/test/grab-async.c
@@ -32,10 +32,10 @@ enum uca_buffer_status grab_callback(uint64_t image_number, void *buffer, void *
const int pixel_size = props->bits == 8 ? 1 : 2;
char filename[256];
- sprintf(filename, "out-%04i.raw", (int) image_number);
- FILE *fp = fopen(filename, "wb");
- fwrite(buffer, props->width * props->height, pixel_size, fp);
- fclose(fp);
+ /* sprintf(filename, "out-%04i.raw", (int) image_number); */
+ /* FILE *fp = fopen(filename, "wb"); */
+ /* fwrite(buffer, props->width * props->height, pixel_size, fp); */
+ /* fclose(fp); */
printf("grabbed picture %i at %p (%ix%i @ %i bits)\n",
(int) image_number, buffer,
@@ -65,10 +65,11 @@ int main(int argc, char *argv[])
uca_cam_get_property(cam, UCA_PROP_HEIGHT, &props.height, 0);
uca_cam_get_property(cam, UCA_PROP_BITDEPTH, &props.bits, 0);
+ printf("width=%i, height=%i, bits=%i\n", props.width, props.height, props.bits);
uca_cam_alloc(cam, 10);
- uca_cam_register_callback(cam, &grab_callback, &props);
uca_cam_start_recording(cam);
+ uca_cam_register_callback(cam, &grab_callback, &props);
printf("grabbing for 1 second ... ");
fflush(stdout);
sleep(1);