Changeset 3239 for pjproject/trunk
- Timestamp:
- Jul 15, 2010 2:45:47 PM (14 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r3067 r3239 431 431 #endif 432 432 433 434 /** 435 * Specify whether RTCP statistics includes raw jitter statistics. 436 * Raw jitter is defined as absolute value of network transit time 437 * difference of two consecutive packets; refering to "difference D" 438 * term in interarrival jitter calculation in RFC 3550 section 6.4.1. 439 * 440 * Default: 0 (no). 441 */ 442 #ifndef PJMEDIA_RTCP_STAT_HAS_RAW_JITTER 443 # define PJMEDIA_RTCP_STAT_HAS_RAW_JITTER 0 444 #endif 445 446 447 /** 448 * Specify whether RTCP statistics includes IP Delay Variation statistics. 449 * IPDV is defined as network transit time difference of two consecutive 450 * packets. The IPDV statistic can be useful to inspect clock skew existance 451 * and level, e.g: when the IPDV mean values were stable in positive numbers, 452 * then the remote clock (used in sending RTP packets) is faster than local 453 * system clock. Ideally, the IPDV mean values are always equal to 0. 454 * 455 * Default: 0 (no). 456 */ 457 #ifndef PJMEDIA_RTCP_STAT_HAS_IPDV 458 # define PJMEDIA_RTCP_STAT_HAS_IPDV 0 459 #endif 460 461 433 462 /** 434 463 * Specify whether RTCP XR support should be built into PJMEDIA. Disabling -
pjproject/trunk/pjmedia/include/pjmedia/rtcp.h
r3237 r3239 215 215 pj_uint32_t rtp_tx_last_ts; /**< Last TX RTP timestamp. */ 216 216 pj_uint16_t rtp_tx_last_seq;/**< Last TX RTP sequence. */ 217 218 #if defined(PJMEDIA_RTCP_STAT_HAS_IPDV) && PJMEDIA_RTCP_STAT_HAS_IPDV!=0 219 pj_math_stat rx_ipdv;/**< Statistics of IP packet delay 220 variation in receiving direction 221 (in usec). */ 222 #endif 223 224 #if defined(PJMEDIA_RTCP_STAT_HAS_RAW_JITTER) && PJMEDIA_RTCP_STAT_HAS_RAW_JITTER!=0 225 pj_math_stat rx_raw_jitter;/**< Statistic of raw jitter in 226 receiving direction 227 (in usec). */ 228 #endif 217 229 }; 218 230 -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r3237 r3239 154 154 pj_math_stat_init(&stat->tx.jitter); 155 155 156 #if defined(PJMEDIA_RTCP_STAT_HAS_IPDV) && PJMEDIA_RTCP_STAT_HAS_IPDV!=0 157 pj_math_stat_init(&stat->rx_ipdv); 158 #endif 159 160 #if defined(PJMEDIA_RTCP_STAT_HAS_RAW_JITTER) && PJMEDIA_RTCP_STAT_HAS_RAW_JITTER!=0 161 pj_math_stat_init(&stat->rx_raw_jitter); 162 #endif 163 156 164 pj_gettimeofday(&now); 157 165 stat->start = now; … … 361 369 pj_int32_t d; 362 370 pj_uint32_t jitter; 363 371 364 372 d = transit - sess->transit; 365 sess->transit = transit;366 373 if (d < 0) 367 374 d = -d; … … 382 389 383 390 391 #if defined(PJMEDIA_RTCP_STAT_HAS_RAW_JITTER) && PJMEDIA_RTCP_STAT_HAS_RAW_JITTER!=0 392 { 393 pj_uint32_t raw_jitter; 394 395 /* Convert raw jitter unit from samples to usec */ 396 if (d < 4294) 397 raw_jitter = d * 1000000 / sess->clock_rate; 398 else { 399 raw_jitter = d * 1000 / sess->clock_rate; 400 raw_jitter *= 1000; 401 } 402 403 /* Update jitter stat */ 404 pj_math_stat_update(&sess->stat.rx_raw_jitter, raw_jitter); 405 } 406 #endif 407 408 409 #if defined(PJMEDIA_RTCP_STAT_HAS_IPDV) && PJMEDIA_RTCP_STAT_HAS_IPDV!=0 410 { 411 pj_int32_t ipdv; 412 413 ipdv = transit - sess->transit; 414 /* Convert IPDV unit from samples to usec */ 415 if (ipdv > -2147 && ipdv < 2147) 416 ipdv = ipdv * 1000000 / (int)sess->clock_rate; 417 else { 418 ipdv = ipdv * 1000 / (int)sess->clock_rate; 419 ipdv *= 1000; 420 } 421 422 /* Update jitter stat */ 423 pj_math_stat_update(&sess->stat.rx_ipdv, ipdv); 424 } 425 #endif 426 384 427 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 385 428 pjmedia_rtcp_xr_rx_rtp(&sess->xr_session, seq, … … 390 433 -1, 0); /* toh */ 391 434 #endif 435 436 /* Update session transit */ 437 sess->transit = transit; 392 438 } 393 439 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3222 r3239 2248 2248 "%s (msec) min avg max last dev\n" 2249 2249 "%s loss period: %7.3f %7.3f %7.3f %7.3f %7.3f\n" 2250 "%s jitter : %7.3f %7.3f %7.3f %7.3f %7.3f%s", 2250 "%s jitter : %7.3f %7.3f %7.3f %7.3f %7.3f" 2251 #if defined(PJMEDIA_RTCP_STAT_HAS_RAW_JITTER) && PJMEDIA_RTCP_STAT_HAS_RAW_JITTER!=0 2252 "\n" 2253 "%s raw jitter : %7.3f %7.3f %7.3f %7.3f %7.3f" 2254 #endif 2255 #if defined(PJMEDIA_RTCP_STAT_HAS_IPDV) && PJMEDIA_RTCP_STAT_HAS_IPDV!=0 2256 "\n" 2257 "%s IPDV : %7.3f %7.3f %7.3f %7.3f %7.3f" 2258 #endif 2259 "%s", 2251 2260 indent, info.stream_info[i].fmt.pt, 2252 2261 last_update, … … 2278 2287 stat.rx.jitter.last / 1000.0, 2279 2288 pj_math_stat_get_stddev(&stat.rx.jitter) / 1000.0, 2289 #if defined(PJMEDIA_RTCP_STAT_HAS_RAW_JITTER) && PJMEDIA_RTCP_STAT_HAS_RAW_JITTER!=0 2290 indent, 2291 stat.rx_raw_jitter.min / 1000.0, 2292 stat.rx_raw_jitter.mean / 1000.0, 2293 stat.rx_raw_jitter.max / 1000.0, 2294 stat.rx_raw_jitter.last / 1000.0, 2295 pj_math_stat_get_stddev(&stat.rx_raw_jitter) / 1000.0, 2296 #endif 2297 #if defined(PJMEDIA_RTCP_STAT_HAS_IPDV) && PJMEDIA_RTCP_STAT_HAS_IPDV!=0 2298 indent, 2299 stat.rx_ipdv.min / 1000.0, 2300 stat.rx_ipdv.mean / 1000.0, 2301 stat.rx_ipdv.max / 1000.0, 2302 stat.rx_ipdv.last / 1000.0, 2303 pj_math_stat_get_stddev(&stat.rx_ipdv) / 1000.0, 2304 #endif 2280 2305 "" 2281 2306 );
Note: See TracChangeset
for help on using the changeset viewer.