summaryrefslogtreecommitdiffstats
path: root/bufferq.h
diff options
context:
space:
mode:
Diffstat (limited to 'bufferq.h')
-rw-r--r--bufferq.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/bufferq.h b/bufferq.h
index a645398..538bf4d 100644
--- a/bufferq.h
+++ b/bufferq.h
@@ -7,14 +7,20 @@
#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;
-#define SA_BUFFERQ_ITEM_DATA(x) ((void*) (uint8_t*) (x) + ALIGN(sizeof(sa_bufferq_item_t)))
-
typedef struct sa_bufferq {
SA_LLIST_HEAD(sa_bufferq_item_t, *items);
sa_bufferq_item_t **last;
@@ -27,7 +33,8 @@ 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);
+int sa_bufferq_push(sa_bufferq_t *q, unsigned channel, const void *data, size_t nbytes, int64_t offset, sa_seek_t whence, int copy);
+int sa_bufferq_realloc(sa_bufferq_t *q);
int sa_bufferq_get(sa_bufferq_t *q, void *i[], size_t *bytes);
int sa_bufferq_drop(sa_bufferq_t *q, int64_t bytes);