[asterisk-commits] dvossel: branch dvossel/celt_codec_ftw r313097 - /team/dvossel/celt_codec_ftw...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 7 17:46:47 CDT 2011


Author: dvossel
Date: Thu Apr  7 17:46:43 2011
New Revision: 313097

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=313097
Log:
Beginnings of CELT translator

Added:
    team/dvossel/celt_codec_ftw/codecs/codec_celt.c   (with props)

Added: team/dvossel/celt_codec_ftw/codecs/codec_celt.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/celt_codec_ftw/codecs/codec_celt.c?view=auto&rev=313097
==============================================================================
--- team/dvossel/celt_codec_ftw/codecs/codec_celt.c (added)
+++ team/dvossel/celt_codec_ftw/codecs/codec_celt.c Thu Apr  7 17:46:43 2011
@@ -1,0 +1,109 @@
+/*
+ * Asterisk -- An open source telephony toolkit.
+ *
+ * Copyright (C) 2011, Digium, Inc.
+ *
+ * David Vossel <dvossel at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Translate between signed linear and CELT (Open Codec)
+ *
+ * \ingroup codecs
+ *
+ * \extref The CELT library - http://www.celt-codec.org
+ *
+ */
+
+#include "asterisk.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include <celt/celt.h>  /* TODO make build system aware of this header */
+
+#include "asterisk/translate.h"
+#include "asterisk/module.h"
+#include "asterisk/utils.h"
+
+#define OUTBUF_SIZE   8096
+
+static struct ast_translator *translators;
+static int trans_size;
+
+/* This is the list of signed linear formats we can
+ * translate CELT to and from in one step */
+static int id_list[] = {
+	AST_FORMAT_SLINEAR32,
+	AST_FORMAT_SLINEAR44,
+	AST_FORMAT_SLINEAR48,
+	AST_FORMAT_SLINEAR96,
+};
+
+static int resamp_new(struct ast_trans_pvt *pvt)
+{
+	int err;
+/*
+	TODO
+	if (!(pvt->pvt = alloc pvt stuff here)) {
+		return -1;
+	}
+*/
+	return 0;
+}
+
+static void resamp_destroy(struct ast_trans_pvt *pvt)
+{
+	/* TODO Destroy pvt stuff here */
+}
+
+
+static int resamp_framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
+{
+	/* TODO make awesome stuff happen here */
+}
+
+static int unload_module(void)
+{
+	int res = 0;
+	int idx;
+
+	for (idx = 0; idx < trans_size; idx++) {
+		res |= ast_unregister_translator(&translators[idx]);
+	}
+	ast_free(translators);
+
+	return res;
+}
+
+static int load_module(void)
+{
+	int res = 0;
+	int x, idx = 0;
+
+	trans_size = ARRAY_LEN(id_list) * 2
+	if (!(translators = ast_calloc(1, sizeof(struct ast_translator) * trans_size))) {
+		return AST_MODULE_LOAD_FAILURE;
+	}
+
+	for (x = 0; x < ARRAY_LEN(id_list); x++) {
+		/* TODO create translators and register them. */
+	}
+
+	return res;
+}
+
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "CELT Coder/Decoder",
+		.load = load_module,
+		.unload = unload_module,
+);

Propchange: team/dvossel/celt_codec_ftw/codecs/codec_celt.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: team/dvossel/celt_codec_ftw/codecs/codec_celt.c
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: team/dvossel/celt_codec_ftw/codecs/codec_celt.c
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list