Changeset 864 for pjproject/trunk
- Timestamp:
- Dec 26, 2006 2:27:14 AM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r838 r864 62 62 #define SIGNATURE PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F') 63 63 #define SIGNATURE_PORT PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P') 64 /* Normal level is hardcodec to 128 in all over places */ 64 65 #define NORMAL_LEVEL 128 65 66 #define SLOT_TYPE unsigned … … 1138 1139 1139 1140 /* Value must be from -128 to +127 */ 1140 PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 1141 /* Disabled, you can put more than +127, at your own risk: 1142 PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 1143 */ 1144 PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL); 1141 1145 1142 1146 conf_port = conf->ports[slot]; … … 1165 1169 1166 1170 /* Value must be from -128 to +127 */ 1167 PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 1171 /* Disabled, you can put more than +127,, at your own risk: 1172 PJ_ASSERT_RETURN(adj_level >= -128 && adj_level <= 127, PJ_EINVAL); 1173 */ 1174 PJ_ASSERT_RETURN(adj_level >= -128, PJ_EINVAL); 1168 1175 1169 1176 conf_port = conf->ports[slot]; … … 1365 1372 */ 1366 1373 itemp = input[j]; 1367 itemp = itemp * adj / NORMAL_LEVEL; 1374 /*itemp = itemp * adj / NORMAL_LEVEL; */ 1375 itemp = (itemp * adj) >> 7; 1368 1376 1369 1377 /* Clip the signal if it's too loud */ … … 1397 1405 1398 1406 /* Adjust the level */ 1399 itemp = itemp * adj_level / NORMAL_LEVEL; 1407 /*itemp = itemp * adj_level / NORMAL_LEVEL;*/ 1408 itemp = (itemp * adj_level) >> 7; 1400 1409 1401 1410 /* Clip the signal if it's too loud */ … … 1651 1660 */ 1652 1661 itemp = input[j]; 1653 itemp = itemp * adj / NORMAL_LEVEL; 1662 /*itemp = itemp * adj / NORMAL_LEVEL;*/ 1663 itemp = (itemp * adj) >> 7; 1654 1664 1655 1665 /* Clip the signal if it's too loud */ -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r863 r864 76 76 pjmedia_snd_port *snd; 77 77 #endif 78 79 float mic_level, 80 speaker_level; 78 81 79 82 } app_config; … … 210 213 cfg->wav_port = PJSUA_INVALID_ID; 211 214 cfg->rec_port = PJSUA_INVALID_ID; 215 cfg->mic_level = cfg->speaker_level = 1.0; 212 216 } 213 217 … … 849 853 PJ_LOG(1,(THIS_FILE, 850 854 "Argument \"%s\" is not valid. Use --help to see help", 851 argv[pj_optind -1]));855 argv[pj_optind])); 852 856 return -1; 853 857 } … … 1838 1842 puts("| dq Dump curr. call quality | cc Connect port | dd Dump detailed |"); 1839 1843 puts("| | cd Disconnect port | dc Dump config |"); 1840 puts("| S Send arbitrary REQUEST | 1844 puts("| S Send arbitrary REQUEST | V Adjust audio Volume | f Save config |"); 1841 1845 puts("+------------------------------+--------------------------+-------------------+"); 1842 1846 puts("| q QUIT |"); … … 2714 2718 break; 2715 2719 2720 case 'V': 2721 /* Adjust audio volume */ 2722 sprintf(buf, "Adjust mic level: [%4.1fx] ", app_config.mic_level); 2723 if (simple_input(buf,text,sizeof(text))) { 2724 char *err; 2725 app_config.mic_level = (float)strtod(text, &err); 2726 pjsua_conf_adjust_rx_level(0, app_config.mic_level); 2727 } 2728 sprintf(buf, "Adjust speaker level: [%4.1fx] ", 2729 app_config.speaker_level); 2730 if (simple_input(buf,text,sizeof(text))) { 2731 char *err; 2732 app_config.speaker_level = (float)strtod(text, &err); 2733 pjsua_conf_adjust_tx_level(0, app_config.speaker_level); 2734 } 2735 2736 break; 2737 2716 2738 case 'd': 2717 2739 if (menuin[1] == 'c') { -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r863 r864 2624 2624 PJ_DECL(pj_status_t) pjsua_conf_disconnect(pjsua_conf_port_id source, 2625 2625 pjsua_conf_port_id sink); 2626 2627 2628 /** 2629 * Adjust the signal level to be transmitted from the bridge to the 2630 * specified port by making it louder or quieter. 2631 * 2632 * @param slot The conference bridge slot number. 2633 * @param level Signal level adjustment. Value 1.0 means no level 2634 * adjustment, while value 0 means to mute the port. 2635 * 2636 * @return PJ_SUCCESS on success, or the appropriate error code. 2637 */ 2638 PJ_DECL(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id slot, 2639 float level); 2640 2641 /** 2642 * Adjust the signal level to be received from the specified port (to 2643 * the bridge) by making it louder or quieter. 2644 * 2645 * @param slot The conference bridge slot number. 2646 * @param level Signal level adjustment. Value 1.0 means no level 2647 * adjustment, while value 0 means to mute the port. 2648 * 2649 * @return PJ_SUCCESS on success, or the appropriate error code. 2650 */ 2651 PJ_DECL(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id slot, 2652 float level); 2653 2654 /** 2655 * Get last signal level transmitted to or received from the specified port. 2656 * The signal level is an integer value in zero to 255, with zero indicates 2657 * no signal, and 255 indicates the loudest signal level. 2658 * 2659 * @param slot The conference bridge slot number. 2660 * @param tx_level Optional argument to receive the level of signal 2661 * transmitted to the specified port (i.e. the direction 2662 * is from the bridge to the port). 2663 * @param rx_level Optional argument to receive the level of signal 2664 * received from the port (i.e. the direction is from the 2665 * port to the bridge). 2666 * 2667 * @return PJ_SUCCESS on success. 2668 */ 2669 PJ_DECL(pj_status_t) pjsua_conf_get_signal_level(pjsua_conf_port_id slot, 2670 unsigned *tx_level, 2671 unsigned *rx_level); 2672 2673 /** 2674 * 2675 */ 2676 2626 2677 2627 2678 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r863 r864 674 674 675 675 676 /* 677 * Adjust the signal level to be transmitted from the bridge to the 678 * specified port by making it louder or quieter. 679 */ 680 PJ_DEF(pj_status_t) pjsua_conf_adjust_tx_level(pjsua_conf_port_id slot, 681 float level) 682 { 683 return pjmedia_conf_adjust_tx_level(pjsua_var.mconf, slot, 684 (int)((level-1) * 128)); 685 } 686 687 /* 688 * Adjust the signal level to be received from the specified port (to 689 * the bridge) by making it louder or quieter. 690 */ 691 PJ_DEF(pj_status_t) pjsua_conf_adjust_rx_level(pjsua_conf_port_id slot, 692 float level) 693 { 694 return pjmedia_conf_adjust_rx_level(pjsua_var.mconf, slot, 695 (int)((level-1) * 128)); 696 } 697 698 699 /* 700 * Get last signal level transmitted to or received from the specified port. 701 */ 702 PJ_DEF(pj_status_t) pjsua_conf_get_signal_level(pjsua_conf_port_id slot, 703 unsigned *tx_level, 704 unsigned *rx_level) 705 { 706 return pjmedia_conf_get_signal_level(pjsua_var.mconf, slot, 707 tx_level, rx_level); 708 } 709 676 710 /***************************************************************************** 677 711 * File player. … … 1009 1043 { 1010 1044 pjmedia_port *conf_port; 1011 const pjmedia_snd_dev_info * cap_info, *play_info;1045 const pjmedia_snd_dev_info *play_info; 1012 1046 unsigned clock_rates[] = { 0, 22050, 44100, 48000, 11025, 32000, 8000}; 1013 1047 unsigned selected_clock_rate = 0;
Note: See TracChangeset
for help on using the changeset viewer.