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_adpcm.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_adpcm.c')
-rw-r--r-- | codecs/codec_adpcm.c | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/codecs/codec_adpcm.c b/codecs/codec_adpcm.c index 20901151b..d43ed44d0 100644 --- a/codecs/codec_adpcm.c +++ b/codecs/codec_adpcm.c @@ -44,9 +44,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") #define BUFFER_SAMPLES 8096 /* size for the translation buffers */ /* Sample frame data */ - -#include "slin_adpcm_ex.h" -#include "adpcm_slin_ex.h" +#include "asterisk/slin.h" +#include "ex_adpcm.h" /* * Step size index shift table @@ -285,43 +284,12 @@ static struct ast_frame *lintoadpcm_frameout(struct ast_trans_pvt *pvt) } -/*! \brief AdpcmToLin_Sample */ -static struct ast_frame *adpcmtolin_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_ADPCM; - f.datalen = sizeof(adpcm_slin_ex); - f.samples = sizeof(adpcm_slin_ex) * 2; - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = adpcm_slin_ex; - return &f; -} - -/*! \brief LinToAdpcm_Sample */ -static struct ast_frame *lintoadpcm_sample(void) -{ - static struct ast_frame f; - f.frametype = AST_FRAME_VOICE; - f.subclass = AST_FORMAT_SLINEAR; - f.datalen = sizeof(slin_adpcm_ex); - /* Assume 8000 Hz */ - f.samples = sizeof(slin_adpcm_ex) / 2; - f.mallocd = 0; - f.offset = 0; - f.src = __PRETTY_FUNCTION__; - f.data.ptr = slin_adpcm_ex; - return &f; -} - static struct ast_translator adpcmtolin = { .name = "adpcmtolin", .srcfmt = AST_FORMAT_ADPCM, .dstfmt = AST_FORMAT_SLINEAR, .framein = adpcmtolin_framein, - .sample = adpcmtolin_sample, + .sample = adpcm_sample, .desc_size = sizeof(struct adpcm_decoder_pvt), .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES * 2, @@ -334,7 +302,7 @@ static struct ast_translator lintoadpcm = { .dstfmt = AST_FORMAT_ADPCM, .framein = lintoadpcm_framein, .frameout = lintoadpcm_frameout, - .sample = lintoadpcm_sample, + .sample = slin8_sample, .desc_size = sizeof (struct adpcm_encoder_pvt), .buffer_samples = BUFFER_SAMPLES, .buf_size = BUFFER_SAMPLES/ 2, /* 2 samples per byte */ |