diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2008-05-17 14:54:18 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2008-05-17 14:54:18 +0000 |
commit | 99cee13d826450735fbe4d0891c8d286a861d4e8 (patch) | |
tree | 9491350404737c301bd4b7ddec84333cf5c6ef57 /pjsip-apps/src/samples | |
parent | a33c7aeaee65347f44c7da1612c904b7becb324f (diff) |
More on ticket #535: updated files using and related to math.h
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1961 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/samples')
-rw-r--r-- | pjsip-apps/src/samples/siprtp.c | 12 | ||||
-rw-r--r-- | pjsip-apps/src/samples/siprtp_report.c | 10 | ||||
-rw-r--r-- | pjsip-apps/src/samples/streamutil.c | 52 |
3 files changed, 41 insertions, 33 deletions
diff --git a/pjsip-apps/src/samples/siprtp.c b/pjsip-apps/src/samples/siprtp.c index a091d839..61179ef4 100644 --- a/pjsip-apps/src/samples/siprtp.c +++ b/pjsip-apps/src/samples/siprtp.c @@ -1659,7 +1659,7 @@ static void print_avg_stat(void) /* Jitter */ MIN_(min_stat.rx.jitter.min, audio->rtcp.stat.rx.jitter.min); MAX_(max_stat.rx.jitter.max, audio->rtcp.stat.rx.jitter.max); - AVG_(avg_stat.rx.jitter.avg, audio->rtcp.stat.rx.jitter.avg); + AVG_(avg_stat.rx.jitter.mean, audio->rtcp.stat.rx.jitter.mean); /* TX Statistisc: */ @@ -1692,13 +1692,13 @@ static void print_avg_stat(void) /* Jitter */ MIN_(min_stat.tx.jitter.min, audio->rtcp.stat.tx.jitter.min); MAX_(max_stat.tx.jitter.max, audio->rtcp.stat.tx.jitter.max); - AVG_(avg_stat.tx.jitter.avg, audio->rtcp.stat.tx.jitter.avg); + AVG_(avg_stat.tx.jitter.mean, audio->rtcp.stat.tx.jitter.mean); /* RTT */ MIN_(min_stat.rtt.min, audio->rtcp.stat.rtt.min); MAX_(max_stat.rtt.max, audio->rtcp.stat.rtt.max); - AVG_(avg_stat.rtt.avg, audio->rtcp.stat.rtt.avg); + AVG_(avg_stat.rtt.mean, audio->rtcp.stat.rtt.mean); ++count; } @@ -1767,7 +1767,7 @@ static void print_avg_stat(void) "packets", min_stat.rx.jitter.min/1000.0, - avg_stat.rx.jitter.avg/1000.0, + avg_stat.rx.jitter.mean/1000.0, max_stat.rx.jitter.max/1000.0, "ms", @@ -1798,13 +1798,13 @@ static void print_avg_stat(void) "packets", min_stat.tx.jitter.min/1000.0, - avg_stat.tx.jitter.avg/1000.0, + avg_stat.tx.jitter.mean/1000.0, max_stat.tx.jitter.max/1000.0, "ms", /* rtt */ min_stat.rtt.min/1000.0, - avg_stat.rtt.avg/1000.0, + avg_stat.rtt.mean/1000.0, max_stat.rtt.max/1000.0, "ms" ); diff --git a/pjsip-apps/src/samples/siprtp_report.c b/pjsip-apps/src/samples/siprtp_report.c index adba64d6..3c084459 100644 --- a/pjsip-apps/src/samples/siprtp_report.c +++ b/pjsip-apps/src/samples/siprtp_report.c @@ -160,12 +160,12 @@ static void print_call(int call_index) audio->rtcp.stat.rx.reorder * 100.0 / (audio->rtcp.stat.rx.pkt + audio->rtcp.stat.rx.loss), "", audio->rtcp.stat.rx.loss_period.min / 1000.0, - audio->rtcp.stat.rx.loss_period.avg / 1000.0, + audio->rtcp.stat.rx.loss_period.mean / 1000.0, audio->rtcp.stat.rx.loss_period.max / 1000.0, audio->rtcp.stat.rx.loss_period.last / 1000.0, "", audio->rtcp.stat.rx.jitter.min / 1000.0, - audio->rtcp.stat.rx.jitter.avg / 1000.0, + audio->rtcp.stat.rx.jitter.mean / 1000.0, audio->rtcp.stat.rx.jitter.max / 1000.0, audio->rtcp.stat.rx.jitter.last / 1000.0, "" @@ -204,12 +204,12 @@ static void print_call(int call_index) audio->rtcp.stat.tx.reorder * 100.0 / (audio->rtcp.stat.tx.pkt + audio->rtcp.stat.tx.loss), "", audio->rtcp.stat.tx.loss_period.min / 1000.0, - audio->rtcp.stat.tx.loss_period.avg / 1000.0, + audio->rtcp.stat.tx.loss_period.mean / 1000.0, audio->rtcp.stat.tx.loss_period.max / 1000.0, audio->rtcp.stat.tx.loss_period.last / 1000.0, "", audio->rtcp.stat.tx.jitter.min / 1000.0, - audio->rtcp.stat.tx.jitter.avg / 1000.0, + audio->rtcp.stat.tx.jitter.mean / 1000.0, audio->rtcp.stat.tx.jitter.max / 1000.0, audio->rtcp.stat.tx.jitter.last / 1000.0, "" @@ -219,7 +219,7 @@ static void print_call(int call_index) PJ_LOG(3, (THIS_FILE, " RTT delay : %7.3f %7.3f %7.3f %7.3f%s\n", audio->rtcp.stat.rtt.min / 1000.0, - audio->rtcp.stat.rtt.avg / 1000.0, + audio->rtcp.stat.rtt.mean / 1000.0, audio->rtcp.stat.rtt.max / 1000.0, audio->rtcp.stat.rtt.last / 1000.0, "" diff --git a/pjsip-apps/src/samples/streamutil.c b/pjsip-apps/src/samples/streamutil.c index dfd2ee54..29462c99 100644 --- a/pjsip-apps/src/samples/streamutil.c +++ b/pjsip-apps/src/samples/streamutil.c @@ -768,9 +768,9 @@ static void print_stream_stat(pjmedia_stream *stream) printf(" RX stat last update: %s\n" " total %s packets %sB received (%sB +IP hdr)%s\n" " pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" - " (msec) min avg max last\n" - " loss period: %7.3f %7.3f %7.3f %7.3f%s\n" - " jitter : %7.3f %7.3f %7.3f %7.3f%s\n", + " (msec) min avg max last dev\n" + " loss period: %7.3f %7.3f %7.3f %7.3f %7.3f%s\n" + " jitter : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", last_update, good_number(packets, stat.rx.pkt), good_number(bytes, stat.rx.bytes), @@ -784,14 +784,16 @@ static void print_stream_stat(pjmedia_stream *stream) stat.rx.reorder * 100.0 / (stat.rx.pkt + stat.rx.loss), "", stat.rx.loss_period.min / 1000.0, - stat.rx.loss_period.avg / 1000.0, + stat.rx.loss_period.mean / 1000.0, stat.rx.loss_period.max / 1000.0, stat.rx.loss_period.last / 1000.0, + pj_math_stat_get_stddev(&stat.rx.loss_period) / 1000.0, "", stat.rx.jitter.min / 1000.0, - stat.rx.jitter.avg / 1000.0, + stat.rx.jitter.mean / 1000.0, stat.rx.jitter.max / 1000.0, stat.rx.jitter.last / 1000.0, + pj_math_stat_get_stddev(&stat.rx.jitter) / 1000.0, "" ); @@ -811,9 +813,9 @@ static void print_stream_stat(pjmedia_stream *stream) printf(" TX stat last update: %s\n" " total %s packets %sB sent (%sB +IP hdr)%s\n" " pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" - " (msec) min avg max last\n" - " loss period: %7.3f %7.3f %7.3f %7.3f%s\n" - " jitter : %7.3f %7.3f %7.3f %7.3f%s\n", + " (msec) min avg max last dev\n" + " loss period: %7.3f %7.3f %7.3f %7.3f %7.3f%s\n" + " jitter : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", last_update, good_number(packets, stat.tx.pkt), good_number(bytes, stat.tx.bytes), @@ -827,23 +829,26 @@ static void print_stream_stat(pjmedia_stream *stream) stat.tx.reorder * 100.0 / (stat.tx.pkt + stat.tx.loss), "", stat.tx.loss_period.min / 1000.0, - stat.tx.loss_period.avg / 1000.0, + stat.tx.loss_period.mean / 1000.0, stat.tx.loss_period.max / 1000.0, stat.tx.loss_period.last / 1000.0, + pj_math_stat_get_stddev(&stat.tx.loss_period) / 1000.0, "", stat.tx.jitter.min / 1000.0, - stat.tx.jitter.avg / 1000.0, + stat.tx.jitter.mean / 1000.0, stat.tx.jitter.max / 1000.0, stat.tx.jitter.last / 1000.0, + pj_math_stat_get_stddev(&stat.tx.jitter) / 1000.0, "" ); - printf(" RTT delay : %7.3f %7.3f %7.3f %7.3f%s\n", + printf(" RTT delay : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", stat.rtt.min / 1000.0, - stat.rtt.avg / 1000.0, + stat.rtt.mean / 1000.0, stat.rtt.max / 1000.0, stat.rtt.last / 1000.0, + pj_math_stat_get_stddev(&stat.rtt) / 1000.0, "" ); @@ -885,8 +890,9 @@ static void print_stream_stat(pjmedia_stream *stream) port->info.clock_rate); SAMPLES_TO_USEC(jmean, xr_stat.rx.stat_sum.jitter.mean, port->info.clock_rate); - SAMPLES_TO_USEC(jdev, xr_stat.rx.stat_sum.jitter.dev, - port->info.clock_rate); + SAMPLES_TO_USEC(jdev, + pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.jitter), + port->info.clock_rate); sprintf(jitter, "%7.3f %7.3f %7.3f %7.3f", jmin/1000.0, jmean/1000.0, jmax/1000.0, jdev/1000.0); } else @@ -897,7 +903,7 @@ static void print_stream_stat(pjmedia_stream *stream) xr_stat.rx.stat_sum.toh.min, xr_stat.rx.stat_sum.toh.mean, xr_stat.rx.stat_sum.toh.max, - xr_stat.rx.stat_sum.toh.dev); + pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.toh)); } else sprintf(toh, "(report not available)"); @@ -947,8 +953,9 @@ static void print_stream_stat(pjmedia_stream *stream) port->info.clock_rate); SAMPLES_TO_USEC(jmean, xr_stat.tx.stat_sum.jitter.mean, port->info.clock_rate); - SAMPLES_TO_USEC(jdev, xr_stat.tx.stat_sum.jitter.dev, - port->info.clock_rate); + SAMPLES_TO_USEC(jdev, + pj_math_stat_get_stddev(&xr_stat.tx.stat_sum.jitter), + port->info.clock_rate); sprintf(jitter, "%7.3f %7.3f %7.3f %7.3f", jmin/1000.0, jmean/1000.0, jmax/1000.0, jdev/1000.0); } else @@ -959,7 +966,7 @@ static void print_stream_stat(pjmedia_stream *stream) xr_stat.tx.stat_sum.toh.min, xr_stat.tx.stat_sum.toh.mean, xr_stat.tx.stat_sum.toh.max, - xr_stat.tx.stat_sum.toh.dev); + pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.toh)); } else sprintf(toh, "(report not available)"); @@ -1168,13 +1175,14 @@ static void print_stream_stat(pjmedia_stream *stream) ); - /* RTT delay, need this? */ - printf(" (msec) min avg max last\n"); - printf(" RTT delay : %7.3f %7.3f %7.3f %7.3f%s\n", + /* RTT delay (by receiver side) */ + printf(" (msec) min avg max last dev\n"); + printf(" RTT delay : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", xr_stat.rtt.min / 1000.0, - xr_stat.rtt.avg / 1000.0, + xr_stat.rtt.mean / 1000.0, xr_stat.rtt.max / 1000.0, xr_stat.rtt.last / 1000.0, + pj_math_stat_get_stddev(&xr_stat.rtt) / 1000.0, "" ); } while (0); |