Commit 570d8608 authored by Ghislain MARY's avatar Ghislain MARY

Add configure option to disable filters.

parent 4f6eeda0
......@@ -606,6 +606,23 @@ AC_SUBST(ORTP_CFLAGS)
AC_SUBST(ORTP_LIBS)
dnl *********************************************
dnl Enable/disable mediastreamer2 filters
dnl *********************************************
AC_ARG_ENABLE(filters,
[AS_HELP_STRING([--disable-filters], [Disable compilation of filters (default=no)])],
[case "${enableval}" in
yes) filters=true ;;
no) filters=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-filters) ;;
esac],
[filters=true])
AM_CONDITIONAL(MS2_FILTERS, test x$filters = xtrue )
if test "$filters" = 'true'; then
CFLAGS="$CFLAGS -DMS2_FILTERS"
fi
dnl check dlopen support in headers and libraries, so that we can use mediastreamer plugins
AC_CHECK_HEADERS(dlfcn.h)
have_dlopen=false
......
......@@ -23,39 +23,19 @@ INCLUDES=-I$(top_srcdir)/include/
lib_LTLIBRARIES=libmediastreamer.la
libmediastreamer_la_SOURCES= mscommon.c $(GITVERSION_FILE) \
msfilter.c \
msqueue.c \
msticker.c \
libmediastreamer_la_SOURCES= mscommon.c \
$(GITVERSION_FILE) \
msfilter.c \
msqueue.c \
msticker.c \
eventqueue.c \
alaw.c \
ulaw.c \
mssndcard.c \
dtmfgen.c \
tee.c \
msconf.c \
msjoin.c \
g711common.h \
msvolume.c \
mssndcard.c \
tee.c \
msjoin.c \
mswebcam.c \
mtu.c \
void.c \
dsptools.c \
kiss_fft.c \
_kiss_fft_guts.h \
kiss_fft.h \
kiss_fftr.c \
kiss_fftr.h \
equalizer.c \
chanadapt.c \
audiomixer.c \
itc.c \
tonedetector.c \
g722_decode.c g722.h \
g722_encode.c \
msg722.c \
l16.c \
genericplc.c
itc.c
#dummy c++ file to force libtool to use c++ linking (because of msdscap-mingw.cc)
nodist_EXTRA_libmediastreamer_la_SOURCES = dummy.cxx
......@@ -78,16 +58,39 @@ libmediastreamer_la_SOURCES+= ortp-deps/b64.c \
ortp-deps/str_utils.c
endif
if MS2_FILTERS
libmediastreamer_la_SOURCES+= alaw.c \
ulaw.c \
dtmfgen.c \
msconf.c \
g711common.h \
msvolume.c \
dsptools.c \
kiss_fft.c \
_kiss_fft_guts.h \
kiss_fft.h \
kiss_fftr.c \
kiss_fftr.h \
equalizer.c \
chanadapt.c \
audiomixer.c \
tonedetector.c \
g722_decode.c g722.h \
g722_encode.c \
msg722.c \
l16.c \
genericplc.c
if BUILD_SPEEX
libmediastreamer_la_SOURCES+=msspeex.c speexec.c
libmediastreamer_la_SOURCES+= msspeex.c speexec.c
endif
if BUILD_GSM
libmediastreamer_la_SOURCES+=gsm.c
libmediastreamer_la_SOURCES+= gsm.c
endif
if BUILD_G726
libmediastreamer_la_SOURCES+=g726.c
libmediastreamer_la_SOURCES+= g726.c
endif
if BUILD_WIN32
......@@ -95,74 +98,75 @@ libmediastreamer_la_SOURCES+= winsnd3.c \
msfileplayer_win.c msfilerec_win.c
else
libmediastreamer_la_SOURCES+= msfileplayer.c \
msfilerec.c
msfilerec.c
endif
if BUILD_RESAMPLE
libmediastreamer_la_SOURCES+=msresample.c
libmediastreamer_la_SOURCES+= msresample.c
endif
if BUILD_ALSA
libmediastreamer_la_SOURCES+=alsa.c
libmediastreamer_la_SOURCES+= alsa.c
endif
if BUILD_OSS
libmediastreamer_la_SOURCES+=oss.c
libmediastreamer_la_SOURCES+= oss.c
endif
if BUILD_ARTS
libmediastreamer_la_SOURCES+=arts.c
libmediastreamer_la_SOURCES+= arts.c
endif
if BUILD_PORTAUDIO
libmediastreamer_la_SOURCES+=pasnd.c
libmediastreamer_la_SOURCES+= pasnd.c
endif
if BUILD_MACSND
libmediastreamer_la_SOURCES+=macsnd.c
libmediastreamer_la_SOURCES+= macsnd.c
endif
if BUILD_IOSIOUNIT
libmediastreamer_la_SOURCES+=msiounit.m
libmediastreamer_la_SOURCES+= msiounit.m
endif
if BUILD_MACAQSND
libmediastreamer_la_SOURCES+=aqsnd.c
libmediastreamer_la_SOURCES+= aqsnd.c
endif
if BUILD_PULSEAUDIO
libmediastreamer_la_SOURCES+=pulseaudio.c
libmediastreamer_la_SOURCES+= pulseaudio.c
endif
if BUILD_VIDEO
if BUILD_MACOSX
libmediastreamer_la_SOURCES+=qtcapture.m msosxdisplay.m shaders.c shaders.h opengles_display.c opengles_display.h
libmediastreamer_la_SOURCES+= qtcapture.m msosxdisplay.m shaders.c shaders.h opengles_display.c opengles_display.h
nodist_libmediastreamer_la_SOURCES = yuv2rgb.fs.h yuv2rgb.fs.h
endif
if BUILD_IOS
libmediastreamer_la_SOURCES+=scaler.c iosdisplay.m ioscapture.m shaders.c shaders.h opengles_display.c opengles_display.h
libmediastreamer_la_SOURCES+= scaler.c iosdisplay.m ioscapture.m shaders.c shaders.h opengles_display.c opengles_display.h
nodist_libmediastreamer_la_SOURCES = yuv2rgb.fs.h yuv2rgb.fs.h
endif
if BUILD_V4L1
libmediastreamer_la_SOURCES+=msv4l.c
libmediastreamer_la_SOURCES+= msv4l.c
endif
if BUILD_V4L2
libmediastreamer_la_SOURCES+=msv4l2.c
libmediastreamer_la_SOURCES+= msv4l2.c
endif
if BUILD_WIN32
libmediastreamer_la_SOURCES+=msdscap-mingw.cc drawdib-display.c
libmediastreamer_la_SOURCES+= msdscap-mingw.cc drawdib-display.c
endif
if BUILD_THEORA
libmediastreamer_la_SOURCES+=theora.c
libmediastreamer_la_SOURCES+= theora.c
endif
if BUILD_VP8
libmediastreamer_la_SOURCES+=vp8.c
libmediastreamer_la_SOURCES+= vp8.c
endif
if BUILD_FFMPEG
......@@ -174,23 +178,23 @@ libmediastreamer_la_SOURCES+= videoenc.c \
endif
if BUILD_SDL
libmediastreamer_la_SOURCES+=videoout.c
libmediastreamer_la_SOURCES+= videoout.c
endif
if BUILD_X11_XV
libmediastreamer_la_SOURCES+=x11video.c
libmediastreamer_la_SOURCES+= x11video.c
endif
if BUILD_X11_GL
libmediastreamer_la_SOURCES+=glxvideo.c opengles_display.c shaders.c
libmediastreamer_la_SOURCES+= glxvideo.c opengles_display.c shaders.c
endif
libmediastreamer_la_SOURCES+= rfc2429.h \
libmediastreamer_la_SOURCES+= rfc2429.h \
pixconv.c \
sizeconv.c \
msvideo.c \
msvideo_neon.c \
msvideo_neon.h \
msvideo_neon.c \
msvideo_neon.h \
rfc3984.c \
mire.c \
extdisplay.c \
......@@ -198,19 +202,21 @@ libmediastreamer_la_SOURCES+= rfc2429.h \
nowebcam.c nowebcam.h
if ORTP_ENABLED
libmediastreamer_la_SOURCES+=videostream.c
libmediastreamer_la_SOURCES+= videostream.c
endif
endif
endif BUILD_VIDEO
endif MS2_FILTERS
# Put 2 NULL values at the end of ms_filter-descs[] to prevent a GCC compilation error ('array subscript is above array bounds') when building with the --disable-filters option
alldescs.h: Makefile $(libmediastreamer_la_SOURCES)
builddir=`pwd` && cd $(srcdir) && \
awk 'BEGIN { FS="[()]" ; }; /^\t*MS_FILTER_DESC_EXPORT/{ printf("%s\n", $$2) } ' > $$builddir/filterdescs.txt $(libmediastreamer_la_SOURCES) && \
awk 'BEGIN { print("#include \"mediastreamer2/msfilter.h\"\n") } { printf("extern MSFilterDesc %s;\n",$$1) } ' $$builddir/filterdescs.txt > $$builddir/$@ && \
awk 'BEGIN { print("MSFilterDesc * ms_filter_descs[]={") } { printf("&%s,\n",$$1) } END{ print("NULL\n};\n") } ' $$builddir/filterdescs.txt >> $$builddir/$@
awk 'BEGIN { print("MSFilterDesc * ms_filter_descs[]={") } { printf("&%s,\n",$$1) } END{ print("NULL,\nNULL\n};\n") } ' $$builddir/filterdescs.txt >> $$builddir/$@
libmediastreamer_la_LIBADD= $(ORTP_LIBS) \
......
......@@ -445,6 +445,8 @@ void ms_unload_plugins(){
#endif
}
#ifdef MS2_FILTERS
#ifdef __ALSA_ENABLED__
extern MSSndCardDesc alsa_card_desc;
#endif
......@@ -489,7 +491,10 @@ extern MSSndCardDesc au_card_desc;
extern MSSndCardDesc msandroid_sound_card_desc;
#endif
#endif /* MS2_FILTERS */
static MSSndCardDesc * ms_snd_card_descs[]={
#ifdef MS2_FILTERS
#ifdef __ALSA_ENABLED__
&alsa_card_desc,
#endif
......@@ -525,11 +530,14 @@ static MSSndCardDesc * ms_snd_card_descs[]={
#ifdef ANDROID
&msandroid_sound_card_desc,
#endif
#endif /* MS2_FILTERS */
NULL
};
#ifdef VIDEO_ENABLED
#ifdef MS2_FILTERS
#ifdef HAVE_LINUX_VIDEODEV_H
extern MSWebCamDesc v4l_desc;
#endif
......@@ -566,7 +574,11 @@ extern MSWebCamDesc ms_android_video_capture_desc;
#if TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR
extern MSWebCamDesc ms_v4ios_cam_desc;
#endif
#endif /* MS2_FILTERS */
static MSWebCamDesc * ms_web_cam_descs[]={
#ifdef MS2_FILTERS
#ifdef HAVE_LINUX_VIDEODEV2_H
&v4l2_card_desc,
#endif
......@@ -592,6 +604,7 @@ static MSWebCamDesc * ms_web_cam_descs[]={
&mire_desc,
#endif
&static_image_desc,
#endif /*MS2_FILTERS */
NULL
};
......@@ -650,7 +663,7 @@ void ms_init(){
ms_web_cam_manager_register_desc(wm,ms_web_cam_descs[i]);
}
}
#if !defined(NO_FFMPEG)
#if defined(MS2_FILTERS) && !defined(NO_FFMPEG)
ms_ffmpeg_check_init();
__register_ffmpeg_encoders_if_possible();
#endif
......
......@@ -3,6 +3,7 @@ if ENABLE_TESTS
noinst_PROGRAMS=mtudiscover tones
if ORTP_ENABLED
if MS2_FILTERS
noinst_PROGRAMS+=echo ring bench
......@@ -10,7 +11,8 @@ if BUILD_VIDEO
noinst_PROGRAMS+=videodisplay test_x11window
endif
endif
endif MS2_FILTERS
endif ORTP_ENABLED
echo_SOURCES=echo.c
......@@ -34,6 +36,7 @@ TEST_DEPLIBS=\
$(VIDEO_LIBS)
if ORTP_ENABLED
if MS2_FILTERS
bin_PROGRAMS=mediastream
mediastream_SOURCES = mediastream.c
......@@ -48,9 +51,10 @@ libmediastream_cocoa_la_SOURCES = mediastream_cocoa.m
mediastream_LDADD+=libmediastream_cocoa.la
endif
endif BUILD_MACOSX
endif
endif MS2_FILTERS
endif ORTP_ENABLED
LDADD=$(TEST_DEPLIBS)
......
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