Changeset 528 for pjproject/trunk
- Timestamp:
- Jun 19, 2006 2:49:14 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r526 r528 44 44 unsigned codec_cnt; 45 45 pj_str_t codec_arg[32]; 46 unsigned clock_rate;47 46 pj_bool_t null_audio; 48 47 pj_str_t wav_file; … … 52 51 pj_bool_t auto_loop; 53 52 unsigned ptime; 54 unsigned quality;55 unsigned complexity;56 53 unsigned auto_answer; 57 54 unsigned duration; … … 113 110 puts (" --auto-loop Automatically loop incoming RTP to outgoing RTP"); 114 111 puts (" --rtp-port=N Base port to try for RTP (default=4000)"); 112 puts (" --quality=N Specify media quality (0-10, default=10)"); 115 113 /* 116 puts (" --complexity=N Specify encoding complexity (0-10, default=none(-1))");117 puts (" --quality=N Specify encoding quality (0-10, default=4)");118 114 puts (" --ptime=MSEC Override codec ptime to MSEC (default=specific)"); 119 115 */ … … 562 558 break; 563 559 564 case OPT_QUALITY:565 cfg->quality = my_atoi(pj_optarg);566 if (cfg->quality < 0 || cfg->quality > 10) {567 PJ_LOG(1,(THIS_FILE,568 "Error: invalid --quality (expecting 0-10"));569 return -1;570 }571 break;572 573 560 case OPT_DURATION: 574 561 cfg->duration = my_atoi(pj_optarg); … … 585 572 586 573 */ 574 575 case OPT_QUALITY: 576 cfg->media_cfg.quality = my_atoi(pj_optarg); 577 if (cfg->media_cfg.quality < 0 || cfg->media_cfg.quality > 10) { 578 PJ_LOG(1,(THIS_FILE, 579 "Error: invalid --quality (expecting 0-10")); 580 return -1; 581 } 582 break; 587 583 588 584 case OPT_AUTO_ANSWER: … … 832 828 } 833 829 /* Media clock rate. */ 834 if (config-> clock_rate) {830 if (config->media_cfg.clock_rate) { 835 831 pj_ansi_sprintf(line, "--clock-rate %d\n", 836 config-> clock_rate);832 config->media_cfg.clock_rate); 837 833 pj_strcat2(&cfg, line); 838 834 } 839 840 841 /* Encoding quality and complexity */ 842 if (config->quality > 0) { 835 if (config->media_cfg.quality != 10) { 843 836 pj_ansi_sprintf(line, "--quality %d\n", 844 config-> quality);837 config->media_cfg.quality); 845 838 pj_strcat2(&cfg, line); 846 839 } 847 if (config->complexity > 0) { 848 pj_ansi_sprintf(line, "--complexity %d\n", 849 config->complexity); 850 pj_strcat2(&cfg, line); 851 } 840 852 841 853 842 /* ptime */ -
pjproject/trunk/pjsip/build/Makefile
r508 r528 127 127 $(MAKE) -f $(RULES_MAK) APP=PJSUA_LIB app=pjsua-lib $@ 128 128 129 clean depend realclean:129 clean depend: 130 130 $(MAKE) -f $(RULES_MAK) APP=PJSIP app=pjsip $@ 131 131 $(MAKE) -f $(RULES_MAK) APP=PJSIP_UA app=pjsip-ua $@ -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r515 r528 2038 2038 unsigned thread_cnt; 2039 2039 2040 2040 /** 2041 * Media quality, 0-10, according to this table: 2042 * 8-10: resampling use large filter, 2043 * 3-7: resampling use small filter, 2044 * 1-2: resampling use linear. 2045 * The media quality also sets speex codec quality/complexity to the 2046 * number. 2047 * 2048 * Default: 10. 2049 */ 2050 unsigned quality; 2041 2051 }; 2042 2052 … … 2055 2065 cfg->has_ioqueue = PJ_TRUE; 2056 2066 cfg->thread_cnt = 1; 2067 cfg->quality = 10; 2057 2068 } 2058 2069 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r513 r528 38 38 { 39 39 pj_str_t codec_id; 40 unsigned opt; 40 41 pj_status_t status; 41 42 … … 76 77 status = pjmedia_codec_speex_init(pjsua_var.med_endpt, 77 78 PJMEDIA_SPEEX_NO_UWB, 78 -1, -1); 79 pjsua_var.media_cfg.quality, 80 pjsua_var.media_cfg.quality); 79 81 if (status != PJ_SUCCESS) { 80 82 pjsua_perror(THIS_FILE, "Error initializing Speex codec", … … 130 132 pjsua_var.mconf_cfg.bits_per_sample = 16; 131 133 134 /* Init options for conference bridge. */ 135 opt = PJMEDIA_CONF_NO_DEVICE; 136 if (pjsua_var.media_cfg.quality >= 3 && 137 pjsua_var.media_cfg.quality <= 7) 138 { 139 opt |= PJMEDIA_CONF_SMALL_FILTER; 140 } 141 else if (pjsua_var.media_cfg.quality < 3) { 142 opt |= PJMEDIA_CONF_USE_LINEAR; 143 } 144 145 132 146 /* Init conference bridge. */ 133 147 status = pjmedia_conf_create(pjsua_var.pool, … … 137 151 pjsua_var.mconf_cfg.samples_per_frame, 138 152 pjsua_var.mconf_cfg.bits_per_sample, 139 PJMEDIA_CONF_NO_DEVICE, 140 &pjsua_var.mconf); 153 opt, &pjsua_var.mconf); 141 154 if (status != PJ_SUCCESS) { 142 155 pjsua_perror(THIS_FILE, … … 533 546 { 534 547 pjmedia_conf_port_info cinfo; 535 unsigned i , count;548 unsigned i; 536 549 pj_status_t status; 537 550
Note: See TracChangeset
for help on using the changeset viewer.