Commit 903d16fd authored by Ghislain MARY's avatar Ghislain MARY

WebRTC echo canceller is now in the mswebrtc plugin.

parent ebc30daf
......@@ -218,15 +218,12 @@ LOCAL_STATIC_LIBRARIES += \
libspeex \
libspeexdsp
ifneq ($(BUILD_WEBRTC_AECM), 0)
LOCAL_CFLAGS += -DBUILD_WEBRTC_AECM
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../../../externals/webrtc/ \
$(LOCAL_PATH)/../../../externals/webrtc/modules/audio_processing/aecm/include
LOCAL_SRC_FILES += audiofilters/webrtc_aec.c
ifneq ($(BUILD_WEBRTC_AECM)$(BUILD_WEBRTC_ISAC), 00)
LOCAL_CFLAGS += -DHAVE_WEBRTC
LOCAL_STATIC_LIBRARIES += libmswebrtc
endif
ifneq ($(BUILD_WEBRTC_AECM), 0)
LOCAL_STATIC_LIBRARIES += \
libwebrtc_aecm \
libwebrtc_apm_utility \
......@@ -240,8 +237,7 @@ endif
endif
ifneq ($(BUILD_WEBRTC_ISAC), 0)
LOCAL_CFLAGS += -DHAVE_ISAC
LOCAL_STATIC_LIBRARIES += libwebrtc_spl libwebrtc_isacfix libmsisac
LOCAL_STATIC_LIBRARIES += libwebrtc_spl libwebrtc_isacfix
endif
......
......@@ -40,7 +40,6 @@
* - Conferencing: src/audiofilters/msconf.c
* - DTMF generation: src/audiofilters/dtmfgen.c
* - Echo cancellation (speex): src/audiofilters/speexec.c
* - Echo cancellation (webrtc) (Android): src/audiofilters/webrtc_aec.c
* - Equalizer: src/audiofilters/equalizer.c
* - Mixer: src/audiofilters/audiomixer.c
* - Packet Loss Concealment (PLC): src/audiofilters/genericplc.c
......
......@@ -490,6 +490,13 @@ MS2_PUBLIC void ms_filter_remove_notify_callback(MSFilter *f, MSFilterNotifyFunc
*/
MS2_PUBLIC MSFilterId ms_filter_get_id(MSFilter *f);
/**
* Get filter's name.
* @param[in] f #MSFilter object
* @return The name of the filter.
*/
MS2_PUBLIC const char * ms_filter_get_name(MSFilter *f);
/**
* Obtain the list of current filter's neighbours, ie filters that are part of same graph.
......
......@@ -21,7 +21,6 @@ src/audiofilters/msvolume.c
src/audiofilters/oss.c
src/audiofilters/speexec.c
src/audiofilters/ulaw.c
src/audiofilters/webrtc_aec.c
src/otherfilters/itc.c
src/otherfilters/join.c
src/otherfilters/msrtp.c
......
......@@ -15,8 +15,7 @@ ANDROID_SRC_FILES= \
android/android-display-bad.cpp \
android/android-opengl-display.c \
android/audio.h \
android/loader.cpp android/loader.h \
audiofilters/webrtc_aec.c
android/loader.cpp android/loader.h
EXTRA_DIST= audiofilters/winsnd2.c audiofilters/winsnd.c videofilters/winvideo.c \
videofilters/winvideods.c videofilters/wincevideods.c dxfilter.h dxfilter.cpp \
......
This diff is collapsed.
......@@ -237,6 +237,10 @@ MSFilterId ms_filter_get_id(MSFilter *f){
return f->desc->id;
}
const char * ms_filter_get_name(MSFilter *f) {
return f->desc->name;
}
int ms_filter_link(MSFilter *f1, int pin1, MSFilter *f2, int pin2){
MSQueue *q;
ms_message("ms_filter_link: %s:%p,%i-->%s:%p,%i",f1->desc->name,f1,pin1,f2->desc->name,f2,pin2);
......
......@@ -392,7 +392,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
/* check echo canceller max frequency and adjust sampling rate if needed when codec used is opus */
if (stream->ec!=NULL) {
if ((ms_filter_get_id(stream->ms.encoder) == MS_OPUS_ENC_ID) && (ms_filter_get_id(stream->ec) == MS_WEBRTC_AEC_ID)) { /* AECM allow 8000 or 16000 Hz or it will be bypassed */
if ((ms_filter_get_id(stream->ms.encoder) == MS_OPUS_ENC_ID) && (strcmp(ms_filter_get_name(stream->ec), "MSWebRTCAEC") == 0)) { /* AECM allow 8000 or 16000 Hz or it will be bypassed */
if (sample_rate>16000) {
sample_rate=16000;
ms_message("Sampling rate forced to 16kHz to allow the use of WebRTC AECM (Echo canceller)");
......@@ -773,11 +773,10 @@ AudioStream *audio_stream_new_with_sessions(const MSMediaStreamSessions *session
if (ec_desc!=NULL){
stream->ec=ms_filter_new_from_desc(ec_desc);
}else{
#if defined(BUILD_WEBRTC_AECM)
stream->ec=ms_filter_new(MS_WEBRTC_AEC_ID);
#else
stream->ec=ms_filter_new(MS_SPEEX_EC_ID);
#endif
stream->ec = ms_filter_new_from_name("MSWebRTCAEC");
if (stream->ec != NULL) {
stream->ec=ms_filter_new(MS_SPEEX_EC_ID);
}
}
stream->ms.evq=ortp_ev_queue_new();
rtp_session_register_event_queue(stream->ms.sessions.rtp_session,stream->ms.evq);
......
......@@ -57,9 +57,9 @@ extern void libmsopenh264_init();
#ifdef HAVE_SILK
extern void libmssilk_init();
#endif
#ifdef HAVE_ISAC
extern void libmsisac_init();
#endif
#ifdef HAVE_WEBRTC
extern void libmswebrtc_init();
#endif
#endif
#ifdef ANDROID
......@@ -574,9 +574,9 @@ void setup_media_streams(MediastreamDatas* args) {
#if defined (HAVE_SILK)
libmssilk_init(); /*no plugin on IOS/Android */
#endif
#if defined (HAVE_ISAC)
libmsisac_init();
#endif
#if defined (HAVE_WEBRTC)
libmswebrtc_init();
#endif
#endif /* IPHONE | ANDROID */
......
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