Commit 5175b37e authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Updated webrtc

parent 9f7b3128
......@@ -3,23 +3,24 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libmswebrtc
WEBRTC_SRC_DIR = $(LOCAL_PATH)/../externals/webrtc
WEBRTC_SRC_DIR = $(LOCAL_PATH)/webrtc/webrtc
LOCAL_SRC_FILES := mswebrtc.c
LOCAL_C_INCLUDES += $(WEBRTC_SRC_DIR) \
$(LOCAL_PATH)/webrtc \
$(WEBRTC_SRC_DIR)/common_audio/signal_processing/include \
$(LOCAL_PATH)/../linphone/oRTP/include \
$(LOCAL_PATH)/../linphone/mediastreamer2/include
ifneq ($(BUILD_WEBRTC_AECM),0)
LOCAL_CFLAGS += -DBUILD_AEC
LOCAL_CFLAGS += -DBUILD_AEC -fPIC
LOCAL_SRC_FILES += aec.c
LOCAL_STATIC_LIBRARIES += libwebrtc_spl libwebrtc_spl_neon
LOCAL_C_INCLUDES += $(WEBRTC_SRC_DIR)/modules/audio_processing/aecm/include
endif
ifneq ($(BUILD_WEBRTC_ISAC),0)
LOCAL_CFLAGS += -DBUILD_ISAC
LOCAL_CFLAGS += -DBUILD_ISAC -fPIC
LOCAL_SRC_FILES += isac_enc.c isac_dec.c
LOCAL_STATIC_LIBRARIES += libwebrtc_isacfix libwebrtc_isacfix_neon libwebrtc_spl libwebrtc_spl_neon
LOCAL_C_INCLUDES += \
......
......@@ -116,6 +116,7 @@ static void webrtc_aec_preprocess(MSFilter *f)
AecmConfig config;
int delay_samples = 0;
mblk_t *m;
int error_code;
s->echostarted = FALSE;
delay_samples = s->delay_ms * s->samplerate / 1000;
......@@ -127,8 +128,8 @@ static void webrtc_aec_preprocess(MSFilter *f)
ms_error("WebRtcAecm_Create(): error, entering bypass mode");
return;
}
if (WebRtcAecm_Init(s->aecmInst, s->samplerate) < 0) {
if (WebRtcAecm_get_error_code(s->aecmInst) == AECM_BAD_PARAMETER_ERROR) {
if ((error_code = WebRtcAecm_Init(s->aecmInst, s->samplerate)) < 0) {
if (error_code == AECM_BAD_PARAMETER_ERROR) {
ms_error("WebRtcAecm_Init(): WebRTC echo canceller does not support %d samplerate", s->samplerate);
}
s->bypass_mode = TRUE;
......@@ -240,9 +241,9 @@ static void webrtc_aec_process(MSFilter *f)
if (s->echofile)
fwrite(echo, nbytes, 1, s->echofile);
#endif
if (WebRtcAecm_BufferFarend(s->aecmInst, (const WebRtc_Word16 *) ref, s->framesize)!=0)
if (WebRtcAecm_BufferFarend(s->aecmInst, (const int16_t *) ref, s->framesize)!=0)
ms_error("WebRtcAecm_BufferFarend() failed.");
if (WebRtcAecm_Process(s->aecmInst, (const WebRtc_Word16 *) echo, NULL, (WebRtc_Word16 *) oecho->b_wptr, s->framesize, 0)!=0)
if (WebRtcAecm_Process(s->aecmInst, (const int16_t *) echo, NULL, (int16_t *) oecho->b_wptr, s->framesize, 0)!=0)
ms_error("WebRtcAecm_Process() failed.");
#ifdef EC_DUMP
if (s->cleanfile)
......
webrtc @ 3354b1c9
Subproject commit 48ca7f90af50056fb2d80d8760d7835da0d05c74
Subproject commit 3354b1c97cc143a3579f1a9e0b47dd16ab786162
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