summaryrefslogtreecommitdiff
path: root/codecs/codec_g726.c
diff options
context:
space:
mode:
authorJason Parker <jparker@digium.com>2008-10-17 21:35:23 +0000
committerJason Parker <jparker@digium.com>2008-10-17 21:35:23 +0000
commitae0a736353433856d8e9eacf2a57dd23825d6005 (patch)
treec905fae44bb51b0871baf6bea17f10d715963052 /codecs/codec_g726.c
parent805556773fe8812d7a3e5f1012bcc2d9cb98842b (diff)
Merge codec_consistency branch. This should make sample usage much happier.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'codecs/codec_g726.c')
-rw-r--r--codecs/codec_g726.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/codecs/codec_g726.c b/codecs/codec_g726.c
index 38d461a1c..cce448f1b 100644
--- a/codecs/codec_g726.c
+++ b/codecs/codec_g726.c
@@ -58,9 +58,8 @@ typedef long long sint64;
#define BUF_SHIFT 5
/* Sample frame data */
-
-#include "slin_g726_ex.h"
-#include "g726_slin_ex.h"
+#include "asterisk/slin.h"
+#include "ex_g726.h"
/*
* The following is the definition of the state structure
@@ -786,41 +785,13 @@ static int g726tog726aal2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f
return 0;
}
-static struct ast_frame *g726tolin_sample(void)
-{
- static struct ast_frame f = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_G726,
- .datalen = sizeof(g726_slin_ex),
- .samples = sizeof(g726_slin_ex) * 2, /* 2 samples per byte */
- .src = __PRETTY_FUNCTION__,
- .data.ptr = g726_slin_ex,
- };
-
- return &f;
-}
-
-static struct ast_frame *lintog726_sample (void)
-{
- static struct ast_frame f = {
- .frametype = AST_FRAME_VOICE,
- .subclass = AST_FORMAT_SLINEAR,
- .datalen = sizeof(slin_g726_ex),
- .samples = sizeof(slin_g726_ex) / 2, /* 1 sample per 2 bytes */
- .src = __PRETTY_FUNCTION__,
- .data.ptr = slin_g726_ex,
- };
-
- return &f;
-}
-
static struct ast_translator g726tolin = {
.name = "g726tolin",
.srcfmt = AST_FORMAT_G726,
.dstfmt = AST_FORMAT_SLINEAR,
.newpvt = lintog726_new, /* same for both directions */
.framein = g726tolin_framein,
- .sample = g726tolin_sample,
+ .sample = g726_sample,
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
@@ -833,7 +804,7 @@ static struct ast_translator lintog726 = {
.dstfmt = AST_FORMAT_G726,
.newpvt = lintog726_new, /* same for both directions */
.framein = lintog726_framein,
- .sample = lintog726_sample,
+ .sample = slin8_sample,
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES/2,
@@ -845,7 +816,7 @@ static struct ast_translator g726aal2tolin = {
.dstfmt = AST_FORMAT_SLINEAR,
.newpvt = lintog726_new, /* same for both directions */
.framein = g726aal2tolin_framein,
- .sample = g726tolin_sample,
+ .sample = g726_sample,
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES * 2,
@@ -858,7 +829,7 @@ static struct ast_translator lintog726aal2 = {
.dstfmt = AST_FORMAT_G726_AAL2,
.newpvt = lintog726_new, /* same for both directions */
.framein = lintog726aal2_framein,
- .sample = lintog726_sample,
+ .sample = slin8_sample,
.desc_size = sizeof(struct g726_coder_pvt),
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES / 2,
@@ -869,7 +840,7 @@ static struct ast_translator g726tog726aal2 = {
.srcfmt = AST_FORMAT_G726,
.dstfmt = AST_FORMAT_G726_AAL2,
.framein = g726tog726aal2_framein, /* same for both directions */
- .sample = lintog726_sample,
+ .sample = g726_sample,
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES,
};
@@ -879,7 +850,7 @@ static struct ast_translator g726aal2tog726 = {
.srcfmt = AST_FORMAT_G726_AAL2,
.dstfmt = AST_FORMAT_G726,
.framein = g726tog726aal2_framein, /* same for both directions */
- .sample = lintog726_sample,
+ .sample = g726_sample,
.buffer_samples = BUFFER_SAMPLES,
.buf_size = BUFFER_SAMPLES,
};