[svn-commits] tilghman: branch tilghman/codec_bits3 r227348 - in /team/tilghman/codec_bits3...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Nov 3 12:59:59 CST 2009


Author: tilghman
Date: Tue Nov  3 12:59:55 2009
New Revision: 227348

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227348
Log:
Add some test code

Modified:
    team/tilghman/codec_bits3/codecs/codec_ulaw.c
    team/tilghman/codec_bits3/configure
    team/tilghman/codec_bits3/configure.ac
    team/tilghman/codec_bits3/doc/codec-64bit.txt
    team/tilghman/codec_bits3/include/asterisk/frame.h
    team/tilghman/codec_bits3/main/channel.c
    team/tilghman/codec_bits3/main/frame.c

Modified: team/tilghman/codec_bits3/codecs/codec_ulaw.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/codecs/codec_ulaw.c?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/codecs/codec_ulaw.c (original)
+++ team/tilghman/codec_bits3/codecs/codec_ulaw.c Tue Nov  3 12:59:55 2009
@@ -87,6 +87,17 @@
 	.plc_samples = 160,
 };
 
+static struct ast_translator testlawtolin = {
+	.name = "testlawtolin",
+	.srcfmt = AST_FORMAT_TESTLAW,
+	.dstfmt = AST_FORMAT_SLINEAR,
+	.framein = ulawtolin_framein,
+	.sample = ulaw_sample,
+	.buffer_samples = BUFFER_SAMPLES,
+	.buf_size = BUFFER_SAMPLES * 2,
+	.plc_samples = 160,
+};
+
 /*!
  * \brief The complete translator for LinToulaw.
  */
@@ -95,6 +106,16 @@
 	.name = "lintoulaw",
 	.srcfmt = AST_FORMAT_SLINEAR,
 	.dstfmt = AST_FORMAT_ULAW,
+	.framein = lintoulaw_framein,
+	.sample = slin8_sample,
+	.buf_size = BUFFER_SAMPLES,
+	.buffer_samples = BUFFER_SAMPLES,
+};
+
+static struct ast_translator lintotestlaw = {
+	.name = "lintotestlaw",
+	.srcfmt = AST_FORMAT_SLINEAR,
+	.dstfmt = AST_FORMAT_TESTLAW,
 	.framein = lintoulaw_framein,
 	.sample = slin8_sample,
 	.buf_size = BUFFER_SAMPLES,
@@ -131,6 +152,8 @@
 
 	res = ast_unregister_translator(&lintoulaw);
 	res |= ast_unregister_translator(&ulawtolin);
+	res |= ast_unregister_translator(&testlawtolin);
+	res |= ast_unregister_translator(&lintotestlaw);
 
 	return res;
 }
@@ -142,9 +165,11 @@
 	if (parse_config(0))
 		return AST_MODULE_LOAD_DECLINE;
 	res = ast_register_translator(&ulawtolin);
-	if (!res)
+	if (!res) {
 		res = ast_register_translator(&lintoulaw);
-	else
+		res |= ast_register_translator(&lintotestlaw);
+		res |= ast_register_translator(&testlawtolin);
+	} else
 		ast_unregister_translator(&ulawtolin);
 	if (res)
 		return AST_MODULE_LOAD_FAILURE;

Modified: team/tilghman/codec_bits3/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/configure.ac?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/configure.ac (original)
+++ team/tilghman/codec_bits3/configure.ac Tue Nov  3 12:59:55 2009
@@ -1363,6 +1363,7 @@
    AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
    AST_C_DEFINE_CHECK([MISDN_FAC_ERROR], [Fac_ERROR], [mISDNuser/suppserv.h])
    AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
+   AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
 fi
 
 AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])

Modified: team/tilghman/codec_bits3/doc/codec-64bit.txt
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/doc/codec-64bit.txt?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/doc/codec-64bit.txt (original)
+++ team/tilghman/codec_bits3/doc/codec-64bit.txt Tue Nov  3 12:59:55 2009
@@ -42,4 +42,6 @@
 Little changes are required to support further codec expansion in the future,
 though the majority of the work has already been accomplished.  Specifically,
 the bitwise operations that are immutable operations in the gcc compiler will
