[asterisk-commits] kpfleming: trunk r95816 - in /trunk: build_tools/ codecs/ main/ main/libresam...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 2 08:05:31 CST 2008


Author: kpfleming
Date: Wed Jan  2 08:05:30 2008
New Revision: 95816

URL: http://svn.digium.com/view/asterisk?view=rev&rev=95816
Log:
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)

Added:
    trunk/main/libresample/   (props changed)
      - copied from r95696, trunk/main/libresample/
    trunk/main/libresample/LICENSE.txt
      - copied unchanged from r95696, trunk/main/libresample/LICENSE.txt
    trunk/main/libresample/Makefile.asterisk
      - copied unchanged from r95696, trunk/main/libresample/Makefile.asterisk
    trunk/main/libresample/Makefile.in
      - copied unchanged from r95696, trunk/main/libresample/Makefile.in
    trunk/main/libresample/README.txt
      - copied unchanged from r95696, trunk/main/libresample/README.txt
    trunk/main/libresample/config.guess
      - copied unchanged from r95696, trunk/main/libresample/config.guess
    trunk/main/libresample/config.sub
      - copied unchanged from r95696, trunk/main/libresample/config.sub
    trunk/main/libresample/configure
      - copied unchanged from r95696, trunk/main/libresample/configure
    trunk/main/libresample/configure.in
      - copied unchanged from r95696, trunk/main/libresample/configure.in
    trunk/main/libresample/include/
      - copied from r95696, trunk/main/libresample/include/
    trunk/main/libresample/include/libresample.h
      - copied unchanged from r95696, trunk/main/libresample/include/libresample.h
    trunk/main/libresample/install-sh
      - copied unchanged from r95696, trunk/main/libresample/install-sh
    trunk/main/libresample/src/
      - copied from r95696, trunk/main/libresample/src/
    trunk/main/libresample/src/configtemplate.h
      - copied unchanged from r95696, trunk/main/libresample/src/configtemplate.h
    trunk/main/libresample/src/filterkit.c
      - copied unchanged from r95696, trunk/main/libresample/src/filterkit.c
    trunk/main/libresample/src/filterkit.h
      - copied unchanged from r95696, trunk/main/libresample/src/filterkit.h
    trunk/main/libresample/src/resample.c
      - copied, changed from r95696, trunk/main/libresample/src/resample.c
    trunk/main/libresample/src/resample_defs.h
      - copied, changed from r95696, trunk/main/libresample/src/resample_defs.h
    trunk/main/libresample/src/resamplesubs.c
      - copied unchanged from r95696, trunk/main/libresample/src/resamplesubs.c
    trunk/main/libresample/tests/
      - copied from r95696, trunk/main/libresample/tests/
    trunk/main/libresample/tests/compareresample.c
      - copied unchanged from r95696, trunk/main/libresample/tests/compareresample.c
    trunk/main/libresample/tests/resample-sndfile.c
      - copied unchanged from r95696, trunk/main/libresample/tests/resample-sndfile.c
    trunk/main/libresample/tests/testresample.c
      - copied unchanged from r95696, trunk/main/libresample/tests/testresample.c
    trunk/main/libresample/win/
      - copied from r95696, trunk/main/libresample/win/
    trunk/main/libresample/win/libresample.dsp
      - copied unchanged from r95696, trunk/main/libresample/win/libresample.dsp
    trunk/main/libresample/win/libresample.vcproj
      - copied unchanged from r95696, trunk/main/libresample/win/libresample.vcproj
Removed:
    trunk/res/libresample/
    trunk/res/res_resample.c
Modified:
    trunk/build_tools/strip_nonapi
    trunk/codecs/Makefile
    trunk/codecs/codec_resample.c
    trunk/main/Makefile
    trunk/main/translate.c
    trunk/res/Makefile

Modified: trunk/build_tools/strip_nonapi
URL: http://svn.digium.com/view/asterisk/trunk/build_tools/strip_nonapi?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/build_tools/strip_nonapi (original)
+++ trunk/build_tools/strip_nonapi Wed Jan  2 08:05:30 2008
@@ -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)

