From b08c0a9003cd4f826982185e28ddbfbcbec7caf6 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 4 Feb 2009 10:31:21 +0200 Subject: [PATCH] audioresample: Only pull in liboil if its actualy used. Liboil still has quite significant startup overhead especialy on embedded platforms. In audioresample it was only used for the profiling timer. --- configure.ac | 1 + gst/audioresample/Makefile.am | 12 ++++++++++-- gst/audioresample/gstaudioresample.c | 5 +++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 058256a5e7..2ab4fa9939 100644 --- a/configure.ac +++ b/configure.ac @@ -313,6 +313,7 @@ case $ac_cv_audioresample_format in AC_DEFINE(AUDIORESAMPLE_FORMAT_AUTO,1,[The implementation that should be used for integer audio resampling witll be benchmarked at runtime]) AC_SUBST(AUDIORESAMPLE_FORMAT_AUTO) esac +AM_CONDITIONAL(AUDIORESAMPLE_NEEDS_LIBOIL, test "$ac_cv_audioresample_format" = "auto") dnl *** plug-ins to include *** diff --git a/gst/audioresample/Makefile.am b/gst/audioresample/Makefile.am index fdb56a2625..30c5e8b465 100644 --- a/gst/audioresample/Makefile.am +++ b/gst/audioresample/Makefile.am @@ -1,5 +1,13 @@ plugin_LTLIBRARIES = libgstaudioresample.la +if AUDIORESAMPLE_NEEDS_LIBOIL +COND_LIBOIL_CFLAGS=$(LIBOIL_CFLAGS) +COND_LIBOIL_LIBS=$(LIBOIL_LIBS) +else +COND_LIBOIL_CFLAGS= +COND_LIBOIL_LIBS= +endif + libgstaudioresample_la_SOURCES = \ gstaudioresample.c \ speex_resampler_int.c \ @@ -10,13 +18,13 @@ libgstaudioresample_la_CFLAGS = \ $(GST_PLUGINS_BASE_CFLAGS) \ $(GST_BASE_CFLAGS) \ $(GST_CFLAGS) \ - $(LIBOIL_CFLAGS) + $(COND_LIBOIL_CFLAGS) libgstaudioresample_la_LIBADD = \ $(GST_PLUGINS_BASE_LIBS) \ $(GST_BASE_LIBS) \ $(GST_LIBS) \ - $(LIBOIL_LIBS) \ + $(COND_LIBOIL_LIBS) \ $(LIBM) libgstaudioresample_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) diff --git a/gst/audioresample/gstaudioresample.c b/gst/audioresample/gstaudioresample.c index 049b253c97..97ed4cbce2 100644 --- a/gst/audioresample/gstaudioresample.c +++ b/gst/audioresample/gstaudioresample.c @@ -49,9 +49,11 @@ #include #include +#if defined AUDIORESAMPLE_FORMAT_AUTO #define OIL_ENABLE_UNSTABLE_API #include #include +#endif GST_DEBUG_CATEGORY (audio_resample_debug); #define GST_CAT_DEFAULT audio_resample_debug @@ -1392,10 +1394,9 @@ plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (audio_resample_debug, "audioresample", 0, "audio resampling element"); - +#if defined AUDIORESAMPLE_FORMAT_AUTO oil_init (); -#if defined AUDIORESAMPLE_FORMAT_AUTO if (!_benchmark_integer_resampling ()) return FALSE; #endif