[asterisk-commits] branch file/coremedia - r7320 in /team/file/coremedia: codecs/ shims/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sat Dec 3 18:33:57 CST 2005


Author: file
Date: Sat Dec  3 18:33:55 2005
New Revision: 7320

URL: http://svn.digium.com/view/asterisk?rev=7320&view=rev
Log:
Bit more codec cleanup

Modified:
    team/file/coremedia/codecs/codec_gsm.c
    team/file/coremedia/codecs/codec_ulaw.c
    team/file/coremedia/shims/Makefile
    team/file/coremedia/shims/shim_volume.c

Modified: team/file/coremedia/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/codecs/codec_gsm.c?rev=7320&r1=7319&r2=7320&view=diff
==============================================================================
--- team/file/coremedia/codecs/codec_gsm.c (original)
+++ team/file/coremedia/codecs/codec_gsm.c Sat Dec  3 18:33:55 2005
@@ -47,10 +47,6 @@
 
 #include "gsm/inc/gsm.h"
 #include "../formats/msgsm.h"
-
-/* Sample frame data */
-#include "slin_gsm_ex.h"
-#include "gsm_slin_ex.h"
 
 AST_MUTEX_DEFINE_STATIC(localuser_lock);
 static int localusecnt=0;
@@ -90,36 +86,6 @@
 	return tmp;
 }
 
-static struct ast_frame *lintogsm_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_SLINEAR;
-	f.datalen = sizeof(slin_gsm_ex);
-	/* Assume 8000 Hz */
-	f.samples = sizeof(slin_gsm_ex)/2;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data = slin_gsm_ex;
-	return &f;
-}
-
-static struct ast_frame *gsmtolin_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_GSM;
-	f.datalen = sizeof(gsm_slin_ex);
-	/* All frames are 20 ms long */
-	f.samples = 160;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data = gsm_slin_ex;
-	return &f;
-}
-
 static struct ast_frame *gsmtolin_frameout(struct ast_translator_pvt *tmp)
 {
 	if (!tmp->tail)
@@ -127,7 +93,6 @@
 	/* Signed linear is no particular frame size, so just send whatever
 	   we have in the buffer in one lump sum */
 	tmp->f.frametype = AST_FRAME_VOICE;
-	tmp->f.subclass = AST_FORMAT_SLINEAR;
 	tmp->f.datalen = tmp->tail * 2;
 	/* Assume 8000 Hz */
 	tmp->f.samples = tmp->tail;
@@ -231,7 +196,6 @@
 	if (tmp->tail < 160)
 		return NULL;
 	tmp->f.frametype = AST_FRAME_VOICE;
-	tmp->f.subclass = AST_FORMAT_GSM;
 	tmp->f.mallocd = 0;
 	tmp->f.offset = AST_FRIENDLY_OFFSET;
 	tmp->f.src = __PRETTY_FUNCTION__;

Modified: team/file/coremedia/codecs/codec_ulaw.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/codecs/codec_ulaw.c?rev=7320&r1=7319&r2=7320&view=diff
==============================================================================
--- team/file/coremedia/codecs/codec_ulaw.c (original)
+++ team/file/coremedia/codecs/codec_ulaw.c Sat Dec  3 18:33:55 2005
@@ -39,8 +39,8 @@
 #include "asterisk/module.h"
 #include "asterisk/config.h"
 #include "asterisk/options.h"
+#include "asterisk/channel.h"
 #include "asterisk/coremedia.h"
-#include "asterisk/channel.h"
 #include "asterisk/ulaw.h"
 
 #define BUFFER_SIZE   8096	/* size for the translation buffers */
@@ -51,11 +51,6 @@
 static char *tdesc = "Mu-law Coder/Decoder";
 
 static int useplc = 0;
-
-/* Sample frame data */
-
-#include "slin_ulaw_ex.h"
-#include "ulaw_slin_ex.h"
 
 /*
  * Private workspace for translating signed linear signals to ulaw.
@@ -203,7 +198,6 @@
     return NULL;
 
   tmp->f.frametype = AST_FRAME_VOICE;
-  tmp->f.subclass = AST_FORMAT_SLINEAR;
   tmp->f.datalen = tmp->tail *2;
   tmp->f.samples = tmp->tail;
   tmp->f.mallocd = 0;
@@ -262,7 +256,6 @@
   
   if (tmp->tail) {
 	  tmp->f.frametype = AST_FRAME_VOICE;
-	  tmp->f.subclass = AST_FORMAT_ULAW;
 	  tmp->f.samples = tmp->tail;
 	  tmp->f.mallocd = 0;
 	  tmp->f.offset = AST_FRIENDLY_OFFSET;
@@ -272,46 +265,6 @@
 	  tmp->tail = 0;
 	  return &tmp->f;
    } else return NULL;
-}
-
-
-/*
- * ulawToLin_Sample
- */
-
-static struct ast_frame *
-ulawtolin_sample (void)
-{
-  static struct ast_frame f;
-  f.frametype = AST_FRAME_VOICE;
-  f.subclass = AST_FORMAT_ULAW;
-  f.datalen = sizeof (ulaw_slin_ex);
-  f.samples = sizeof(ulaw_slin_ex);
-  f.mallocd = 0;
-  f.offset = 0;
-  f.src = __PRETTY_FUNCTION__;
-  f.data = ulaw_slin_ex;
-  return &f;
-}
-
-/*
- * LinToulaw_Sample
- */
-
-static struct ast_frame *
-lintoulaw_sample (void)
-{
-  static struct ast_frame f;
-  f.frametype = AST_FRAME_VOICE;
-  f.subclass = AST_FORMAT_SLINEAR;
-  f.datalen = sizeof (slin_ulaw_ex);
-  /* Assume 8000 Hz */
-  f.samples = sizeof (slin_ulaw_ex) / 2;
-  f.mallocd = 0;
-  f.offset = 0;
-  f.src = __PRETTY_FUNCTION__;
-  f.data = slin_ulaw_ex;
-  return &f;
 }
 
 /*

Modified: team/file/coremedia/shims/Makefile
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/shims/Makefile?rev=7320&r1=7319&r2=7320&view=diff
==============================================================================
--- team/file/coremedia/shims/Makefile (original)
+++ team/file/coremedia/shims/Makefile Sat Dec  3 18:33:55 2005
@@ -11,7 +11,7 @@
 # the GNU General Public License
 #
 
-SHIMS=shim_test.so shim_volume.so
+SHIMS=shim_test.so shim_volume.so shim_voicechanger.so
 
 ifeq (${OSARCH},CYGWIN)
 CYGSOLINK=-Wl,--out-implib=lib$@.a -Wl,--export-all-symbols
@@ -28,6 +28,9 @@
 
 clean:
 	rm -f *.so *.o .depend
+
+shim_voicechanger.so: shim_voicechanger.o
+	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} -lSoundTouch $< ${CYGSOLIB}
 
 %.so : %.o
 	$(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB}

Modified: team/file/coremedia/shims/shim_volume.c
URL: http://svn.digium.com/view/asterisk/team/file/coremedia/shims/shim_volume.c?rev=7320&r1=7319&r2=7320&view=diff
==============================================================================
--- team/file/coremedia/shims/shim_volume.c (original)
+++ team/file/coremedia/shims/shim_volume.c Sat Dec  3 18:33:55 2005
@@ -70,6 +70,7 @@
     else
       s[i] = s[i] * (short)pvt->volume;
   }
+
 
   return frame;
 }



More information about the asterisk-commits mailing list