# __ast_
# astman_
# pbx_
+# resample_
-FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_"
+FILTER="${GREP} -v -e ^ast_ -e ^_ast_ -e ^__ast_ -e ^astman_ -e ^pbx_ -e ^resample_"
case "${OSARCH}" in
linux-gnu|FreeBSD)
$(if $(filter codec_g722,$(EMBEDDED_MODS)),modules.link,codec_g722.so): $(LIBG722)
-codec_resample.o: ASTCFLAGS+=-I$(ASTTOPDIR)/res/libresample/include
+codec_resample.o: ASTCFLAGS+=-I$(ASTTOPDIR)/main/libresample/include
* \ingroup codecs
*/
-/*** MODULEINFO
- <depend>res_resample</depend>
- ***/
-
#include "asterisk.h"
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
db1-ast/libdb1.a: CHECK_SUBDIR
CFLAGS="$(ASTCFLAGS)" LDFLAGS="$(ASTLDFLAGS)" $(MAKE) -C db1-ast libdb1.a
+libresample/libresample.a: CHECK_SUBDIR
+ $(MAKE) -f Makefile.asterisk -C libresample libresample.a
+
ast_expr2.c ast_expr2.h:
bison -o $@ -d --name-prefix=ast_yy ast_expr2.y
channel.o: ASTCFLAGS+=$(ZAPTEL_INCLUDE)
+translate.o: ASTCFLAGS+=-Ilibresample/include
+
AST_EMBED_LDSCRIPTS:=$(sort $(EMBED_LDSCRIPTS))
AST_EMBED_LDFLAGS:=$(foreach dep,$(EMBED_LDFLAGS),$(value $(dep)))
AST_EMBED_LIBS:=$(foreach dep,$(EMBED_LIBS),$(value $(dep)))
MAIN_TGT:=asterisk
endif
-$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS)
+$(MAIN_TGT): $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS) libresample/libresample.a
@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
$(ECHO_PREFIX) echo " [LD] $^ -> $@"
ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)
@$(MAKE) -C db1-ast clean
@$(MAKE) -C stdtime clean
@$(MAKE) -C minimime clean
+ @$(MAKE) -f Makefile.asterisk -C libresample clean
/* Just exit if we get invalid factors */
if (minFactor <= 0.0 || maxFactor <= 0.0 || maxFactor < minFactor) {
- #ifdef DEBUG
+ #if defined(DEBUG)
fprintf(stderr,
"libresample: "
"minFactor and maxFactor must be positive real numbers,\n"
int Nx;
int i, len;
- #ifdef DEBUG
+ #if defined(DEBUG)
fprintf(stderr, "resample_process: in=%d, out=%d lastFlag=%d\n",
inBufferLen, outBufferLen, lastFlag);
#endif
outSampleCount = 0;
if (factor < hp->minFactor || factor > hp->maxFactor) {
- #ifdef DEBUG
+ #if defined(DEBUG)
fprintf(stderr,
"libresample: factor %f is not between "
"minFactor=%f and maxFactor=%f",
/* This is the maximum number of samples we can process
per loop iteration */
- #ifdef DEBUG
+ #if defined(DEBUG)
printf("XSize: %d Xoff: %d Xread: %d Xp: %d lastFlag: %d\n",
hp->XSize, hp->Xoff, hp->Xread, hp->Xp, lastFlag);
#endif
else
Nx = hp->Xread - 2 * hp->Xoff;
- #ifdef DEBUG
+ #if defined(DEBUG)
fprintf(stderr, "new len=%d Nx=%d\n", len, Nx);
#endif
Nwing, LpScl, Imp, ImpD, interpFilt);
}
- #ifdef DEBUG
+ #if defined(DEBUG)
printf("Nout: %d\n", Nout);
#endif
for (i=0; i<Nreuse; i++)
hp->X[i] = hp->X[i + (hp->Xp - hp->Xoff)];
- #ifdef DEBUG
+ #if defined(DEBUG)
printf("New Xread=%d\n", Nreuse);
#endif
/* Check to see if output buff overflowed (shouldn't happen!) */
if (Nout > hp->YSize) {
- #ifdef DEBUG
+ #if defined(DEBUG)
printf("Nout: %d YSize: %d\n", Nout, hp->YSize);
#endif
fprintf(stderr, "libresample: Output array overflow!\n");
#include "asterisk/cli.h"
#include "asterisk/term.h"
+#include "libresample.h"
+
#define MAX_RECALC 1000 /* max sample recalc */
+/* hack to ensure that the libresample code gets linked in */
+
+static attribute_unused void (*resample_hack)(void *) = resample_close;
+
/*! \brief the list of translators */
static AST_RWLIST_HEAD_STATIC(translators, ast_translator);
ael/pval.o: ael/pval.c
-res_resample.so: libresample/src/resample.o libresample/src/resamplesubs.o libresample/src/filterkit.o
-
clean::
rm -f snmp/*.o
rm -f ael/*.o
- rm -f libresample/src/*.o
+++ /dev/null
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 2007, Digium, Inc.
- *
- * Russell Bryant <russell@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
- *
- * \author Russell Bryant <russell@digium.com>
- */
-
-#include "asterisk.h"
-
-ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
-#include "asterisk/module.h"
-
-static int load_module(void)
-{
- return 0;
-}
-
-static int unload_module(void)
-{
- return -1;
-}
-
-AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_GLOBAL_SYMBOLS, "Resampling Support via libresample",
- .load = load_module,
- .unload = unload_module,
- );