Changeset 3472
- Timestamp:
- Mar 22, 2011 9:50:48 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c
r3457 r3472 125 125 pjmedia_port *ring_port; 126 126 127 int vcapture_dev, vrender_dev; 127 128 } app_config; 128 129 … … 304 305 puts (" --extra-audio Add one more audio stream"); 305 306 307 #if PJMEDIA_HAS_VIDEO 306 308 puts (""); 307 309 puts ("Video Options:"); 308 310 puts (" --video Enable video"); 311 puts (" --vcapture-dev=id Video capture device ID (default=-1)"); 312 puts (" --vrender-dev=id Video render device ID (default=-1)"); 313 #endif 309 314 310 315 puts (""); … … 381 386 for (i=0; i<PJ_ARRAY_SIZE(cfg->buddy_cfg); ++i) 382 387 pjsua_buddy_config_default(&cfg->buddy_cfg[i]); 388 389 cfg->vcapture_dev = PJSUA_INVALID_ID; 390 cfg->vrender_dev = PJSUA_INVALID_ID; 383 391 } 384 392 … … 547 555 OPT_NO_FORCE_LR, 548 556 OPT_TIMER, OPT_TIMER_SE, OPT_TIMER_MIN_SE, 549 OPT_VIDEO, OPT_EXTRA_AUDIO 557 OPT_VIDEO, OPT_EXTRA_AUDIO, 558 OPT_VCAPTURE_DEV, OPT_VRENDER_DEV, 550 559 }; 551 560 struct pj_getopt_option long_options[] = { … … 668 677 { "video", 0, 0, OPT_VIDEO}, 669 678 { "extra-audio",0, 0, OPT_EXTRA_AUDIO}, 679 { "vcapture-dev", 1, 0, OPT_VCAPTURE_DEV}, 680 { "vrender-dev", 1, 0, OPT_VRENDER_DEV}, 670 681 { NULL, 0, 0, 0} 671 682 }; … … 1431 1442 ++cur_acc->max_audio_cnt; 1432 1443 break; 1444 1445 case OPT_VCAPTURE_DEV: 1446 cfg->vcapture_dev = atoi(pj_optarg); 1447 break; 1448 1449 case OPT_VRENDER_DEV: 1450 cfg->vrender_dev = atoi(pj_optarg); 1451 break; 1452 1433 1453 default: 1434 1454 PJ_LOG(1,(THIS_FILE, … … 2007 2027 } 2008 2028 2029 if (config->vcapture_dev != PJSUA_INVALID_ID) { 2030 pj_ansi_sprintf(line, "--vcapture-dev %d\n", config->vcapture_dev); 2031 pj_strcat2(&cfg, line); 2032 } 2033 if (config->vrender_dev != PJSUA_INVALID_ID) { 2034 pj_ansi_sprintf(line, "--vrender-dev %d\n", config->vrender_dev); 2035 pj_strcat2(&cfg, line); 2036 } 2009 2037 2010 2038 /* ptime */ … … 3215 3243 puts("| dq Dump curr. call quality | cd Disconnect port | dc Dump config |"); 3216 3244 puts("| | V Adjust audio Volume | f Save config |"); 3217 puts("| S Send arbitrary REQUEST | Cp Codec priorities | f Save config|");3245 puts("| S Send arbitrary REQUEST | Cp Codec priorities | |"); 3218 3246 puts("+------------------------------+--------------------------+-------------------+"); 3219 3247 puts("| q QUIT L ReLoad sleep MS echo [0|1|txt] n: detect NAT type |"); … … 3503 3531 pj_status_t status; 3504 3532 3505 printf("List of codecs:\n"); 3506 3533 printf("List of audio codecs:\n"); 3507 3534 pjsua_enum_codecs(c, &count); 3508 3535 for (i=0; i<count; ++i) { … … 3511 3538 } 3512 3539 3540 #if PJMEDIA_HAS_VIDEO 3513 3541 puts(""); 3514 puts("Enter codec id and its new priority " 3515 "(e.g. \"speex/16000 200\"), empty to cancel:"); 3542 printf("List of video codecs:\n"); 3543 pjsua_vid_enum_codecs(c, &count); 3544 for (i=0; i<count; ++i) { 3545 printf(" %d\t%.*s\n", c[i].priority, (int)c[i].codec_id.slen, 3546 c[i].codec_id.ptr); 3547 } 3548 #endif 3549 3550 puts(""); 3551 puts("Enter codec id and its new priority (e.g. \"speex/16000 200\", ""\"H263 200\"),"); 3552 puts("or empty to cancel."); 3516 3553 3517 3554 printf("Codec name (\"*\" for all) and priority: "); … … 3539 3576 status = pjsua_codec_set_priority(pj_cstr(&id, codec), 3540 3577 (pj_uint8_t)new_prio); 3578 #if PJMEDIA_HAS_VIDEO 3579 if (status != PJ_SUCCESS) { 3580 status = pjsua_vid_codec_set_priority(pj_cstr(&id, codec), 3581 (pj_uint8_t)new_prio); 3582 } 3583 #endif 3541 3584 if (status != PJ_SUCCESS) 3542 3585 pjsua_perror(THIS_FILE, "Error setting codec priority", status); … … 4970 5013 for (i=0; i<app_config.codec_dis_cnt; ++i) { 4971 5014 pjsua_codec_set_priority(&app_config.codec_dis[i],PJMEDIA_CODEC_PRIO_DISABLED); 5015 #if PJMEDIA_HAS_VIDEO 5016 pjsua_vid_codec_set_priority(&app_config.codec_dis[i],PJMEDIA_CODEC_PRIO_DISABLED); 5017 #endif 4972 5018 } 4973 5019 … … 4976 5022 pjsua_codec_set_priority(&app_config.codec_arg[i], 4977 5023 (pj_uint8_t)(PJMEDIA_CODEC_PRIO_NORMAL+i+9)); 5024 #if PJMEDIA_HAS_VIDEO 5025 pjsua_vid_codec_set_priority(&app_config.codec_arg[i], 5026 (pj_uint8_t)(PJMEDIA_CODEC_PRIO_NORMAL+i+9)); 5027 #endif 4978 5028 } 4979 5029 … … 5010 5060 goto on_error; 5011 5061 } 5062 5063 #if PJMEDIA_HAS_VIDEO 5064 if (app_config.vcapture_dev != PJSUA_INVALID_ID || 5065 app_config.vrender_dev != PJSUA_INVALID_ID) 5066 { 5067 status = pjsua_vid_set_dev(app_config.vcapture_dev, 5068 app_config.vrender_dev); 5069 if (status != PJ_SUCCESS) 5070 goto on_error; 5071 } 5072 #endif 5012 5073 5013 5074 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.