Changeset 2310 for pjproject/trunk


Ignore:
Timestamp:
Sep 23, 2008 4:55:21 PM (16 years ago)
Author:
nanang
Message:

Ticket #638:

  • Jitter buffer shrinking is done based on max_hist_level (recent maximum burst level).
  • Updated jitter buffer to maintain max_hist_level, instead of resetting it each time current level is updated.
  • Updated default jitter buffer size in stream.c from 360ms to 500ms to accomodate more burst level.
Location:
pjproject/trunk/pjmedia/src/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/jbuf.c

    r2197 r2310  
    402402    int diff, cur_size; 
    403403 
    404     /* Update jb_max_size */ 
    405404    cur_size = jb_framelist_size(&jb->jb_framelist); 
    406405 
     
    423422             */ 
    424423            if (jb->jb_stable_hist > STABLE_HISTORY_LIMIT) { 
     424                 
     425                /* Update max_hist_level. */ 
     426                jb->jb_max_hist_level = jb->jb_prefetch; 
     427 
    425428                diff = (jb->jb_prefetch - jb->jb_max_hist_level) / 3; 
    426429 
     
    432435                    jb->jb_prefetch = jb->jb_min_prefetch; 
    433436 
     437                jb->jb_stable_hist = 0; 
     438 
    434439                TRACE__((jb->name.ptr,"jb updated(1), prefetch=%d, size=%d",  
    435440                         jb->jb_prefetch, cur_size)); 
    436  
    437                 jb->jb_stable_hist = 0; 
    438                 jb->jb_max_hist_level = 0; 
    439441            } 
    440442        } 
     
    448450            if (jb->jb_prefetch > jb->jb_max_prefetch) 
    449451                jb->jb_prefetch = jb->jb_max_prefetch; 
     452 
    450453            jb->jb_stable_hist = 0; 
    451             jb->jb_max_hist_level = 0; 
     454            // Keep max_hist_level. 
     455            //jb->jb_max_hist_level = 0; 
    452456 
    453457            TRACE__((jb->name.ptr,"jb updated(2), prefetch=%d, size=%d",  
     
    462466 
    463467    /* These code is used for shortening the delay in the jitter buffer. */ 
    464     diff = cur_size - jb->jb_prefetch; 
     468    // Shrinking based on max_hist_level (recent max level). 
     469    //diff = cur_size - jb->jb_prefetch; 
     470    diff = cur_size - jb->jb_max_hist_level; 
    465471    if (diff > SAFE_SHRINKING_DIFF &&  
    466472        jb->jb_framelist.flist_origin-jb->jb_last_del_seq > jb->jb_min_shrink_gap) 
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r2265 r2310  
    16681668        jb_max = info->jb_max; 
    16691669    else 
    1670         jb_max = 360 / stream->codec_param.info.frm_ptime; 
     1670        jb_max = 500 / stream->codec_param.info.frm_ptime; 
    16711671 
    16721672    if (info->jb_min_pre >= 0) 
Note: See TracChangeset for help on using the changeset viewer.