Modified: trunk/codecs/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/codecs/Makefile?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/codecs/Makefile (original)
+++ trunk/codecs/Makefile Wed Jan  2 08:05:30 2008
@@ -55,4 +55,4 @@
 
 $(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

Modified: trunk/codecs/codec_resample.c
URL: http://svn.digium.com/view/asterisk/trunk/codecs/codec_resample.c?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/codecs/codec_resample.c (original)
+++ trunk/codecs/codec_resample.c Wed Jan  2 08:05:30 2008
@@ -23,10 +23,6 @@
  *
  * \ingroup codecs
  */
-
-/*** MODULEINFO
-	<depend>res_resample</depend>
- ***/
 
 #include "asterisk.h"
 

Modified: trunk/main/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/main/Makefile?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/main/Makefile (original)
+++ trunk/main/Makefile Wed Jan  2 08:05:30 2008
@@ -111,6 +111,9 @@
 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
 
@@ -126,6 +129,8 @@
 	rm ast_expr2.o ast_expr2f.o 
 
 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)))
@@ -152,7 +157,7 @@
 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 @@
 	@$(MAKE) -C db1-ast clean
 	@$(MAKE) -C stdtime clean
 	@$(MAKE) -C minimime clean
+	@$(MAKE) -f Makefile.asterisk -C libresample clean

Propchange: trunk/main/libresample/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Jan  2 08:05:30 2008
@@ -1,0 +1,2 @@
+*.d
+libresample.a

Copied: trunk/main/libresample/src/resample.c (from r95696, trunk/main/libresample/src/resample.c)
URL: http://svn.digium.com/view/asterisk/trunk/main/libresample/src/resample.c?view=diff&rev=95816&p1=trunk/main/libresample/src/resample.c&r1=95696&p2=trunk/main/libresample/src/resample.c&r2=95816
==============================================================================
--- trunk/main/libresample/src/resample.c (original)
+++ trunk/main/libresample/src/resample.c Wed Jan  2 08:05:30 2008
@@ -87,7 +87,7 @@
 
    /* Just exit if we get invalid factors */
    if (minFactor <= 0.0 || maxFactor <= 0.0 || maxFactor < minFactor) {
-      #if DEBUG
+      #if defined(DEBUG)
       fprintf(stderr,
               "libresample: "
               "minFactor and maxFactor must be positive real numbers,\n"
@@ -187,7 +187,7 @@
    int Nx;
    int i, len;
 
-   #if DEBUG
+   #if defined(DEBUG)
    fprintf(stderr, "resample_process: in=%d, out=%d lastFlag=%d\n",
            inBufferLen, outBufferLen, lastFlag);
    #endif
@@ -197,7 +197,7 @@
    outSampleCount = 0;
 
    if (factor < hp->minFactor || factor > hp->maxFactor) {
-      #if DEBUG
+      #if defined(DEBUG)
       fprintf(stderr,
               "libresample: factor %f is not between "
               "minFactor=%f and maxFactor=%f",
@@ -232,7 +232,7 @@
       /* 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 @@
       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 @@
                          Nwing, LpScl, Imp, ImpD, interpFilt);
       }
 
-      #ifdef DEBUG
+      #if defined(DEBUG)
       printf("Nout: %d\n", Nout);
       #endif
       
@@ -297,7 +297,7 @@
       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 @@
       
       /* 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");

Copied: trunk/main/libresample/src/resample_defs.h (from r95696, trunk/main/libresample/src/resample_defs.h)
URL: http://svn.digium.com/view/asterisk/trunk/main/libresample/src/resample_defs.h?view=diff&rev=95816&p1=trunk/main/libresample/src/resample_defs.h&r1=95696&p2=trunk/main/libresample/src/resample_defs.h&r2=95816
==============================================================================
--- trunk/main/libresample/src/resample_defs.h (original)
+++ trunk/main/libresample/src/resample_defs.h Wed Jan  2 08:05:30 2008
@@ -19,8 +19,6 @@
 #include "config.h"
 #endif
 #endif
-
-#define DEBUG 0
 
 #ifndef TRUE
 #define TRUE  1

Modified: trunk/main/translate.c
URL: http://svn.digium.com/view/asterisk/trunk/main/translate.c?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/main/translate.c (original)
+++ trunk/main/translate.c Wed Jan  2 08:05:30 2008
@@ -39,7 +39,13 @@
 #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);

Modified: trunk/res/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/res/Makefile?view=diff&rev=95816&r1=95815&r2=95816
==============================================================================
--- trunk/res/Makefile (original)
+++ trunk/res/Makefile Wed Jan  2 08:05:30 2008
@@ -47,9 +47,6 @@
 
 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




More information about the asterisk-commits mailing list