[svn-commits] qwell: branch qwell/codec_consistency_fix r147197 - in /team/qwell/codec_cons...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 7 11:56:27 CDT 2008


Author: qwell
Date: Tue Oct  7 11:56:26 2008
New Revision: 147197

URL: http://svn.digium.com/view/asterisk?view=rev&rev=147197
Log:
Move codec samples into ex_*.h (It was quite silly that something like codec_a_mu would need to duplicate this)

Modified:
    team/qwell/codec_consistency_fix/codecs/codec_a_mu.c
    team/qwell/codec_consistency_fix/codecs/codec_adpcm.c
    team/qwell/codec_consistency_fix/codecs/codec_alaw.c
    team/qwell/codec_consistency_fix/codecs/codec_g722.c
    team/qwell/codec_consistency_fix/codecs/codec_g726.c
    team/qwell/codec_consistency_fix/codecs/codec_gsm.c
    team/qwell/codec_consistency_fix/codecs/codec_ilbc.c
    team/qwell/codec_consistency_fix/codecs/codec_lpc10.c
    team/qwell/codec_consistency_fix/codecs/codec_speex.c
    team/qwell/codec_consistency_fix/codecs/codec_ulaw.c
    team/qwell/codec_consistency_fix/codecs/ex_adpcm.h
    team/qwell/codec_consistency_fix/codecs/ex_alaw.h
    team/qwell/codec_consistency_fix/codecs/ex_g722.h
    team/qwell/codec_consistency_fix/codecs/ex_g726.h
    team/qwell/codec_consistency_fix/codecs/ex_gsm.h
    team/qwell/codec_consistency_fix/codecs/ex_ilbc.h
    team/qwell/codec_consistency_fix/codecs/ex_lpc10.h
    team/qwell/codec_consistency_fix/codecs/ex_speex.h
    team/qwell/codec_consistency_fix/codecs/ex_ulaw.h
    team/qwell/codec_consistency_fix/include/asterisk/slin.h

Modified: team/qwell/codec_consistency_fix/codecs/codec_a_mu.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_a_mu.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_a_mu.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_a_mu.c Tue Oct  7 11:56:26 2008
@@ -74,37 +74,6 @@
 	return 0;
 }
 
-/*
- * alaw_sample.
- */
-static struct ast_frame *alaw_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ALAW;
-	f.datalen = sizeof(ex_alaw);
-	f.samples = sizeof(ex_alaw);
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_alaw;
-	return &f;
-}
-
-static struct ast_frame *ulaw_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ULAW;
-	f.datalen = sizeof(ex_ulaw);
-	f.samples = sizeof(ex_ulaw);
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_ulaw;
-	return &f;
-}
-
 static struct ast_translator alawtoulaw = {
 	.name = "alawtoulaw",
 	.srcfmt = AST_FORMAT_ALAW,

Modified: team/qwell/codec_consistency_fix/codecs/codec_adpcm.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_adpcm.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_adpcm.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_adpcm.c Tue Oct  7 11:56:26 2008
@@ -284,21 +284,6 @@
 }
 
 
-/*! \brief adpcm_sample */
-static struct ast_frame *adpcm_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ADPCM;
-	f.datalen = sizeof(ex_adpcm);
-	f.samples = sizeof(ex_adpcm) * 2;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_adpcm;
-	return &f;
-}
-
 static struct ast_translator adpcmtolin = {
 	.name = "adpcmtolin",
 	.srcfmt = AST_FORMAT_ADPCM,

Modified: team/qwell/codec_consistency_fix/codecs/codec_alaw.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_alaw.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_alaw.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_alaw.c Tue Oct  7 11:56:26 2008
@@ -69,21 +69,6 @@
 		*dst++ = AST_LIN2A(*src++);
 
 	return 0;
-}
-
-/*! \brief alaw_sample */
-static struct ast_frame *alaw_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ALAW;
-	f.datalen = sizeof(ex_alaw);
-	f.samples = sizeof(ex_alaw);
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_alaw;
-	return &f;
 }
 
 static struct ast_translator alawtolin = {

Modified: team/qwell/codec_consistency_fix/codecs/codec_g722.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_g722.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_g722.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_g722.c Tue Oct  7 11:56:26 2008
@@ -130,20 +130,6 @@
 	pvt->datalen += outlen;
 
 	return 0;
-}
-
-static struct ast_frame *g722_sample(void)
-{
-	static struct ast_frame f = {
-		.frametype = AST_FRAME_VOICE,
-		.subclass = AST_FORMAT_G722,
-		.datalen = sizeof(ex_g722),
-		.samples = sizeof(ex_g722) * 2,
-		.src = __PRETTY_FUNCTION__,
-		.data.ptr = ex_g722,
-	};
-
-	return &f;
 }
 
 static struct ast_translator g722tolin = {

Modified: team/qwell/codec_consistency_fix/codecs/codec_g726.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_g726.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_g726.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_g726.c Tue Oct  7 11:56:26 2008
@@ -785,20 +785,6 @@
 	return 0;
 }
 
