aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-11-11 20:40:29 +0100
committerSylvain Munaut <tnt@246tNt.com>2010-11-11 20:45:24 +0100
commit3c0a4fba8af4bee5c4f05f00f3da33c6a006d928 (patch)
treeb85bdd1d738897196ce598d8f71d9b68aa47c20a /include
parent8552b9dc0cfcead7cfda847cfe63d4bb4d369e16 (diff)
procqueue: Add some mechanism to queue 'processing items' on the frames
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'include')
-rw-r--r--include/gapk/procqueue.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/include/gapk/procqueue.h b/include/gapk/procqueue.h
new file mode 100644
index 0000000..59f567e
--- /dev/null
+++ b/include/gapk/procqueue.h
@@ -0,0 +1,43 @@
+/* Processing Queue Management */
+
+/*
+ * This file is part of gapk (GSM Audio Pocket Knife).
+ *
+ * gapk is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * gapk is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with gapk. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GAPK_PROCQUEUE_H__
+#define __GAPK_PROCQUEUE_H__
+
+#include <stdint.h>
+#include <stdio.h> /* for FILE */
+
+struct pq;
+
+struct pq_item {
+ int len_in;
+ int len_out;
+ void *state;
+ int (*proc)(void *state, uint8_t *out, const uint8_t *in);
+ void (*exit)(void *state);
+};
+
+/* Management */
+struct pq * pq_create(void);
+void pq_destroy(struct pq *pq);
+struct pq_item * pq_add_item(struct pq *pq);
+int pq_prepare(struct pq *pq);
+int pq_execute(struct pq *pq);
+
+#endif /* __GAPK_PROCQUEUE_H__ */