diff options
author | Benny Prijono <bennylp@teluu.com> | 2009-07-29 12:14:21 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2009-07-29 12:14:21 +0000 |
commit | aa3e2f264f921125ee102ff6691d2fc655f7d101 (patch) | |
tree | e66ddab9e81ac02f644018d4e0817c5fb0226eae /pjmedia/src/pjmedia/stream.c | |
parent | a7ef07a46af14800cffbebc0fc222c60b52b9e30 (diff) |
Ticket #923: New API to retrieve current jitter buffer state from a stream/session
- added pjmedia_session_get_stream_stat_jbuf() and pjmedia_session_get_stream_stat_jbuf()
- fixed const correctness in pjmedia_jbuf_get_state(), jb_framelist_size(), and pj_math_stat_get_stddev(),
- modify the jitter buffer statistic log message printed by stream (it contains newlines)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2844 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia/stream.c')
-rw-r--r-- | pjmedia/src/pjmedia/stream.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index 35b6dc90..587370e3 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -327,6 +327,7 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) */ if (frame_type != stream->jb_last_frm) { pjmedia_jb_state jb_state; + const char *with_plc = ""; /* Activate PLC to smoothen the missing frame */ if (stream->codec->op->recover && @@ -346,13 +347,14 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) } while (samples_count < samples_required); + with_plc = ", plc invoked"; } /* Report the state of jitter buffer */ pjmedia_jbuf_get_state(stream->jb, &jb_state); PJ_LOG(5,(stream->port.info.name.ptr, - "Jitter buffer empty (prefetch=%d)", - jb_state.prefetch)); + "Jitter buffer empty (prefetch=%d)%s", + jb_state.prefetch, with_plc)); } @@ -1879,7 +1881,6 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt, //jb_init = (jb_min_pre + jb_max_pre) / 2; jb_init = 0; - /* Create jitter buffer */ status = pjmedia_jbuf_create(pool, &stream->port.info.name, stream->frame_size, @@ -2172,6 +2173,16 @@ PJ_DEF(pj_status_t) pjmedia_stream_get_stat_xr( const pjmedia_stream *stream, #endif /* + * Get jitter buffer state. + */ +PJ_DEF(pj_status_t) pjmedia_stream_get_stat_jbuf(const pjmedia_stream *stream, + pjmedia_jb_state *state) +{ + PJ_ASSERT_RETURN(stream && state, PJ_EINVAL); + return pjmedia_jbuf_get_state(stream->jb, state); +} + +/* * Pause stream. */ PJ_DEF(pj_status_t) pjmedia_stream_pause( pjmedia_stream *stream, |