From 2eeefe2db3bb9f2e54cc00e7aa657f599c2115ea Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 27 Jan 2020 05:27:25 +0100 Subject: Add metadata about buffer plane and sequential number. Provide filter to allow trough only the buffers acquired at the specified detector plane --- src/ufo-roof-buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ufo-roof-buffer.c') 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; } -- cgit v1.2.3