diff options
author | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-17 21:35:23 +0000 |
---|---|---|
committer | qwell <qwell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-10-17 21:35:23 +0000 |
commit | ba0313e902c8570c0f164892b591197ddc91b4c0 (patch) | |
tree | c905fae44bb51b0871baf6bea17f10d715963052 /codecs/codec_lpc10.c | |
parent | 236e62078c388457c14a6bbc1c007b1c83a3edd7 (diff) |
Merge codec_consistency branch. This should make sample usage much happier.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@150729 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'codecs/codec_lpc10.c')
-rw-r--r-- | codecs/codec_lpc10.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/codecs/codec_lpc10.c b/codecs/codec_lpc10.c index 9237f70fe..33ccbb241 100644 --- a/codecs/codec_lpc10.c +++ b/codecs/codec_lpc10.c @@ -39,8 +39,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #include "lpc10/lpc10.h" /* Sample frame data */ -#include "slin_lpc10_ex.h" -#include "lpc10_slin_ex.h" +#include "asterisk/slin.h" +#include "ex_lpc10.h" /* We use a very strange format here... I have no idea why... The frames are 180 samples long, which isn't even an even number of milliseconds... Not only that @@ -75,37 +75,6 @@ static int lpc10_dec_new(struct ast_trans_pvt *pvt) return (tmp->lpc10.dec = create_lpc10_decoder_state()) ? 0 : -1; } -static struct ast_frame *lintolpc10_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.datalen = sizeof(slin_lpc10_ex); - /* Assume 8000 Hz */ - f.samples = LPC10_SAMPLES_PER_FRAME; - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = slin_lpc10_ex; - return &f; -} - -static struct ast_frame *lpc10tolin_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_LPC10; - f.datalen = sizeof(lpc10_slin_ex); - /* 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 = lpc10_slin_ex; - return &f; -} - static void extract_bits(INT32 *bits, unsigned char *c) { int x; @@ -229,7 +198,7 @@ static struct ast_translator lpc10tolin = { .newpvt = lpc10_dec_new, .framein = lpc10tolin_framein, .destroy = lpc10_destroy, - .sample = lpc10tolin_sample, + .sample = lpc10_sample, .desc_size = sizeof(struct lpc10_coder_pvt), .buffer_samples = BUFFER_SAMPLES, .plc_samples = LPC10_SAMPLES_PER_FRAME, @@ -244,7 +213,7 @@ static struct ast_translator lintolpc10 = { .framein = lintolpc10_framein, .frameout = lintolpc10_frameout, .destroy = lpc10_destroy, - .sample = lintolpc10_sample, + .sample = slin8_sample, .desc_size = sizeof(struct lpc10_coder_pvt), .buffer_samples = BUFFER_SAMPLES, .buf_size = LPC10_BYTES_IN_COMPRESSED_FRAME * (1 + BUFFER_SAMPLES / LPC10_SAMPLES_PER_FRAME), |