]> code.delx.au - pulseaudio/blobdiff - src/pulsecore/asyncq.h
resampler: Introduce work_channels
[pulseaudio] / src / pulsecore / asyncq.h
index aac45b1d16be3c1d416485d535af44fc57f632e5..026379f86fe30ac71ecb3215371ca59d2393dcc6 100644 (file)
@@ -1,8 +1,6 @@
 #ifndef foopulseasyncqhfoo
 #define foopulseasyncqhfoo
 
-/* $Id$ */
-
 /***
   This file is part of PulseAudio.
 
@@ -26,6 +24,7 @@
 
 #include <sys/types.h>
 #include <pulse/def.h>
+#include <pulsecore/macro.h>
 
 /* A simple, asynchronous, lock-free (if requested also wait-free)
  * queue. Not multiple-reader/multiple-writer safe. If that is
 
 typedef struct pa_asyncq pa_asyncq;
 
-pa_asyncq* pa_asyncq_new(size_t size);
+pa_asyncq* pa_asyncq_new(unsigned size);
 void pa_asyncq_free(pa_asyncq* q, pa_free_cb_t free_cb);
 
-void* pa_asyncq_pop(pa_asyncq *q, int wait);
-int pa_asyncq_push(pa_asyncq *q, void *p, int wait);
+void* pa_asyncq_pop(pa_asyncq *q, bool wait);
+int pa_asyncq_push(pa_asyncq *q, void *p, bool wait);
+
+/* Similar to pa_asyncq_push(), but if the queue is full, postpone the
+ * appending of the item locally and delay until
+ * pa_asyncq_before_poll_post() is called. */
+void pa_asyncq_post(pa_asyncq*l, void *p);
+
+/* For the reading side */
+int pa_asyncq_read_fd(pa_asyncq *q);
+int pa_asyncq_read_before_poll(pa_asyncq *a);
+void pa_asyncq_read_after_poll(pa_asyncq *a);
 
-int pa_asyncq_get_fd(pa_asyncq *q);
-int pa_asyncq_before_poll(pa_asyncq *a);
-int pa_asyncq_after_poll(pa_asyncq *a);
+/* For the writing side */
+int pa_asyncq_write_fd(pa_asyncq *q);
+void pa_asyncq_write_before_poll(pa_asyncq *a);
+void pa_asyncq_write_after_poll(pa_asyncq *a);
 
 #endif