Ignore:
Timestamp:
May 17, 2008 2:54:18 PM (16 years ago)
Author:
nanang
Message:

More on ticket #535: updated files using and related to math.h

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/streamutil.c

    r1943 r1961  
    769769           "    total %s packets %sB received (%sB +IP hdr)%s\n" 
    770770           "    pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" 
    771            "          (msec)    min     avg     max     last\n" 
    772            "    loss period: %7.3f %7.3f %7.3f %7.3f%s\n" 
    773            "    jitter     : %7.3f %7.3f %7.3f %7.3f%s\n", 
     771           "          (msec)    min     avg     max     last    dev\n" 
     772           "    loss period: %7.3f %7.3f %7.3f %7.3f %7.3f%s\n" 
     773           "    jitter     : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", 
    774774           last_update, 
    775775           good_number(packets, stat.rx.pkt), 
     
    785785           "", 
    786786           stat.rx.loss_period.min / 1000.0,  
    787            stat.rx.loss_period.avg / 1000.0,  
     787           stat.rx.loss_period.mean / 1000.0,  
    788788           stat.rx.loss_period.max / 1000.0, 
    789789           stat.rx.loss_period.last / 1000.0, 
     790           pj_math_stat_get_stddev(&stat.rx.loss_period) / 1000.0, 
    790791           "", 
    791792           stat.rx.jitter.min / 1000.0, 
    792            stat.rx.jitter.avg / 1000.0, 
     793           stat.rx.jitter.mean / 1000.0, 
    793794           stat.rx.jitter.max / 1000.0, 
    794795           stat.rx.jitter.last / 1000.0, 
     796           pj_math_stat_get_stddev(&stat.rx.jitter) / 1000.0, 
    795797           "" 
    796798           ); 
     
    812814           "    total %s packets %sB sent (%sB +IP hdr)%s\n" 
    813815           "    pkt loss=%d (%3.1f%%), dup=%d (%3.1f%%), reorder=%d (%3.1f%%)%s\n" 
    814            "          (msec)    min     avg     max     last\n" 
    815            "    loss period: %7.3f %7.3f %7.3f %7.3f%s\n" 
    816            "    jitter     : %7.3f %7.3f %7.3f %7.3f%s\n", 
     816           "          (msec)    min     avg     max     last    dev\n" 
     817           "    loss period: %7.3f %7.3f %7.3f %7.3f %7.3f%s\n" 
     818           "    jitter     : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n", 
    817819           last_update, 
    818820           good_number(packets, stat.tx.pkt), 
     
    828830           "", 
    829831           stat.tx.loss_period.min / 1000.0,  
    830            stat.tx.loss_period.avg / 1000.0,  
     832           stat.tx.loss_period.mean / 1000.0,  
    831833           stat.tx.loss_period.max / 1000.0, 
    832834           stat.tx.loss_period.last / 1000.0, 
     835           pj_math_stat_get_stddev(&stat.tx.loss_period) / 1000.0, 
    833836           "", 
    834837           stat.tx.jitter.min / 1000.0, 
    835            stat.tx.jitter.avg / 1000.0, 
     838           stat.tx.jitter.mean / 1000.0, 
    836839           stat.tx.jitter.max / 1000.0, 
    837840           stat.tx.jitter.last / 1000.0, 
     841           pj_math_stat_get_stddev(&stat.tx.jitter) / 1000.0, 
    838842           "" 
    839843           ); 
    840844 
    841845 
    842     printf(" RTT delay     : %7.3f %7.3f %7.3f %7.3f%s\n",  
     846    printf(" RTT delay     : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n",  
    843847           stat.rtt.min / 1000.0, 
    844            stat.rtt.avg / 1000.0, 
     848           stat.rtt.mean / 1000.0, 
    845849           stat.rtt.max / 1000.0, 
    846850           stat.rtt.last / 1000.0, 
     851           pj_math_stat_get_stddev(&stat.rtt) / 1000.0, 
    847852           "" 
    848853           ); 
     
    886891            SAMPLES_TO_USEC(jmean, xr_stat.rx.stat_sum.jitter.mean,  
    887892                            port->info.clock_rate); 
    888             SAMPLES_TO_USEC(jdev, xr_stat.rx.stat_sum.jitter.dev,  
    889                             port->info.clock_rate); 
     893            SAMPLES_TO_USEC(jdev,  
     894                           pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.jitter), 
     895                           port->info.clock_rate); 
    890896            sprintf(jitter, "%7.3f %7.3f %7.3f %7.3f",  
    891897                    jmin/1000.0, jmean/1000.0, jmax/1000.0, jdev/1000.0); 
     
    898904                    xr_stat.rx.stat_sum.toh.mean, 
    899905                    xr_stat.rx.stat_sum.toh.max, 
    900                     xr_stat.rx.stat_sum.toh.dev); 
     906                    pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.toh)); 
    901907        } else 
    902908            sprintf(toh, "(report not available)"); 
     
    948954            SAMPLES_TO_USEC(jmean, xr_stat.tx.stat_sum.jitter.mean,  
    949955                            port->info.clock_rate); 
    950             SAMPLES_TO_USEC(jdev, xr_stat.tx.stat_sum.jitter.dev,  
    951                             port->info.clock_rate); 
     956            SAMPLES_TO_USEC(jdev,  
     957                           pj_math_stat_get_stddev(&xr_stat.tx.stat_sum.jitter), 
     958                           port->info.clock_rate); 
    952959            sprintf(jitter, "%7.3f %7.3f %7.3f %7.3f",  
    953960                    jmin/1000.0, jmean/1000.0, jmax/1000.0, jdev/1000.0); 
     
    960967                    xr_stat.tx.stat_sum.toh.mean, 
    961968                    xr_stat.tx.stat_sum.toh.max, 
    962                     xr_stat.tx.stat_sum.toh.dev); 
     969                    pj_math_stat_get_stddev(&xr_stat.rx.stat_sum.toh)); 
    963970        } else 
    964971            sprintf(toh,    "(report not available)"); 
     
    11691176 
    11701177 
    1171         /* RTT delay, need this? */ 
    1172         printf("          (msec)    min     avg     max     last\n"); 
    1173         printf(" RTT delay     : %7.3f %7.3f %7.3f %7.3f%s\n",  
     1178        /* RTT delay (by receiver side) */ 
     1179        printf("          (msec)    min     avg     max     last    dev\n"); 
     1180        printf(" RTT delay     : %7.3f %7.3f %7.3f %7.3f %7.3f%s\n",  
    11741181               xr_stat.rtt.min / 1000.0, 
    1175                xr_stat.rtt.avg / 1000.0, 
     1182               xr_stat.rtt.mean / 1000.0, 
    11761183               xr_stat.rtt.max / 1000.0, 
    11771184               xr_stat.rtt.last / 1000.0, 
     1185               pj_math_stat_get_stddev(&xr_stat.rtt) / 1000.0, 
    11781186               "" 
    11791187               ); 
Note: See TracChangeset for help on using the changeset viewer.