-static struct ast_frame *g726_sample(void)
-{
-	static struct ast_frame f = {
-		.frametype = AST_FRAME_VOICE,
-		.subclass = AST_FORMAT_G726,
-		.datalen = sizeof(ex_g726),
-		.samples = sizeof(ex_g726) * 2,	/* 2 samples per byte */
-		.src = __PRETTY_FUNCTION__,
-		.data.ptr = ex_g726,
-	};
-
-	return &f;
-}
-
 static struct ast_translator g726tolin = {
 	.name = "g726tolin",
 	.srcfmt = AST_FORMAT_G726,

Modified: team/qwell/codec_consistency_fix/codecs/codec_gsm.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_gsm.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_gsm.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_gsm.c Tue Oct  7 11:56:26 2008
@@ -47,15 +47,15 @@
 
 #include "../formats/msgsm.h"
 
-/* Sample frame data */
-#include "asterisk/slin.h"
-#include "ex_gsm.h"
-
 #define BUFFER_SAMPLES	8000
 #define GSM_SAMPLES	160
 #define	GSM_FRAME_LEN	33
 #define	MSGSM_FRAME_LEN	65
 
+/* Sample frame data */
+#include "asterisk/slin.h"
+#include "ex_gsm.h"
+
 struct gsm_translator_pvt {	/* both gsm2lin and lin2gsm */
 	gsm gsm;
 	int16_t buf[BUFFER_SAMPLES];	/* lin2gsm, temporary storage */
@@ -66,21 +66,6 @@
 	struct gsm_translator_pvt *tmp = pvt->pvt;
 	
 	return (tmp->gsm = gsm_create()) ? 0 : -1;
-}
-
-static struct ast_frame *gsm_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_GSM;
-	f.datalen = sizeof(ex_gsm);
-	/* All frames are 20 ms long */
-	f.samples = GSM_SAMPLES;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_gsm;
-	return &f;
 }
 
 /*! \brief decode and store in outbuf. */

Modified: team/qwell/codec_consistency_fix/codecs/codec_ilbc.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_ilbc.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_ilbc.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_ilbc.c Tue Oct  7 11:56:26 2008
@@ -40,17 +40,17 @@
 #include "ilbc/iLBC_encode.h"
 #include "ilbc/iLBC_decode.h"
 
+#define USE_ILBC_ENHANCER	0
+#define ILBC_MS 			30
+/* #define ILBC_MS			20 */
+
+#define	ILBC_FRAME_LEN	50	/* apparently... */
+#define	ILBC_SAMPLES	240	/* 30ms at 8000 hz */
+#define	BUFFER_SAMPLES	8000
+
 /* Sample frame data */
 #include "asterisk/slin.h"
 #include "ex_ilbc.h"
-
-#define USE_ILBC_ENHANCER	0
-#define ILBC_MS 			30
-/* #define ILBC_MS			20 */
-
-#define	ILBC_FRAME_LEN	50	/* apparently... */
-#define	ILBC_SAMPLES	240	/* 30ms at 8000 hz */
-#define	BUFFER_SAMPLES	8000
 
 struct ilbc_coder_pvt {
 	iLBC_Enc_Inst_t enc;
@@ -75,21 +75,6 @@
 	initDecode(&tmp->dec, ILBC_MS, USE_ILBC_ENHANCER);
 
 	return 0;
-}
-
-static struct ast_frame *ilbc_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ILBC;
-	f.datalen = sizeof(ex_ilbc);
-	/* All frames are 30 ms long */
-	f.samples = ILBC_SAMPLES;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_ilbc;
-	return &f;
 }
 
 /*! \brief decode a frame and store in outbuf */

Modified: team/qwell/codec_consistency_fix/codecs/codec_lpc10.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_lpc10.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_lpc10.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_lpc10.c Tue Oct  7 11:56:26 2008
@@ -73,22 +73,6 @@
 	struct lpc10_coder_pvt *tmp = pvt->pvt;
 
 	return (tmp->lpc10.dec = create_lpc10_decoder_state()) ? 0 : -1;
