Changeset 629


Ignore:
Timestamp:
Jul 26, 2006 5:05:39 PM (18 years ago)
Author:
bennylp
Message:

Added --ptime and --no-vad option in pjsua

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r620 r629  
    117117    puts  ("  --rtp-port=N        Base port to try for RTP (default=4000)"); 
    118118    puts  ("  --quality=N         Specify media quality (0-10, default=10)"); 
    119     /* 
    120119    puts  ("  --ptime=MSEC        Override codec ptime to MSEC (default=specific)"); 
    121     */ 
     120    puts  ("  --no-vad            Disable VAD/silence detector (default=vad enabled)"); 
     121 
    122122    puts  (""); 
    123123    puts  ("Buddy List (can be more than one):"); 
     
    249249           OPT_AUTO_CONF, OPT_CLOCK_RATE, 
    250250           OPT_PLAY_FILE, OPT_RTP_PORT, OPT_ADD_CODEC, 
    251            OPT_COMPLEXITY, OPT_QUALITY, OPT_PTIME, 
     251           OPT_COMPLEXITY, OPT_QUALITY, OPT_PTIME, OPT_NO_VAD, 
    252252           OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS,  
    253253           OPT_DURATION, OPT_NO_TCP, OPT_NO_UDP, 
     
    290290        { "quality",    1, 0, OPT_QUALITY}, 
    291291        { "ptime",      1, 0, OPT_PTIME}, 
     292        { "no-vad",     0, 0, OPT_NO_VAD}, 
    292293        { "next-account",0,0, OPT_NEXT_ACCOUNT}, 
    293294        { "next-cred",  0, 0, OPT_NEXT_CRED}, 
     
    592593            cfg->duration = my_atoi(pj_optarg); 
    593594            break; 
     595        */ 
    594596 
    595597        case OPT_PTIME: 
    596             cfg->ptime = my_atoi(pj_optarg); 
    597             if (cfg->ptime < 10 || cfg->ptime > 1000) { 
     598            cfg->media_cfg.ptime = my_atoi(pj_optarg); 
     599            if (cfg->media_cfg.ptime < 10 || cfg->media_cfg.ptime > 1000) { 
    598600                PJ_LOG(1,(THIS_FILE, 
    599601                          "Error: invalid --ptime option")); 
     
    602604            break; 
    603605 
    604         */ 
     606        case OPT_NO_VAD: 
     607            cfg->media_cfg.no_vad = PJ_TRUE; 
     608            break; 
    605609 
    606610        case OPT_QUALITY: 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r612 r629  
    20912091     */ 
    20922092    unsigned            quality; 
     2093 
     2094    /** 
     2095     * Specify default ptime. 
     2096     * 
     2097     * Default: 0 (codec specific) 
     2098     */ 
     2099    unsigned            ptime; 
     2100 
     2101    /** 
     2102     * Disable VAD? 
     2103     * 
     2104     * Default: 0 (no (meaning VAD is enabled)) 
     2105     */ 
     2106    pj_bool_t           no_vad; 
    20932107}; 
    20942108 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r611 r629  
    18531853 
    18541854        /* Override ptime, if this option is specified. */ 
    1855         PJ_TODO(set_codec_ptime_in_call); 
     1855        if (pjsua_var.media_cfg.ptime != 0) { 
     1856            sess_info.stream_info[0].param->setting.frm_per_pkt =  
     1857                pjsua_var.media_cfg.ptime / sess_info.stream_info[0].param->info.frm_ptime; 
     1858            if (sess_info.stream_info[0].param->setting.frm_per_pkt == 0) 
     1859                sess_info.stream_info[0].param->setting.frm_per_pkt = 1; 
     1860        } 
     1861 
     1862        /* Disable VAD, if this option is specified. */ 
     1863        if (pjsua_var.media_cfg.no_vad) { 
     1864            sess_info.stream_info[0].param->setting.vad = 0; 
     1865        } 
    18561866 
    18571867 
Note: See TracChangeset for help on using the changeset viewer.