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.
This commit is contained in:
Stefan Kost 2009-02-04 10:31:21 +02:00
parent 080493ccff
commit b08c0a9003
3 changed files with 14 additions and 4 deletions

View file

@ -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 ***

View file

@ -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)

View file

@ -49,9 +49,11 @@
#include <gst/audio/audio.h>
#include <gst/base/gstbasetransform.h>
#if defined AUDIORESAMPLE_FORMAT_AUTO
#define OIL_ENABLE_UNSTABLE_API
#include <liboil/liboilprofile.h>
#include <liboil/liboil.h>
#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