-}
-
-static struct ast_frame *lpc10_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_LPC10;
-	f.datalen = sizeof(ex_lpc10);
-	/* All frames are 22 ms long (maybe a little more -- why did he choose
-	   LPC10_SAMPLES_PER_FRAME sample frames anyway?? */
-	f.samples = LPC10_SAMPLES_PER_FRAME;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_lpc10;
-	return &f;
 }
 
 static void extract_bits(INT32 *bits, unsigned char *c)

Modified: team/qwell/codec_consistency_fix/codecs/codec_speex.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_speex.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_speex.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_speex.c Tue Oct  7 11:56:26 2008
@@ -52,10 +52,6 @@
 #include "asterisk/module.h"
 #include "asterisk/config.h"
 #include "asterisk/utils.h"
-
-/* Sample frame data */
-#include "asterisk/slin.h"
-#include "ex_speex.h"
 
 /* codec variables */
 static int quality = 3;
@@ -84,6 +80,10 @@
 #define	BUFFER_SAMPLES	8000
 #define	SPEEX_SAMPLES	160
 
+/* Sample frame data */
+#include "asterisk/slin.h"
+#include "ex_speex.h"
+
 struct speex_coder_pvt {
 	void *speex;
 	SpeexBits bits;
@@ -152,21 +152,6 @@
 		speex_decoder_ctl(tmp->speex, SPEEX_SET_ENH, &enhancement);
 
 	return 0;
-}
-
-static struct ast_frame *speex_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_SPEEX;
-	f.datalen = sizeof(ex_speex);
-	/* All frames are 20 ms long */
-	f.samples = SPEEX_SAMPLES;
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_speex;
-	return &f;
 }
 
 /*! \brief convert and store into outbuf */

Modified: team/qwell/codec_consistency_fix/codecs/codec_ulaw.c
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/codec_ulaw.c?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/codec_ulaw.c (original)
+++ team/qwell/codec_consistency_fix/codecs/codec_ulaw.c Tue Oct  7 11:56:26 2008
@@ -70,21 +70,6 @@
 		*dst++ = AST_LIN2MU(*src++);
 
 	return 0;
-}
-
-/*!  * \brief ulaw_sample */
-static struct ast_frame *ulaw_sample(void)
-{
-	static struct ast_frame f;
-	f.frametype = AST_FRAME_VOICE;
-	f.subclass = AST_FORMAT_ULAW;
-	f.datalen = sizeof(ex_ulaw);
-	f.samples = sizeof(ex_ulaw);
-	f.mallocd = 0;
-	f.offset = 0;
-	f.src = __PRETTY_FUNCTION__;
-	f.data.ptr = ex_ulaw;
-	return &f;
 }
 
 /*!

Modified: team/qwell/codec_consistency_fix/codecs/ex_adpcm.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_adpcm.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_adpcm.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_adpcm.h Tue Oct  7 11:56:26 2008
@@ -13,3 +13,19 @@
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
+
+static struct ast_frame *adpcm_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_ADPCM,
+		.datalen = sizeof(ex_adpcm),
+		.samples = sizeof(ex_adpcm) * 2,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_adpcm,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_alaw.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_alaw.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_alaw.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_alaw.h Tue Oct  7 11:56:26 2008
@@ -21,3 +21,19 @@
 	0x80, 0xab, 0xae, 0xb1, 0xb4, 0xb7, 0xba, 0xbd,
 	0x90, 0xc0, 0xc3, 0xc6, 0xc9, 0xcc, 0xcf, 0xd2,
 };
+
+static struct ast_frame *alaw_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_ALAW,
+		.datalen = sizeof(ex_alaw),
+		.samples = sizeof(ex_alaw),
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_alaw,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_g722.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_g722.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_g722.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_g722.h Tue Oct  7 11:56:26 2008
@@ -13,3 +13,19 @@
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
+
+static struct ast_frame *g722_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_G722,
+		.datalen = sizeof(ex_g722),
+		.samples = sizeof(ex_g722) * 2,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_g722,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_g726.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_g726.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_g726.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_g726.h Tue Oct  7 11:56:26 2008
@@ -13,3 +13,19 @@
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
+
+static struct ast_frame *g726_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_G726,
+		.datalen = sizeof(ex_g726),
+		.samples = sizeof(ex_g726) * 2,	/* 2 samples per byte */
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_g726,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_gsm.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_gsm.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_gsm.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_gsm.h Tue Oct  7 11:56:26 2008
@@ -15,3 +15,20 @@
 	0x00, 0x49, 0x24, 0x92, 0x47, 0x24, 0x50, 0x80, 0x46, 0xe3, 
 	0x6d, 0xb8, 0xdc,
 };
