diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-05-02 17:49:31 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-05-02 17:49:31 +0000 |
commit | 5d8878b9ed888fd6b8ab48889182a5633acba2b5 (patch) | |
tree | f16322c79612fb7644265876e96af81c36aaca8d /pjmedia | |
parent | 5dbe084a1baa4cdbdd146786160f58aa219a2020 (diff) |
Changed jbuf param name in stream_info, and generate random SSRC for RTP/RTCP instead of zero.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@428 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia')
-rw-r--r-- | pjmedia/include/pjmedia/stream.h | 5 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/session.c | 4 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 15 |
3 files changed, 16 insertions, 8 deletions
diff --git a/pjmedia/include/pjmedia/stream.h b/pjmedia/include/pjmedia/stream.h index 05007dc4..41f690bd 100644 --- a/pjmedia/include/pjmedia/stream.h +++ b/pjmedia/include/pjmedia/stream.h @@ -76,9 +76,8 @@ struct pjmedia_stream_info int tx_event_pt;/**< Outgoing pt for telephone-events. */ int rx_event_pt;/**< Incoming pt for telephone-events. */ pj_uint32_t ssrc; /**< RTP SSRC. */ - int jb_min; /**< Jitter buffer min delay. */ - int jb_max; /**< Jitter buffer max delay. */ - int jb_maxcnt; /**< Jitter buffer max delay. */ + int jb_init; /**< Jitter buffer init delay in msec. */ + int jb_max; /**< Jitter buffer max delay in msec. */ }; diff --git a/pjmedia/src/pjmedia/session.c b/pjmedia/src/pjmedia/session.c index fa62136f..c09926b8 100644 --- a/pjmedia/src/pjmedia/session.c +++ b/pjmedia/src/pjmedia/session.c @@ -24,6 +24,7 @@ #include <pj/string.h> #include <pj/assert.h> #include <pj/ctype.h> +#include <pj/rand.h> struct pjmedia_session @@ -334,7 +335,8 @@ PJ_DEF(pj_status_t) pjmedia_stream_info_from_sdp( } - /* Leave SSRC to zero. */ + /* Leave SSRC to random. */ + si->ssrc = pj_rand(); /* Leave jitter buffer parameter. */ diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index b35b54c5..d7a38df4 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -901,10 +901,17 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt, /* Create jitter buffer: */ - jbuf_init = 100 / (stream->port.info.samples_per_frame * 1000 / - info->fmt.clock_rate); - jbuf_max = 600 / (stream->port.info.samples_per_frame * 1000 / - info->fmt.clock_rate); + if (info->jb_init) + jbuf_init = info->jb_init; + else + jbuf_init = 60 / (stream->port.info.samples_per_frame * 1000 / + info->fmt.clock_rate); + + if (info->jb_max) + jbuf_max = info->jb_max; + else + jbuf_max = 240 / (stream->port.info.samples_per_frame * 1000 / + info->fmt.clock_rate); status = pjmedia_jbuf_create(pool, &stream->port.info.name, stream->frame_size, jbuf_init, jbuf_max, |