Changeset 3907 for pjproject


Ignore:
Timestamp:
Dec 12, 2011 8:06:58 AM (13 years ago)
Author:
bennylp
Message:

Fixed #1422: Option to configure or disable RTCP RTT normalization (thanks Lars Helgeson for the patch)

Location:
pjproject/branches/1.x/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/include/pjmedia/config.h

    r3814 r3907  
    454454#endif 
    455455 
     456/** 
     457 * Specify the factor with wich RTCP RTT statistics should be normalized  
     458 * if exceptionally high. For e.g. mobile networks with potentially large 
     459 * fluctuations, this might be unwanted. 
     460 * 
     461 * Use (0) to disable this feature. 
     462 * 
     463 * Default: 3. 
     464 */ 
     465#ifndef PJMEDIA_RTCP_NORMALIZE_FACTOR 
     466#   define PJMEDIA_RTCP_NORMALIZE_FACTOR        3 
     467#endif 
     468 
    456469 
    457470/** 
  • pjproject/branches/1.x/pjmedia/src/pjmedia/rtcp.c

    r3553 r3907  
    616616            } 
    617617 
    618             /* "Normalize" rtt value that is exceptionally high. 
    619              * For such values, "normalize" the rtt to be three times 
    620              * the average value. 
     618#if defined(PJMEDIA_RTCP_NORMALIZE_FACTOR) && PJMEDIA_RTCP_NORMALIZE_FACTOR!=0 
     619            /* "Normalize" rtt value that is exceptionally high. For such 
     620             * values, "normalize" the rtt to be PJMEDIA_RTCP_NORMALIZE_FACTOR 
     621             * times the average value. 
    621622             */ 
    622             if (rtt > ((unsigned)sess->stat.rtt.mean*3) && sess->stat.rtt.n!=0) 
     623            if (rtt > ((unsigned)sess->stat.rtt.mean * 
     624                       PJMEDIA_RTCP_NORMALIZE_FACTOR) && sess->stat.rtt.n!=0) 
    623625            { 
    624626                unsigned orig_rtt = rtt; 
    625                 rtt = sess->stat.rtt.mean*3; 
    626                 PJ_LOG(5,(sess->name,  
     627                rtt = sess->stat.rtt.mean * PJMEDIA_RTCP_NORMALIZE_FACTOR; 
     628                PJ_LOG(5,(sess->name, 
    627629                          "RTT value %d usec is normalized to %d usec", 
    628630                          orig_rtt, rtt)); 
    629631            } 
    630          
     632#endif 
    631633            TRACE_((sess->name, "RTCP RTT is set to %d usec", rtt)); 
    632634 
Note: See TracChangeset for help on using the changeset viewer.