Commit a106bde1 authored by Ghislain MARY's avatar Ghislain MARY

Conditional compilation of features.

parent 4ad13f08
......@@ -11,6 +11,43 @@ pluginsdir = $(libdir)/mediastreamer/plugins
plugins_LTLIBRARIES=libmswebrtc.la
WEBRTC_COMMON_SRCS = $(WEBRTC_COMMON_DIR)/spl_sqrt.c \
$(WEBRTC_COMMON_DIR)/real_fft.c \
$(WEBRTC_COMMON_DIR)/filter_ar_fast_q12.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_1024_8.c \
$(WEBRTC_COMMON_DIR)/complex_bit_reverse.c \
$(WEBRTC_COMMON_DIR)/spl_init.c \
$(WEBRTC_COMMON_DIR)/splitting_filter.c \
$(WEBRTC_COMMON_DIR)/spl_sqrt_floor.c \
$(WEBRTC_COMMON_DIR)/levinson_durbin.c \
$(WEBRTC_COMMON_DIR)/filter_ar.c \
$(WEBRTC_COMMON_DIR)/get_scaling_square.c \
$(WEBRTC_COMMON_DIR)/resample_fractional.c \
$(WEBRTC_COMMON_DIR)/resample.c \
$(WEBRTC_COMMON_DIR)/downsample_fast.c \
$(WEBRTC_COMMON_DIR)/filter_ma_fast_q12.c \
$(WEBRTC_COMMON_DIR)/auto_corr_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/auto_correlation.c \
$(WEBRTC_COMMON_DIR)/refl_coef_to_lpc.c \
$(WEBRTC_COMMON_DIR)/dot_product_with_scale.c \
$(WEBRTC_COMMON_DIR)/copy_set_operations.c \
$(WEBRTC_COMMON_DIR)/spl_version.c \
$(WEBRTC_COMMON_DIR)/cross_correlation.c \
$(WEBRTC_COMMON_DIR)/sqrt_of_one_minus_x_squared.c \
$(WEBRTC_COMMON_DIR)/ilbc_specific_functions.c \
$(WEBRTC_COMMON_DIR)/resample_by_2.c \
$(WEBRTC_COMMON_DIR)/complex_fft.c \
$(WEBRTC_COMMON_DIR)/resample_48khz.c \
$(WEBRTC_COMMON_DIR)/energy.c \
$(WEBRTC_COMMON_DIR)/get_hanning_window.c \
$(WEBRTC_COMMON_DIR)/randomization_functions.c \
$(WEBRTC_COMMON_DIR)/vector_scaling_operations.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_rad.c \
$(WEBRTC_COMMON_DIR)/resample_by_2_internal.c \
$(WEBRTC_COMMON_DIR)/lpc_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/min_max_operations.c \
$(WEBRTC_COMMON_DIR)/division_operations.c
# Build the list of isac source files
ISAC_BASE_SRCS = $(ISAC_SRC_DIR)/source/fft.c \
$(ISAC_SRC_DIR)/source/arith_routines.c \
......@@ -46,7 +83,7 @@ ISAC_BASE_SRCS += $(ISAC_SRC_DIR)/source/intialize.c \
$(ISAC_SRC_DIR)/source/lpc_gain_swb_tables.c \
$(ISAC_SRC_DIR)/source/lpc_shape_swb12_tables.c \
$(ISAC_SRC_DIR)/source/lpc_shape_swb16_tables.c \
$(ISAC_SRC_DIR)/util/utility.c
$(ISAC_SRC_DIR)/util/utility.c
else
......@@ -57,58 +94,25 @@ ISAC_BASE_SRCS += $(ISAC_SRC_DIR)/source/decode_plc.c \
$(ISAC_SRC_DIR)/source/isacfix.c \
$(ISAC_SRC_DIR)/source/lattice_c.c \
$(ISAC_SRC_DIR)/source/pitch_filter_c.c \
$(ISAC_SRC_DIR)/source/lpc_masking_model.c \
$(WEBRTC_COMMON_DIR)/spl_sqrt.c \
$(WEBRTC_COMMON_DIR)/real_fft.c \
$(WEBRTC_COMMON_DIR)/filter_ar_fast_q12.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_1024_8.c \
$(WEBRTC_COMMON_DIR)/complex_bit_reverse.c \
$(WEBRTC_COMMON_DIR)/spl_init.c \
$(WEBRTC_COMMON_DIR)/splitting_filter.c \
$(WEBRTC_COMMON_DIR)/spl_sqrt_floor.c \
$(WEBRTC_COMMON_DIR)/levinson_durbin.c \
$(WEBRTC_COMMON_DIR)/filter_ar.c \
$(WEBRTC_COMMON_DIR)/get_scaling_square.c \
$(WEBRTC_COMMON_DIR)/resample_fractional.c \
$(WEBRTC_COMMON_DIR)/resample.c \
$(WEBRTC_COMMON_DIR)/downsample_fast.c \
$(WEBRTC_COMMON_DIR)/filter_ma_fast_q12.c \
$(WEBRTC_COMMON_DIR)/auto_corr_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/auto_correlation.c \
$(WEBRTC_COMMON_DIR)/refl_coef_to_lpc.c \
$(WEBRTC_COMMON_DIR)/dot_product_with_scale.c \
$(WEBRTC_COMMON_DIR)/copy_set_operations.c \
$(WEBRTC_COMMON_DIR)/spl_version.c \
$(WEBRTC_COMMON_DIR)/cross_correlation.c \
$(WEBRTC_COMMON_DIR)/sqrt_of_one_minus_x_squared.c \
$(WEBRTC_COMMON_DIR)/ilbc_specific_functions.c \
$(WEBRTC_COMMON_DIR)/resample_by_2.c \
$(WEBRTC_COMMON_DIR)/complex_fft.c \
$(WEBRTC_COMMON_DIR)/resample_48khz.c \
$(WEBRTC_COMMON_DIR)/energy.c \
$(WEBRTC_COMMON_DIR)/get_hanning_window.c \
$(WEBRTC_COMMON_DIR)/randomization_functions.c \
$(WEBRTC_COMMON_DIR)/vector_scaling_operations.c \
$(WEBRTC_COMMON_DIR)/webrtc_fft_t_rad.c \
$(WEBRTC_COMMON_DIR)/resample_by_2_internal.c \
$(WEBRTC_COMMON_DIR)/lpc_to_refl_coef.c \
$(WEBRTC_COMMON_DIR)/min_max_operations.c \
$(WEBRTC_COMMON_DIR)/division_operations.c
$(ISAC_SRC_DIR)/source/lpc_masking_model.c
# TODO: use assembly-optimized versions when possible
# $(ISAC_SRC_DIR)/source/filters_neon.c \
# $(ISAC_SRC_DIR)/source/lpc_masking_model_neon.S \
# $(ISAC_SRC_DIR)/source/pitch_filter_armv6.S \
# $(ISAC_SRC_DIR)/source/lattice_neon.S \
# $(ISAC_SRC_DIR)/source/lattice_armv7.S
# $(ISAC_SRC_DIR)/source/lattice_armv7.S
endif
libmswebrtc_la_SOURCES= \
mswebrtc.c \
aec.c \
$(ISAC_BASE_SRCS) isac_dec.c isac_enc.c
libmswebrtc_la_SOURCES= mswebrtc.c $(WEBRTC_COMMON_SRCS)
if BUILD_ISAC
libmswebrtc_la_SOURCES+= $(ISAC_BASE_SRCS) isac_dec.c isac_enc.c
endif
if BUILD_AEC
libmswebrtc_la_SOURCES+= aec.c
endif
webrtc_repo = git://git.linphone.org/webrtc
......@@ -127,10 +131,13 @@ libmswebrtc_la_LIBADD= \
libmswebrtc_la_LDFLAGS=-module -no-undefined
webrtc_CFLAGS = -I$(webrtc_DIR) \
-I$(ISAC_SRC_DIR)/source -I$(ISAC_SRC_DIR)/util -I$(ISAC_SRC_DIR)/interface \
-I$(AEC_SRC_DIR)/include -Iwebrtc/common_audio/signal_processing/include
-I$(WEBRTC_COMMON_DIR)/include
webrtc_CFLAGS = -I$(webrtc_DIR) -I$(WEBRTC_COMMON_DIR)/include
if BUILD_ISAC
webrtc_CFLAGS += -I$(ISAC_SRC_DIR)/source -I$(ISAC_SRC_DIR)/util -I$(ISAC_SRC_DIR)/interface
endif
if BUILD_AEC
webrtc_CFLAGS += -I$(AEC_SRC_DIR)/include -Iwebrtc/common_audio/signal_processing/include
endif
AM_CFLAGS= \
$(webrtc_CFLAGS) \
......@@ -174,4 +181,3 @@ zip:
cp -f $(top_srcdir)/COPYING $(INSTALLDIR_WITH_PREFIX)/.
cd $(INSTALLDIR)/$(prefix) && rm -rf $(ZIP_EXCLUDED) && \
zip -r $(ZIPFILE) *
......@@ -73,6 +73,39 @@ esac
AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes)
AC_ARG_ENABLE(isac,
[AS_HELP_STRING([--disable-isac], [Turn off isac audio codec support (default=no)])],
[case "${enableval}" in
yes) build_isac=true ;;
no) build_isac=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-isac) ;;
esac],
[build_isac=true]
)
AM_CONDITIONAL(BUILD_ISAC, test x$build_isac = xtrue)
if test x${build_isac} = xtrue; then
AC_DEFINE(BUILD_ISAC, 1, [Defined iSAC support is built])
fi
AC_ARG_ENABLE(aec,
[AS_HELP_STRING([--disable-aec], [Turn off WebRTC echo canceller support (default=no)])],
[case "${enableval}" in
yes) build_aec=true ;;
no) build_aec=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-aec) ;;
esac],
[build_aec=true]
)
AM_CONDITIONAL(BUILD_AEC, test x$build_aec = xtrue)
if test x${build_aec} = xtrue; then
AC_DEFINE(BUILD_AEC, 1, [Defined AEC support is built])
fi
if test "${build_isac}${build_aec}" = "falsefalse"; then
AC_MSG_ERROR([You need to enable at least one feature of WebRTC.])
fi
AC_CONFIG_COMMANDS([libtool-hacking],[
if test "$mingw_found" = "yes" ; then
AC_MSG_NOTICE([Hacking libtool to work with mingw...])
......@@ -91,3 +124,7 @@ AC_CONFIG_FILES([
])
AC_OUTPUT
echo "Summary of build options:"
printf "* %-30s %s\n" "iSAC" $build_isac
printf "* %-30s %s\n" "AEC" $build_aec
......@@ -17,18 +17,26 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "isacfix.h"
#include "signal_processing_library.h"
#include "config.h"
#ifdef BUILD_ISAC
#include "isac_constants.h"
#include "isacfix.h"
#endif
#include "signal_processing_library.h"
#include "mediastreamer2/msfilter.h"
#include "mediastreamer2/mscodecutils.h"
#ifdef BUILD_ISAC
extern MSFilterDesc ms_isac_dec_desc;
extern MSFilterDesc ms_isac_enc_desc;
#endif
#ifdef BUILD_AEC
extern MSFilterDesc ms_webrtc_aec_desc;
#endif
#ifndef VERSION
#define VERSION "debug"
......@@ -41,17 +49,27 @@ extern MSFilterDesc ms_webrtc_aec_desc;
#endif
MS_PLUGIN_DECLARE ( void ) libmswebrtc_init() {
#ifdef BUILD_ISAC
char isac_version[64];
isac_version[0] = 0;
#endif
WebRtcSpl_Init();
WebRtcIsacfix_version(isac_version);
#ifdef BUILD_ISAC
WebRtcIsacfix_version(isac_version);
ms_filter_register(&ms_isac_enc_desc);
ms_filter_register(&ms_isac_dec_desc);
#endif
#ifdef BUILD_AEC
ms_filter_register(&ms_webrtc_aec_desc);
#endif
ms_message("libmswebrtc " VERSION " plugin loaded, iSAC codec version %s", isac_version);
ms_message("libmswebrtc " VERSION " plugin loaded"
#ifdef BUILD_ISAC
", iSAC codec version %s", isac_version
#endif
);
}
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