From f15d21389a81f8df36b00113aed5c81d27143861 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Fri, 14 Feb 2014 14:28:59 +0100 Subject: Use read-write ring buffer --- bin/tools/grab.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'bin/tools') 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; -- cgit v1.2.3