summaryrefslogtreecommitdiffstats
path: root/src/ufo-roof-buffer.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2020-01-27 05:27:25 +0100
committerSuren A. Chilingaryan <csa@suren.me>2020-01-27 05:27:25 +0100
commit2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea (patch)
tree09cb20c623cc8ecdfbf0b526629afcb60aa15f30 /src/ufo-roof-buffer.c
parentea424f096c05a9587ffaa0bc6e5392790a046bd7 (diff)
downloadufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.gz
ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.bz2
ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.tar.xz
ufo-roof-2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea.zip
Add metadata about buffer plane and sequential number. Provide filter to allow trough only the buffers acquired at the specified detector plane
Diffstat (limited to 'src/ufo-roof-buffer.c')
-rw-r--r--src/ufo-roof-buffer.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ufo-roof-buffer.c b/src/ufo-roof-buffer.c
index bac940c..32598c9 100644
--- a/src/ufo-roof-buffer.c
+++ b/src/ufo-roof-buffer.c
@@ -139,7 +139,7 @@ gboolean ufo_roof_buffer_set_fragment(UfoRoofBuffer *buffer, guint stream_id, gu
-gboolean ufo_roof_buffer_get_dataset(UfoRoofBuffer *buffer, gpointer output_buffer, GError **error) {
+gboolean ufo_roof_buffer_get_dataset(UfoRoofBuffer *buffer, gpointer output_buffer, gulong *seqid, GError **error) {
guint buffer_id = buffer->current_id % buffer->ring_size;
void *dataset_buffer = buffer->ring_buffer + buffer_id * buffer->dataset_size;
@@ -147,9 +147,10 @@ gboolean ufo_roof_buffer_get_dataset(UfoRoofBuffer *buffer, gpointer output_buff
if (buffer->n_fragments[buffer_id] < buffer->fragments_per_dataset) return FALSE;
memcpy(output_buffer, dataset_buffer, buffer->dataset_size);
+ if (seqid) *seqid = buffer->current_id;
buffer->n_fragments[buffer_id] = 0;
buffer->current_id += 1;
- return TRUE;
+ return TRUE;
}