aboutsummaryrefslogtreecommitdiffstats
path: root/include/gapk/formats.h
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2010-10-29 11:38:54 +0200
committerSylvain Munaut <tnt@246tNt.com>2010-11-05 16:41:47 +0100
commit0f7e52dbb51a966742b820ff606eeb76163fd8e8 (patch)
tree20493b99017b985537e9938f9323836f9ed7209e /include/gapk/formats.h
parent553b3b6002985b2614c97715e99e45310862b4aa (diff)
format: Add initial format framework
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'include/gapk/formats.h')
-rw-r--r--include/gapk/formats.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/include/gapk/formats.h b/include/gapk/formats.h
new file mode 100644
index 0000000..d98baca
--- /dev/null
+++ b/include/gapk/formats.h
@@ -0,0 +1,48 @@
+/* Formats handling */
+
+/*
+ * 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_FORMATS_H__
+#define __GAPK_FORMATS_H__
+
+#include <stdint.h>
+
+enum format_type {
+ FMT_INVALID = 0,
+
+ _FMT_MAX,
+};
+
+#include <gapk/codecs.h> /* need to import here because or enum interdep */
+
+typedef int (*fmt_conv_cb_t)(uint8_t *dst, const uint8_t *src);
+
+struct format_desc {
+ enum format_type type;
+ enum codec_type codec_type;
+ const char * name;
+ const char * description;
+
+ unsigned int frame_len;
+ fmt_conv_cb_t conv_from_canon;
+ fmt_conv_cb_t conv_to_canon;
+};
+
+const struct format_desc *fmt_get_from_type(enum format_type type);
+
+#endif /* __GAPK_FORMATS_H__ */