[asterisk-commits] branch group/new_loader_completion r22340 - in
/team/group/new_loader_complet...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Mon Apr 24 15:48:29 MST 2006
Author: kpfleming
Date: Mon Apr 24 17:48:29 2006
New Revision: 22340
URL: http://svn.digium.com/view/asterisk?rev=22340&view=rev
Log:
codec modules update
Modified:
team/group/new_loader_completion/Makefile
team/group/new_loader_completion/codecs/codec_a_mu.c
team/group/new_loader_completion/codecs/codec_adpcm.c
team/group/new_loader_completion/codecs/codec_alaw.c
team/group/new_loader_completion/codecs/codec_g726.c
team/group/new_loader_completion/codecs/codec_gsm.c
team/group/new_loader_completion/codecs/codec_ilbc.c
team/group/new_loader_completion/codecs/codec_lpc10.c
team/group/new_loader_completion/codecs/codec_speex.c
team/group/new_loader_completion/codecs/codec_ulaw.c
team/group/new_loader_completion/include/asterisk/translate.h
team/group/new_loader_completion/translate.c
Modified: team/group/new_loader_completion/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/Makefile?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/Makefile (original)
+++ team/group/new_loader_completion/Makefile Mon Apr 24 17:48:29 2006
@@ -57,7 +57,7 @@
#K6OPT = -DK6OPT
# Tell gcc to optimize the code
-OPTIMIZE+=-O6
+#OPTIMIZE+=-O6
else
# Stack backtraces, while useful for debugging, are incompatible with optimizations
ifeq (${OSARCH},Linux)
@@ -333,7 +333,7 @@
ASTCFLAGS+= -fomit-frame-pointer
endif
-MOD_SUBDIRS=res channels pbx apps codecs formats cdr funcs
+MOD_SUBDIRS=res channels pbx codecs formats cdr funcs apps
SUBDIRS:=$(MOD_SUBDIRS) utils stdtime agi
OBJS=io.o sched.o logger.o frame.o loader.o config.o channel.o \
Modified: team/group/new_loader_completion/codecs/codec_a_mu.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_a_mu.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_a_mu.c (original)
+++ team/group/new_loader_completion/codecs/codec_a_mu.c Mon Apr 24 17:48:29 2006
@@ -133,38 +133,32 @@
/*! \brief standard module glue */
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&ulawtoalaw);
res |= ast_unregister_translator(&alawtoulaw);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
int x;
+
for (x=0;x<256;x++) {
mu2a[x] = AST_LIN2A(AST_MULAW(x));
a2mu[x] = AST_LIN2MU(AST_ALAW(x));
}
- res = ast_register_translator(&alawtoulaw, mod);
+ res = ast_register_translator(&alawtoulaw);
if (!res)
- res = ast_register_translator(&ulawtoalaw, mod);
+ res = ast_register_translator(&ulawtoalaw);
else
ast_unregister_translator(&alawtoulaw);
+
return res;
}
-static const char *description(void)
-{
- return "A-law and Mulaw direct Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "A-law and Mulaw direct Coder/Decoder");
Modified: team/group/new_loader_completion/codecs/codec_adpcm.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_adpcm.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_adpcm.c (original)
+++ team/group/new_loader_completion/codecs/codec_adpcm.c Mon Apr 24 17:48:29 2006
@@ -368,40 +368,38 @@
}
/*! \brief standard module glue */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoadpcm);
res |= ast_unregister_translator(&adpcmtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&adpcmtolin, mod);
+ res = ast_register_translator(&adpcmtolin);
if (!res)
- res = ast_register_translator(&lintoadpcm, mod);
+ res = ast_register_translator(&lintoadpcm);
else
ast_unregister_translator(&adpcmtolin);
+
return res;
}
-static const char *description(void)
-{
- return "Adaptive Differential PCM Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "Adaptive Differential PCM Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_alaw.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_alaw.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_alaw.c (original)
+++ team/group/new_loader_completion/codecs/codec_alaw.c Mon Apr 24 17:48:29 2006
@@ -148,40 +148,38 @@
/*! \brief standard module stuff */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoalaw);
res |= ast_unregister_translator(&alawtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&alawtolin, mod);
+ res = ast_register_translator(&alawtolin);
if (!res)
- res = ast_register_translator(&lintoalaw, mod);
+ res = ast_register_translator(&lintoalaw);
else
ast_unregister_translator(&alawtolin);
+
return res;
}
-static const char *description(void)
-{
- return "A-law Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "A-law Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_g726.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_g726.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_g726.c (original)
+++ team/group/new_loader_completion/codecs/codec_g726.c Mon Apr 24 17:48:29 2006
@@ -819,39 +819,38 @@
/*! \brief standard module glue */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module (void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator (&lintog726);
res |= ast_unregister_translator (&g726tolin);
+
return res;
}
-static int load_module (void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator (&g726tolin, mod);
+ res = ast_register_translator (&g726tolin);
if (!res)
- res = ast_register_translator (&lintog726, mod);
+ res = ast_register_translator (&lintog726);
else
ast_unregister_translator (&g726tolin);
+
return res;
}
-static const char *description(void)
-{
- return "ITU G.726-32kbps G726 Transcoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "ITU G.726-32kbps G726 Transcoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_gsm.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_gsm.c (original)
+++ team/group/new_loader_completion/codecs/codec_gsm.c Mon Apr 24 17:48:29 2006
@@ -248,41 +248,39 @@
}
/*! \brief standard module glue */
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintogsm);
if (!res)
res = ast_unregister_translator(&gsmtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&gsmtolin, mod);
+ res = ast_register_translator(&gsmtolin);
if (!res)
- res=ast_register_translator(&lintogsm, mod);
+ res=ast_register_translator(&lintogsm);
else
ast_unregister_translator(&gsmtolin);
+
return res;
}
-static const char *description(void)
-{
- return "GSM/PCM16 (signed linear) Codec Translator";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "GSM Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_ilbc.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_ilbc.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_ilbc.c (original)
+++ team/group/new_loader_completion/codecs/codec_ilbc.c Mon Apr 24 17:48:29 2006
@@ -57,8 +57,6 @@
#define ILBC_FRAME_LEN 50 /* apparently... */
#define ILBC_SAMPLES 240 /* 30ms at 8000 hz */
#define BUFFER_SAMPLES 8000
-
-static char *tdesc = "iLBC/PCM16 (signed linear) Codec Translator";
struct ilbc_coder_pvt {
iLBC_Enc_Inst_t enc;
@@ -213,33 +211,27 @@
.buf_size = (BUFFER_SAMPLES * ILBC_FRAME_LEN + ILBC_SAMPLES - 1) / ILBC_SAMPLES,
};
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoilbc);
res |= ast_unregister_translator(&ilbctolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
- res = ast_register_translator(&ilbctolin, mod);
+
+ res = ast_register_translator(&ilbctolin);
if (!res)
- res=ast_register_translator(&lintoilbc, mod);
+ res=ast_register_translator(&lintoilbc);
else
ast_unregister_translator(&ilbctolin);
+
return res;
}
-static const char *description(void)
-{
- return tdesc;
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, NULL, NULL, NULL);
+AST_MODULE_INFO_STANDARD(ASTERISK_GPL_KEY, "iLBC Coder/Decoder");
Modified: team/group/new_loader_completion/codecs/codec_lpc10.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_lpc10.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_lpc10.c (original)
+++ team/group/new_loader_completion/codecs/codec_lpc10.c Mon Apr 24 17:48:29 2006
@@ -285,41 +285,40 @@
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintolpc10);
res |= ast_unregister_translator(&lpc10tolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res=ast_register_translator(&lpc10tolin, mod);
+ res=ast_register_translator(&lpc10tolin);
if (!res)
- res=ast_register_translator(&lintolpc10, mod);
+ res=ast_register_translator(&lintolpc10);
else
ast_unregister_translator(&lpc10tolin);
+
return res;
}
-static const char *description(void)
-{
- return "LPC10 2.4kbps (signed linear) Voice Coder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "LPC10 2.4kbps Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_speex.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_speex.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_speex.c (original)
+++ team/group/new_loader_completion/codecs/codec_speex.c Mon Apr 24 17:48:29 2006
@@ -478,49 +478,39 @@
ast_config_destroy(cfg);
}
-static int reload(void *mod)
-{
- /*
- * XXX reloading while there are active sessions is
- * somewhat silly because the old state presumably
- * wouldn't work anymore...
- * maybe we shuld do a standard hangup localusers ?
- */
- ast_mutex_lock(&__mod_desc->lock);
+static int reload(void)
+{
parse_config();
- ast_mutex_lock(&__mod_desc->lock);
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintospeex);
res |= ast_unregister_translator(&speextolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res=ast_register_translator(&speextolin, mod);
+ res=ast_register_translator(&speextolin);
if (!res)
- res=ast_register_translator(&lintospeex, mod);
+ res=ast_register_translator(&lintospeex);
else
ast_unregister_translator(&speextolin);
+
return res;
}
-static const char *description(void)
-{
- return "Speex/PCM16 (signed linear) Codec Translator";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
-
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "Speex Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/codecs/codec_ulaw.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/codecs/codec_ulaw.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/codecs/codec_ulaw.c (original)
+++ team/group/new_loader_completion/codecs/codec_ulaw.c Mon Apr 24 17:48:29 2006
@@ -159,44 +159,39 @@
ast_config_destroy(cfg);
}
-static int reload(void *mod)
+static int reload(void)
{
parse_config();
+
return 0;
}
-static int unload_module(void *mod)
+static int unload_module(void)
{
int res;
+
res = ast_unregister_translator(&lintoulaw);
res |= ast_unregister_translator(&ulawtolin);
+
return res;
}
-static int load_module(void *mod)
+static int load_module(void)
{
int res;
+
parse_config();
- res = ast_register_translator(&ulawtolin, mod);
+ res = ast_register_translator(&ulawtolin);
if (!res)
- res = ast_register_translator(&lintoulaw, mod);
+ res = ast_register_translator(&lintoulaw);
else
ast_unregister_translator(&ulawtolin);
+
return res;
}
-/*
- * Return a description of this module.
- */
-
-static const char *description(void)
-{
- return "Mu-law Coder/Decoder";
-}
-
-static const char *key(void)
-{
- return ASTERISK_GPL_KEY;
-}
-
-STD_MOD(MOD_1, reload, NULL, NULL);
+AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODULE_DEFAULT, "mu-Law Coder/Decoder",
+ .load = load_module,
+ .unload = unload_module,
+ .reload = reload,
+ );
Modified: team/group/new_loader_completion/include/asterisk/translate.h
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/include/asterisk/translate.h?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/include/asterisk/translate.h (original)
+++ team/group/new_loader_completion/include/asterisk/translate.h Mon Apr 24 17:48:29 2006
@@ -149,7 +149,8 @@
* This registers a codec translator with asterisk
* \return 0 on success, -1 on failure
*/
-int ast_register_translator(struct ast_translator *t, struct ast_module *module);
+int __ast_register_translator(struct ast_translator *t, struct ast_module *module);
+#define ast_register_translator(t) __ast_register_translator(t, ast_module_info.self)
/*!
* \brief Unregister a translator
Modified: team/group/new_loader_completion/translate.c
URL: http://svn.digium.com/view/asterisk/team/group/new_loader_completion/translate.c?rev=22340&r1=22339&r2=22340&view=diff
==============================================================================
--- team/group/new_loader_completion/translate.c (original)
+++ team/group/new_loader_completion/translate.c Mon Apr 24 17:48:29 2006
@@ -519,7 +519,7 @@
static struct ast_cli_entry show_trans =
{ { "show", "translation", NULL }, show_translation, "Display translation matrix", show_trans_usage };
-int ast_register_translator(struct ast_translator *t, struct ast_module *mod)
+int __ast_register_translator(struct ast_translator *t, struct ast_module *mod)
{
static int added_cli = 0;
More information about the asterisk-commits
mailing list