mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 00:59:20 +00:00
reads echo canceler params from config file.
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@607 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
ccf741f1ff
commit
0d636e1301
3 changed files with 23 additions and 0 deletions
|
|
@ -1475,6 +1475,13 @@ void linphone_core_init_media_streams(LinphoneCore *lc){
|
|||
}
|
||||
|
||||
}
|
||||
if (linphone_core_echo_cancelation_enabled(lc)){
|
||||
int len,delay,framesize;
|
||||
len=lp_config_get_int(lc->config,"sound","ec_tail_len",0);
|
||||
delay=lp_config_get_int(lc->config,"sound","ec_delay",0);
|
||||
framesize=lp_config_get_int(lc->config,"sound","ec_framesize",0);
|
||||
audio_stream_set_echo_canceler_params(lc->audiostream,len,delay,framesize);
|
||||
}
|
||||
audio_stream_enable_automatic_gain_control(lc->audiostream,linphone_core_agc_enabled(lc));
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (lc->video_conf.display || lc->video_conf.capture)
|
||||
|
|
|
|||
|
|
@ -116,6 +116,9 @@ void audio_stream_enable_gain_control(AudioStream *stream, bool_t val);
|
|||
/*enable automatic gain control, to be done before start() */
|
||||
void audio_stream_enable_automatic_gain_control(AudioStream *stream, bool_t val);
|
||||
|
||||
/*to be done before start */
|
||||
void audio_stream_set_echo_canceler_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize);
|
||||
|
||||
void audio_stream_set_mic_gain(AudioStream *stream, float gain);
|
||||
|
||||
/*enable noise gate, must be done before start()*/
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
#include "mediastreamer2/msfilerec.h"
|
||||
#include "mediastreamer2/msvolume.h"
|
||||
#include "mediastreamer2/msequalizer.h"
|
||||
#include "mediastreamer2/msspeexec.h"
|
||||
|
||||
#ifdef INET6
|
||||
#include <sys/types.h>
|
||||
|
|
@ -248,6 +249,12 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
|
|||
if (use_ec) {
|
||||
stream->ec=ms_filter_new(MS_SPEEX_EC_ID);
|
||||
ms_filter_call_method(stream->ec,MS_FILTER_SET_SAMPLE_RATE,&pt->clock_rate);
|
||||
if (stream->ec_tail_len!=0)
|
||||
ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_TAIL_LENGTH,&stream->ec_tail_len);
|
||||
if (stream->ec_delay!=0)
|
||||
ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_DELAY,&stream->ec_delay);
|
||||
if (stream->ec_framesize!=0)
|
||||
ms_filter_call_method(stream->ec,MS_SPEEX_EC_SET_FRAME_SIZE,&stream->ec_framesize);
|
||||
}
|
||||
|
||||
if (stream->el_type!=ELInactive || stream->use_gc || stream->use_ng){
|
||||
|
|
@ -430,6 +437,12 @@ void audio_stream_set_relay_session_id(AudioStream *stream, const char *id){
|
|||
ms_filter_call_method(stream->rtpsend, MS_RTP_SEND_SET_RELAY_SESSION_ID,(void*)id);
|
||||
}
|
||||
|
||||
void audio_stream_set_echo_canceler_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize){
|
||||
st->ec_tail_len=tail_len_ms;
|
||||
st->ec_delay=delay_ms;
|
||||
st->ec_framesize=framesize;
|
||||
}
|
||||
|
||||
void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type){
|
||||
stream->el_type=type;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue