Changeset 343 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c
- Timestamp:
- Mar 20, 2006 5:42:37 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_settings.c
r325 r343 87 87 puts (" --wb Enable wideband codecs and set clock-rate to 16KHz"); 88 88 puts (" --uwb Enable ultra-wideband codecs and set clock-rate to 32KHz"); 89 puts (" --clock-rate=N Override sound device clock rate"); 89 90 puts (" --null-audio Use NULL audio device"); 90 91 puts (" --no-mic Disable microphone device"); … … 227 228 OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 228 229 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 229 OPT_AUTO_CONF, 230 OPT_AUTO_CONF, OPT_CLOCK_RATE, 230 231 OPT_PLAY_FILE, OPT_WB, OPT_UWB, OPT_RTP_PORT, OPT_ADD_CODEC, 231 232 OPT_COMPLEXITY, OPT_QUALITY, … … 242 243 { "wb", 0, 0, OPT_WB}, 243 244 { "uwb", 0, 0, OPT_UWB}, 245 { "clock-rate", 1, 0, OPT_CLOCK_RATE}, 244 246 { "null-audio", 0, 0, OPT_NULL_AUDIO}, 245 247 { "no-mic", 0, 0, OPT_NO_MIC}, … … 352 354 353 355 case OPT_WB: 354 pjsua. clock_rate = 16000;356 pjsua.has_wb = 1; 355 357 break; 356 358 357 359 case OPT_UWB: 358 pjsua.clock_rate = 32000; 360 pjsua.has_uwb = 1; 361 break; 362 363 case OPT_CLOCK_RATE: 364 lval = pj_strtoul(pj_cstr(&tmp, pj_optarg)); 365 if (lval < 8000 || lval > 48000) { 366 printf("Error: expecting value between 8000-48000 for clock rate\n"); 367 return PJ_EINVAL; 368 } 369 pjsua.clock_rate = (int)lval; 359 370 break; 360 371 … … 573 584 return PJ_EINVAL; 574 585 } 586 587 /* Adjust clock rate */ 588 if (pjsua.clock_rate == 8000 && pjsua.has_uwb) 589 pjsua.clock_rate = 32000; 590 else if (pjsua.clock_rate == 8000 && pjsua.has_wb) 591 pjsua.clock_rate = 16000; 575 592 576 593 return PJ_SUCCESS; … … 906 923 } 907 924 /* Media clock rate. */ 908 if (pjsua. clock_rate >= 32000)925 if (pjsua.has_uwb) 909 926 pj_strcat2(&cfg, "--uwb\n"); 910 else if (pjsua.clock_rate >= 16000) 927 928 if (pjsua.has_wb) 911 929 pj_strcat2(&cfg, "--wb\n"); 930 931 pj_ansi_sprintf(line, "--clock-rate %d\n", 932 pjsua.clock_rate); 933 pj_strcat2(&cfg, line); 934 912 935 913 936 /* Encoding quality and complexity */
Note: See TracChangeset
for help on using the changeset viewer.