summaryrefslogtreecommitdiffstats
path: root/test/test-ring-buffer.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-13 14:54:34 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2014-02-14 16:17:16 +0100
commit961e60a89bc60e760707892539ccd7c6d283ef01 (patch)
tree6e002e95258e4e736c58f5187ff93cf83579541b /test/test-ring-buffer.c
parentf15d21389a81f8df36b00113aed5c81d27143861 (diff)
downloadlibuca-961e60a89bc60e760707892539ccd7c6d283ef01.tar.gz
libuca-961e60a89bc60e760707892539ccd7c6d283ef01.tar.bz2
libuca-961e60a89bc60e760707892539ccd7c6d283ef01.tar.xz
libuca-961e60a89bc60e760707892539ccd7c6d283ef01.zip
Fix #28: Add buffered recording to base class
This change adds new properties ::buffered and ::num-buffers to the base class. If ::buffered is TRUE, uca_camera_start_recording will spawn a new thread which will call the camera-specific grab. Any call to uca_camera_grab will return the next item from the ring buffer.
Diffstat (limited to 'test/test-ring-buffer.c')
-rw-r--r--test/test-ring-buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test-ring-buffer.c b/test/test-ring-buffer.c
index 02bf1eb..b9ff210 100644
--- a/test/test-ring-buffer.c
+++ b/test/test-ring-buffer.c
@@ -43,12 +43,14 @@ test_ring (void)
data = uca_ring_buffer_get_write_pointer (buffer);
data[0] = 0xBADF00D;
+ uca_ring_buffer_write_advance (buffer);
g_assert (uca_ring_buffer_available (buffer));
g_assert (uca_ring_buffer_get_num_blocks (buffer) == 1);
data = uca_ring_buffer_get_write_pointer (buffer);
data[0] = 0xDEADBEEF;
+ uca_ring_buffer_write_advance (buffer);
g_assert (uca_ring_buffer_get_num_blocks (buffer) == 2);
@@ -74,9 +76,11 @@ test_overwrite (void)
data = uca_ring_buffer_get_write_pointer (buffer);
data[0] = 0xBADF00D;
+ uca_ring_buffer_write_advance (buffer);
data = uca_ring_buffer_get_write_pointer (buffer);
data[0] = 0xDEADBEEF;
+ uca_ring_buffer_write_advance (buffer);
data = uca_ring_buffer_get_read_pointer (buffer);
g_assert (data[0] == 0xDEADBEEF);