+
+static struct ast_frame *gsm_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_GSM,
+		.datalen = sizeof(ex_gsm),
+		/* All frames are 20 ms long */
+		.samples = GSM_SAMPLES,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_gsm,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_ilbc.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_ilbc.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_ilbc.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_ilbc.h Tue Oct  7 11:56:26 2008
@@ -16,3 +16,20 @@
 	0xff, 0xff, 0xff, 0xfc, 0xf9, 0xe5, 0x55, 0x78, 0x0b, 0xca, 
 	0xe1, 0x27, 0x94, 0x7b, 0xa8, 0x91, 0x2c, 0x36, 0x08, 0x56,
 };
+
+static struct ast_frame *ilbc_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_ILBC,
+		.datalen = sizeof(ex_ilbc),
+		/* All frames are 30 ms long */
+		.samples = ILBC_SAMPLES,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_ilbc,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_lpc10.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_lpc10.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_lpc10.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_lpc10.h Tue Oct  7 11:56:26 2008
@@ -12,3 +12,21 @@
 static unsigned char ex_lpc10[] = {
 	0x01, 0x08, 0x31, 0x08, 0x31, 0x80, 0x30,
 };
+
+static struct ast_frame *lpc10_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_LPC10,
+		.datalen = sizeof(ex_lpc10),
+		/* All frames are 22 ms long (maybe a little more -- why did he choose
+		   LPC10_SAMPLES_PER_FRAME sample frames anyway?? */
+		.samples = LPC10_SAMPLES_PER_FRAME,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_lpc10,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_speex.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_speex.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_speex.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_speex.h Tue Oct  7 11:56:26 2008
@@ -15,3 +15,20 @@
 	0xff, 0xdc, 0x80, 0x5f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 
 	0x98, 0x7f, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xf7, 0x80,
 };
+
+static struct ast_frame *speex_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_SPEEX,
+		.datalen = sizeof(ex_speex),
+		/* All frames are 20 ms long */
+		.samples = SPEEX_SAMPLES,
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_speex,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/codecs/ex_ulaw.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/codecs/ex_ulaw.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/codecs/ex_ulaw.h (original)
+++ team/qwell/codec_consistency_fix/codecs/ex_ulaw.h Tue Oct  7 11:56:26 2008
@@ -21,3 +21,19 @@
 	0x80, 0xab, 0xae, 0xb1, 0xb4, 0xb7, 0xba, 0xbd,
 	0x90, 0xc0, 0xc3, 0xc6, 0xc9, 0xcc, 0xcf, 0xd2,
 };
+
+static struct ast_frame *ulaw_sample(void)
+{
+	static struct ast_frame f = {
+		.frametype = AST_FRAME_VOICE,
+		.subclass = AST_FORMAT_ULAW,
+		.datalen = sizeof(ex_ulaw),
+		.samples = sizeof(ex_ulaw),
+		.mallocd = 0,
+		.offset = 0,
+		.src = __PRETTY_FUNCTION__,
+		.data.ptr = ex_ulaw,
+	};
+
+	return &f;
+}

Modified: team/qwell/codec_consistency_fix/include/asterisk/slin.h
URL: http://svn.digium.com/view/asterisk/team/qwell/codec_consistency_fix/include/asterisk/slin.h?view=diff&rev=147197&r1=147196&r2=147197
==============================================================================
--- team/qwell/codec_consistency_fix/include/asterisk/slin.h (original)
+++ team/qwell/codec_consistency_fix/include/asterisk/slin.h Tue Oct  7 11:56:26 2008
@@ -58,7 +58,9 @@
 		.frametype = AST_FRAME_VOICE,
 		.subclass = AST_FORMAT_SLINEAR,
 		.datalen = sizeof(ex_slin8),
-		.samples = sizeof(ex_slin8) / sizeof(ex_slin8[0]),
+		.samples = ARRAY_LEN(ex_slin8),
+		.mallocd = 0,
+		.offset = 0,
 		.src = __PRETTY_FUNCTION__,
 		.data.ptr = ex_slin8,
 	};
@@ -72,7 +74,9 @@
 		.frametype = AST_FRAME_VOICE,
 		.subclass = AST_FORMAT_SLINEAR16,
 		.datalen = sizeof(ex_slin16),
-		.samples = sizeof(ex_slin16) / sizeof(ex_slin16[0]),
+		.samples = ARRAY_LEN(ex_slin16),
+		.mallocd = 0,
+		.offset = 0,
 		.src = __PRETTY_FUNCTION__,
 		.data.ptr = ex_slin16,
 	};




More information about the svn-commits mailing list