summaryrefslogtreecommitdiffstats
path: root/src/bufferq.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-10-01 20:16:28 +0000
committerLennart Poettering <lennart@poettering.net>2007-10-01 20:16:28 +0000
commit7d83e5c7816b5e343695a75ba58b32dbe1be969a (patch)
treebfd1dfc9b7c8f4a2aaf66c1b30e78355dee8c88a /src/bufferq.h
parent762196328ab7e60f1d2908fd5a337d2ca99726dd (diff)
move all sources down to a seperate src/ tree
git-svn-id: file:///home/lennart/svn/public/libsydney/trunk@34 9ba3c220-e4d3-45a2-8aa3-73fcc9aff6ce
Diffstat (limited to 'src/bufferq.h')
-rw-r--r--src/bufferq.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/bufferq.h b/src/bufferq.h
new file mode 100644
index 0000000..2d53a45
--- /dev/null
+++ b/src/bufferq.h
@@ -0,0 +1,42 @@
+#ifndef foosydneybufferqhfoo
+#define foosydneybufferqhfoo
+
+#include <inttypes.h>
+
+#include "macro.h"
+#include "llist.h"
+#include "sydney.h"
+
+typedef enum sa_bufferq_item_type {
+ SA_BUFFERQ_ITEM_CONCATENATED,
+ SA_BUFFERQ_ITEM_DYNAMIC,
+ SA_BUFFERQ_ITEM_STATIC
+} sa_bufferq_item_type_t;
+
+typedef struct sa_bufferq_item {
+ void *data;
+ int64_t idx;
+ size_t size;
+ sa_bufferq_item_type_t type;
+ SA_LLIST_ITEM(struct sa_bufferq_item, bufferq);
+} sa_bufferq_item_t;
+
+typedef struct sa_bufferq {
+ SA_LLIST_HEAD(sa_bufferq_item_t, *items);
+ sa_bufferq_item_t **last;
+ int64_t read_index, write_index, end_index;
+ size_t sample_size;
+ unsigned nchannels;
+} sa_bufferq_t;
+
+int sa_bufferq_init(sa_bufferq_t *q, unsigned nchannels, size_t sample_size);
+
+void sa_bufferq_done(sa_bufferq_t *q);
+
+int sa_bufferq_push(sa_bufferq_t *q, unsigned channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence, sa_bufferq_item_type_t type);
+int sa_bufferq_realloc(sa_bufferq_t *q);
+
+void sa_bufferq_get(sa_bufferq_t *q, void *i[], size_t *bytes);
+void sa_bufferq_drop(sa_bufferq_t *q, int64_t bytes);
+
+#endif