aboutsummaryrefslogtreecommitdiffstats
path: root/translate.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 16:56:50 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-31 16:56:50 +0000
commit1264d306ef99444c139d5467f47ae6bc50a296b2 (patch)
tree24a5e287490aa56d6fad0961d8832f1ba7eea1fd /translate.c
parente625fbb2b0a0a5c31c3c18cf4ee225d54b73c2ba (diff)
Add support for using a jitterbuffer for RTP on bridged calls. This includes
a new implementation of a fixed size jitterbuffer, as well as support for the existing adaptive jitterbuffer implementation. (issue #3854, Slav Klenov) Thank you very much to Slav Klenov of Securax and all of the people involved in the testing of this feature for all of your hard work! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31052 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'translate.c')
-rw-r--r--translate.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/translate.c b/translate.c
index d71381753..2db3525ab 100644
--- a/translate.c
+++ b/translate.c
@@ -154,6 +154,12 @@ static int framein(struct ast_trans_pvt *pvt, struct ast_frame *f)
int16_t *dst = (int16_t *)pvt->outbuf;
int ret;
int samples = pvt->samples; /* initial value */
+
+ /* Copy the last in jb timing info to the pvt */
+ pvt->f.has_timing_info = f->has_timing_info;
+ pvt->f.ts = f->ts;
+ pvt->f.len = f->len;
+ pvt->f.seqno = f->seqno;
if (f->samples == 0) {
ast_log(LOG_WARNING, "no samples for %s\n", pvt->t->name);
@@ -285,6 +291,15 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
struct ast_trans_pvt *p = path;
struct ast_frame *out = f;
struct timeval delivery;
+ int has_timing_info;
+ long ts;
+ long len;
+ int seqno;
+
+ has_timing_info = f->has_timing_info;
+ ts = f->ts;
+ len = f->len;
+ seqno = f->seqno;
/* XXX hmmm... check this below */
if (!ast_tvzero(f->delivery)) {
@@ -331,6 +346,12 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *path, struct ast_frame *f,
path->nextout = ast_tvadd(path->nextout, ast_samp2tv( out->samples, 8000));
} else {
out->delivery = ast_tv(0, 0);
+ out->has_timing_info = has_timing_info;
+ if (has_timing_info) {
+ out->ts = ts;
+ out->len = len;
+ out->seqno = seqno;
+ }
}
/* Invalidate prediction if we're entering a silence period */
if (out->frametype == AST_FRAME_CNG)