summaryrefslogtreecommitdiffstats
path: root/bin/tools
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-14 14:28:59 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-14 14:34:47 +0100
commitf15d21389a81f8df36b00113aed5c81d27143861 (patch)
treec7a6247afd73254c202a8ccbb1e93bb43287b315 /bin/tools
parentdf1ae54168a7dda396050077f14fed33c4882c47 (diff)
downloaduca-f15d21389a81f8df36b00113aed5c81d27143861.tar.gz
uca-f15d21389a81f8df36b00113aed5c81d27143861.tar.bz2
uca-f15d21389a81f8df36b00113aed5c81d27143861.tar.xz
uca-f15d21389a81f8df36b00113aed5c81d27143861.zip
Use read-write ring buffer
Diffstat (limited to 'bin/tools')
-rw-r--r--bin/tools/grab.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/tools/grab.c b/bin/tools/grab.c
index 50c70a8..a3dd544 100644
--- a/bin/tools/grab.c
+++ b/bin/tools/grab.c
@@ -77,7 +77,7 @@ write_tiff (UcaRingBuffer *buffer,
gpointer data;
gsize offset = 0;
- data = uca_ring_buffer_get_pointer (buffer, i);
+ data = uca_ring_buffer_get_read_pointer (buffer);
TIFFSetField (tif, TIFFTAG_IMAGEWIDTH, width);
TIFFSetField (tif, TIFFTAG_IMAGELENGTH, height);
@@ -119,7 +119,7 @@ write_raw (UcaRingBuffer *buffer,
filename = g_strdup_printf ("frame-%08i.raw", i);
fp = fopen(filename, "wb");
- data = uca_ring_buffer_get_pointer (buffer, i);
+ data = uca_ring_buffer_get_read_pointer (buffer);
fwrite (data, size, 1, fp);
fclose (fp);
@@ -169,8 +169,7 @@ record_frames (UcaCamera *camera, Options *opts)
while (1) {
gdouble elapsed;
- uca_camera_grab (camera, uca_ring_buffer_get_current_pointer (buffer), &error);
- uca_ring_buffer_proceed (buffer);
+ uca_camera_grab (camera, uca_ring_buffer_get_write_pointer (buffer), &error);
if (error != NULL)
return error;