-need to be altered to handle larger bitmasks.
+need to be altered to handle larger bitmasks.  Additionally, the constants that
+define specific codecs will need to be changed from integers to structures.
+

Modified: team/tilghman/codec_bits3/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/include/asterisk/frame.h?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/include/asterisk/frame.h (original)
+++ team/tilghman/codec_bits3/include/asterisk/frame.h Tue Nov  3 12:59:55 2009
@@ -291,6 +291,8 @@
 /*! Maximum text mask */
 #define AST_FORMAT_MAX_TEXT   (1ULL << 28)
 #define AST_FORMAT_TEXT_MASK  (((1ULL << 30)-1) & ~(AST_FORMAT_AUDIO_MASK) & ~(AST_FORMAT_VIDEO_MASK))
+/*! Raw mu-law data (G.711) */
+#define AST_FORMAT_TESTLAW       (1ULL << 47)
 /*! Reserved bit - do not use */
 #define AST_FORMAT_RESERVED   (1ULL << 63)
 

Modified: team/tilghman/codec_bits3/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/main/channel.c?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/main/channel.c (original)
+++ team/tilghman/codec_bits3/main/channel.c Tue Nov  3 12:59:55 2009
@@ -725,7 +725,7 @@
 	/* This just our opinion, expressed in code.  We are asked to choose
 	   the best codec to use, given no information */
 	int x;
-	static const int prefs[] =
+	static const format_t prefs[] =
 	{
 		/*! Okay, ulaw is used by all telephony equipment, so start with it */
 		AST_FORMAT_ULAW,
@@ -733,6 +733,7 @@
 		AST_FORMAT_ALAW,
 		AST_FORMAT_SIREN14,
 		AST_FORMAT_SIREN7,
+		AST_FORMAT_TESTLAW,
 		/*! G.722 is better then all below, but not as common as the above... so give ulaw and alaw priority */
 		AST_FORMAT_G722,
 		/*! Okay, well, signed linear is easy to translate into other stuff */

Modified: team/tilghman/codec_bits3/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/tilghman/codec_bits3/main/frame.c?view=diff&rev=227348&r1=227347&r2=227348
==============================================================================
--- team/tilghman/codec_bits3/main/frame.c (original)
+++ team/tilghman/codec_bits3/main/frame.c Tue Nov  3 12:59:55 2009
@@ -119,6 +119,7 @@
 	{ AST_FORMAT_T140, "t140", 0, "Passthrough T.140 Realtime Text" },                                     /*!< Passthrough support for T.140 Realtime Text */
 	{ AST_FORMAT_SIREN7, "siren7", 16000, "ITU G.722.1 (Siren7, licensed from Polycom)", 80, 20, 80, 20, 20 },			/*!< Binary commercial distribution */
 	{ AST_FORMAT_SIREN14, "siren14", 32000, "ITU G.722.1 Annex C, (Siren14, licensed from Polycom)", 120, 20, 80, 20, 20 },	/*!< Binary commercial distribution */
+	{ AST_FORMAT_TESTLAW, "testlaw", 8000, "G.711 test-law", 80, 10, 150, 10, 20 },                                 /*!< codec_ulaw.c */
 };
 
 struct ast_frame ast_null_frame = { AST_FRAME_NULL, };
@@ -623,7 +624,8 @@
 
 format_t ast_getformatbyname(const char *name)
 {
-	int x, all, format = 0;
+	int x, all;
+	format_t format = 0;
 
 	all = strcasecmp(name, "all") ? 0 : 1;
 	for (x = 0; x < ARRAY_LEN(AST_FORMAT_LIST); x++) {
@@ -1447,6 +1449,7 @@
 		break;
 	case AST_FORMAT_ULAW:
 	case AST_FORMAT_ALAW:
+	case AST_FORMAT_TESTLAW:
 		samples = f->datalen;
 		break;
 	case AST_FORMAT_G722:
@@ -1493,6 +1496,7 @@
 		break;
 	case AST_FORMAT_ULAW:
 	case AST_FORMAT_ALAW:
+	case AST_FORMAT_TESTLAW:
 		len = samples;
 		break;
 	case AST_FORMAT_G722:




More information about the svn-commits mailing list