mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
go back to including libresample in the main Asterisk binary, but this time including a small hack to ensure that it does get linked in (and also modify the strip_nonapi script to leave the resample_<foo> symbols alone)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@95816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -14,8 +14,9 @@
|
||||
# __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)
|
||||
|
@@ -55,4 +55,4 @@ $(LIBG722):
|
||||
|
||||
$(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
|
||||
|
@@ -24,10 +24,6 @@
|
||||
* \ingroup codecs
|
||||
*/
|
||||
|
||||
/*** MODULEINFO
|
||||
<depend>res_resample</depend>
|
||||
***/
|
||||
|
||||
#include "asterisk.h"
|
||||
|
||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
@@ -111,6 +111,9 @@ editline/libedit.a: CHECK_SUBDIR
|
||||
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
|
||||
|
||||
@@ -127,6 +130,8 @@ testexpr2: ast_expr2f.c ast_expr2.c ast_expr2.h
|
||||
|
||||
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)))
|
||||
@@ -152,7 +157,7 @@ else
|
||||
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)),)
|
||||
@@ -169,3 +174,4 @@ clean::
|
||||
@$(MAKE) -C db1-ast clean
|
||||
@$(MAKE) -C stdtime clean
|
||||
@$(MAKE) -C minimime clean
|
||||
@$(MAKE) -f Makefile.asterisk -C libresample clean
|
||||
|
@@ -87,7 +87,7 @@ void *resample_open(int highQuality, double minFactor, double maxFactor)
|
||||
|
||||
/* 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"
|
||||
@@ -187,7 +187,7 @@ int resample_process(void *handle,
|
||||
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
|
||||
@@ -197,7 +197,7 @@ int resample_process(void *handle,
|
||||
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",
|
||||
@@ -232,7 +232,7 @@ int resample_process(void *handle,
|
||||
/* 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
|
||||
@@ -260,7 +260,7 @@ int resample_process(void *handle,
|
||||
else
|
||||
Nx = hp->Xread - 2 * hp->Xoff;
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG)
|
||||
fprintf(stderr, "new len=%d Nx=%d\n", len, Nx);
|
||||
#endif
|
||||
|
||||
@@ -277,7 +277,7 @@ int resample_process(void *handle,
|
||||
Nwing, LpScl, Imp, ImpD, interpFilt);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
#if defined(DEBUG)
|
||||
printf("Nout: %d\n", Nout);
|
||||
#endif
|
||||
|
||||
@@ -297,7 +297,7 @@ int resample_process(void *handle,
|
||||
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
|
||||
|
||||
@@ -306,7 +306,7 @@ int resample_process(void *handle,
|
||||
|
||||
/* 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");
|
@@ -39,8 +39,14 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#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);
|
||||
|
||||
|
@@ -47,9 +47,6 @@ ael/ael.tab.c ael/ael.tab.h:
|
||||
|
||||
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
|
||||
|
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* 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,
|
||||
);
|
Reference in New Issue
Block a user