summaryrefslogtreecommitdiff
path: root/codecs/ex_codec2.h
diff options
context:
space:
mode:
authorAlexander Traud <pabstraud@compuserve.com>2016-07-19 20:14:21 +0200
committerAlexander Traud <pabstraud@compuserve.com>2016-08-24 10:41:58 +0200
commit2e79f52d7116e5529ab78972cee8081b6ffe6878 (patch)
tree6f497fd8eb15a2d02fb24efd944e2bd383555a3e /codecs/ex_codec2.h
parent943bb48b59435e00131cbd56b075f73f57d10e87 (diff)
codecs: Add Codec 2 mode 2400.
ASTERISK-26217 #close Change-Id: I1e45d8084683fab5f2b272bf35f4a149cea8b8d6
Diffstat (limited to 'codecs/ex_codec2.h')
-rw-r--r--codecs/ex_codec2.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/codecs/ex_codec2.h b/codecs/ex_codec2.h
new file mode 100644
index 000000000..f2f4c9723
--- /dev/null
+++ b/codecs/ex_codec2.h
@@ -0,0 +1,32 @@
+/*! \file
+ * \brief 8-bit raw data
+ *
+ * Copyright (C) 2016, Alexander Traud
+ *
+ * Distributed under the terms of the GNU General Public License
+ *
+ */
+
+#include "asterisk/format_cache.h" /* for ast_format_codec2 */
+#include "asterisk/frame.h" /* for ast_frame, etc */
+
+static uint8_t ex_codec2[] = {
+ 0xea, 0xca, 0x14, 0x85, 0x91, 0x78,
+};
+
+static struct ast_frame *codec2_sample(void)
+{
+ static struct ast_frame f = {
+ .frametype = AST_FRAME_VOICE,
+ .datalen = sizeof(ex_codec2),
+ .samples = CODEC2_SAMPLES,
+ .mallocd = 0,
+ .offset = 0,
+ .src = __PRETTY_FUNCTION__,
+ .data.ptr = ex_codec2,
+ };
+
+ f.subclass.format = ast_format_codec2;
+
+ return &f;
+}