diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-02-14 14:28:59 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2014-02-14 14:34:47 +0100 |
commit | f15d21389a81f8df36b00113aed5c81d27143861 (patch) | |
tree | c7a6247afd73254c202a8ccbb1e93bb43287b315 /bin/tools | |
parent | df1ae54168a7dda396050077f14fed33c4882c47 (diff) | |
download | uca-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.c | 7 |
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; |