From: Russell Bryant Date: Tue, 3 Apr 2007 22:33:03 +0000 (+0000) Subject: Add support for RTP packetization in chan_jingle and chan_gtalk. X-Git-Tag: 1.6.0-beta1~3^2~2914 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2ddaaf033e3897b27d068b5cd0aed06583b802f;p=thirdparty%2Fasterisk.git Add support for RTP packetization in chan_jingle and chan_gtalk. (issue #9416, phsultan) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60011 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_gtalk.c b/channels/chan_gtalk.c index 4958ccdb4e..bab6f92172 100644 --- a/channels/chan_gtalk.c +++ b/channels/chan_gtalk.c @@ -857,6 +857,9 @@ static struct gtalk_pvt *gtalk_alloc(struct gtalk *client, const char *us, const if (!(tmp = ast_calloc(1, sizeof(*tmp)))) { return NULL; } + + memcpy(&tmp->prefs, &client->prefs, sizeof(struct ast_codec_pref)); + if (sid) { ast_copy_string(tmp->sid, sid, sizeof(tmp->sid)); ast_copy_string(tmp->them, them, sizeof(tmp->them)); @@ -917,6 +920,11 @@ static struct ast_channel *gtalk_new(struct gtalk *client, struct gtalk_pvt *i, what = i->capability; else what = global_capability; + + /* Set Frame packetization */ + if (i->rtp) + ast_rtp_codec_setpref(i->rtp, &i->prefs); + tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK); fmt = ast_best_codec(tmp->nativeformats); diff --git a/channels/chan_jingle.c b/channels/chan_jingle.c index 1d30324655..87fb379550 100644 --- a/channels/chan_jingle.c +++ b/channels/chan_jingle.c @@ -726,6 +726,9 @@ static struct jingle_pvt *jingle_alloc(struct jingle *client, const char *from, if (!(tmp = ast_calloc(1, sizeof(*tmp)))) { return NULL; } + + memcpy(&tmp->prefs, &client->prefs, sizeof(tmp->prefs)); + if (sid) { ast_copy_string(tmp->sid, sid, sizeof(tmp->sid)); ast_copy_string(tmp->from, from, sizeof(tmp->from)); @@ -777,6 +780,11 @@ static struct ast_channel *jingle_new(struct jingle *client, struct jingle_pvt * what = i->capability; else what = global_capability; + + /* Set Frame packetization */ + if (i->rtp) + ast_rtp_codec_setpref(i->rtp, &i->prefs); + tmp->nativeformats = ast_codec_choose(&i->prefs, what, 1) | (i->jointcapability & AST_FORMAT_VIDEO_MASK); fmt = ast_best_codec(tmp->nativeformats); diff --git a/doc/rtp-packetization.txt b/doc/rtp-packetization.txt index 647375a983..c558a538ea 100644 --- a/doc/rtp-packetization.txt +++ b/doc/rtp-packetization.txt @@ -11,6 +11,8 @@ or global level: chan_skinny chan_h323 chan_ooh323 (Asterisk-Addons) + chan_gtalk + chan_jingle Configuration -------