Changeset 758:f399374c9a31 in mediastreamer2
- Timestamp:
- Nov 4, 2009 10:06:51 AM (4 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
linphone/console/commands.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linphone/console/commands.c
r752 r758 34 34 #include "linphonec.h" 35 35 #include "private.h" 36 #include "lpconfig.h" 36 37 37 38 #ifndef WIN32 … … 72 73 static int lpc_cmd_speak(LinphoneCore *lc, char *args); 73 74 static int lpc_cmd_codec(LinphoneCore *lc, char *args); 75 static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args); 74 76 75 77 /* Command handler helpers */ … … 202 204 "'codec enable <index>' : enable available codec\n" 203 205 "'codec disable <index>' : disable codecs" }, 204 206 { "ec", lpc_cmd_echocancellation, "Echo cancellation", 207 "'ec on [<delay>] [<tail>] [<framesize>]' : turn EC on with given delay, tail length and framesize\n" 208 "'ec off' : turn echo cancellation (EC) off\n" 209 "'ec show' : show EC status" }, 205 210 { (char *)NULL, (lpc_cmd_handler)NULL, (char *)NULL, (char *)NULL } 206 211 }; … … 1611 1616 } 1612 1617 1618 static int lpc_cmd_echocancellation(LinphoneCore *lc, char *args){ 1619 char *arg1 = args; 1620 char *arg2 = NULL; 1621 char *ptr = args; 1622 1623 if (!args) return 0; 1624 1625 /* Isolate first and second arg */ 1626 while(*ptr && !isspace(*ptr)) ++ptr; 1627 if ( *ptr ) 1628 { 1629 *ptr='\0'; 1630 arg2=ptr+1; 1631 while(*arg2 && isspace(*arg2)) ++arg2; 1632 } 1633 1634 if (strcmp(arg1,"on")==0){ 1635 int delay, tail_len, frame_size; 1636 int n; 1637 1638 linphone_core_enable_echo_cancelation(lc,1); 1639 1640 if (arg2 != 0) { 1641 n = sscanf(arg2, "%d %d %d", &delay, &tail_len, &frame_size); 1642 1643 if (n == 1) { 1644 lp_config_set_int(lc->config,"sound","ec_delay",delay); 1645 } 1646 else if (n == 2) { 1647 lp_config_set_int(lc->config,"sound","ec_delay",delay); 1648 lp_config_set_int(lc->config,"sound","ec_tail_len",tail_len); 1649 } 1650 else if (n == 3) { 1651 lp_config_set_int(lc->config,"sound","ec_delay",delay); 1652 lp_config_set_int(lc->config,"sound","ec_tail_len",tail_len); 1653 lp_config_set_int(lc->config,"sound","ec_framesize",frame_size); 1654 } 1655 } 1656 } 1657 else if (strcmp(arg1,"off")==0){ 1658 linphone_core_enable_echo_cancelation(lc,0); 1659 } 1660 else if (strcmp(arg1,"show")==0){ 1661 linphonec_out("echo cancellation is %s; delay %d, tail length %d, frame size %d\n", 1662 linphone_core_echo_cancelation_enabled(lc) ? "on" : "off", 1663 lp_config_get_int(lc->config,"sound","ec_delay",0), 1664 lp_config_get_int(lc->config,"sound","ec_tail_len",0), 1665 lp_config_get_int(lc->config,"sound","ec_framesize",0)); 1666 } 1667 else { 1668 return 0; 1669 } 1670 1671 return 1; 1672 } 1673 1613 1674 /*************************************************************************** 1614 1675 *
Note: See TracChangeset
for help on using the changeset viewer.
