Changeset 1044 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Mar 6, 2007 6:11:30 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r995 r1044 84 84 speaker_level; 85 85 86 int capture_dev, playback_dev; 86 87 } app_config; 87 88 … … 181 182 puts (" --rx-drop-pct=PCT Drop PCT percent of RX RTP (for pkt lost sim, default: 0)"); 182 183 puts (" --tx-drop-pct=PCT Drop PCT percent of TX RTP (for pkt lost sim, default: 0)"); 184 puts (" --capture-dev=id Audio capture device ID (default=-1)"); 185 puts (" --playback-dev=id Audio playback device ID (default=-1)"); 183 186 184 187 … … 224 227 cfg->rec_port = PJSUA_INVALID_ID; 225 228 cfg->mic_level = cfg->speaker_level = 1.0; 229 cfg->capture_dev = PJSUA_INVALID_ID; 230 cfg->playback_dev = PJSUA_INVALID_ID; 226 231 227 232 for (i=0; i<PJ_ARRAY_SIZE(cfg->acc_cfg); ++i) … … 335 340 OPT_TLS_PASSWORD, OPT_TLS_VERIFY_SERVER, OPT_TLS_VERIFY_CLIENT, 336 341 OPT_TLS_NEG_TIMEOUT, 342 OPT_CAPTURE_DEV, OPT_PLAYBACK_DEV, 337 343 }; 338 344 struct pj_getopt_option long_options[] = { … … 398 404 { "tls-verify-client", 0, 0, OPT_TLS_VERIFY_CLIENT}, 399 405 { "tls-neg-timeout", 1, 0, OPT_TLS_NEG_TIMEOUT}, 406 { "capture-dev", 1, 0, OPT_CAPTURE_DEV}, 407 { "playback-dev", 1, 0, OPT_PLAYBACK_DEV}, 400 408 { NULL, 0, 0, 0} 401 409 }; … … 886 894 break; 887 895 896 case OPT_CAPTURE_DEV: 897 cfg->capture_dev = atoi(pj_optarg); 898 break; 899 900 case OPT_PLAYBACK_DEV: 901 cfg->playback_dev = atoi(pj_optarg); 902 break; 903 888 904 default: 889 905 PJ_LOG(1,(THIS_FILE, … … 1185 1201 if (config->auto_rec) 1186 1202 pj_strcat2(&cfg, "--auto-rec\n"); 1187 1203 if (config->capture_dev != PJSUA_INVALID_ID) { 1204 pj_ansi_sprintf(line, "--capture-dev %d\n", config->capture_dev); 1205 pj_strcat2(&cfg, line); 1206 } 1207 if (config->playback_dev != PJSUA_INVALID_ID) { 1208 pj_ansi_sprintf(line, "--playback-dev %d\n", config->playback_dev); 1209 pj_strcat2(&cfg, line); 1210 } 1188 1211 1189 1212 /* Media clock rate. */ … … 3131 3154 #endif 3132 3155 3156 if (app_config.capture_dev != PJSUA_INVALID_ID 3157 || app_config.playback_dev != PJSUA_INVALID_ID) { 3158 status 3159 = pjsua_set_snd_dev(app_config.capture_dev, app_config.playback_dev); 3160 if (status != PJ_SUCCESS) 3161 goto on_error; 3162 } 3163 3133 3164 return PJ_SUCCESS; 3134 3165
Note: See TracChangeset
for help on using the changeset viewer.