Commit 1c104010 authored by Ghislain MARY's avatar Ghislain MARY

Add API and config parameter to define the echo canceller filter name to use.

parent a04ec858
......@@ -1186,6 +1186,7 @@ static void sound_config_read(LinphoneCore *lc)
#endif
tmp=lp_config_get_int(lc->config,"sound","echocancellation",tmp);
linphone_core_enable_echo_cancellation(lc,tmp);
linphone_core_set_echo_canceller_filter_name(lc, linphone_core_get_echo_canceller_filter_name(lc));
linphone_core_enable_echo_limiter(lc,
lp_config_get_int(lc->config,"sound","echolimiter",0));
linphone_core_enable_agc(lc,
......
......@@ -481,9 +481,11 @@ int linphone_config_read_file(LpConfig *lpconfig, const char *filename){
}
void lp_item_set_value(LpItem *item, const char *value){
char *prev_value=item->value;
item->value=ortp_strdup(value);
ortp_free(prev_value);
if (item->value != value) {
char *prev_value=item->value;
item->value=ortp_strdup(value);
ortp_free(prev_value);
}
}
......
......@@ -1270,6 +1270,17 @@ const char *linphone_core_get_video_display_filter(LinphoneCore *lc){
return lp_config_get_string(lc->config,"video","displaytype",NULL);
}
void linphone_core_set_echo_canceller_filter_name(LinphoneCore *lc, const char *filtername) {
lp_config_set_string(lc->config, "sound", "ec_filter", filtername);
if (filtername != NULL) {
ms_factory_set_echo_canceller_filter_name(lc->factory, filtername);
}
}
const char * linphone_core_get_echo_canceller_filter_name(const LinphoneCore *lc) {
return lp_config_get_string(lc->config, "sound", "ec_filter", NULL);
}
/**
* Queue a task into the main loop. The data pointer must remain valid until the task is completed.
* task_fun must return BELLE_SIP_STOP when job is finished.
......
......@@ -4145,6 +4145,23 @@ LINPHONE_PUBLIC const char *linphone_core_get_video_display_filter(LinphoneCore
**/
LINPHONE_PUBLIC void linphone_core_set_video_display_filter(LinphoneCore *lc, const char *filtername);
/**
* Get the name of the mediastreamer2 filter used for echo cancelling.
* @param[in] lc LinphoneCore object
* @return The name of the mediastreamer2 filter used for echo cancelling
* @ingroup media_parameters
*/
LINPHONE_PUBLIC const char * linphone_core_get_echo_canceller_filter_name(const LinphoneCore *lc);
/**
* Set the name of the mediastreamer2 filter to be used for echo cancelling.
* This is for advanced users of the library.
* @param[in] lc LinphoneCore object
* @param[in] filtername The name of the mediastreamer2 filter to be used for echo cancelling
* @ingroup media_parameters
*/
LINPHONE_PUBLIC void linphone_core_set_echo_canceller_filter_name(LinphoneCore *lc, const char *filtername);
/** Contact Providers
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment