From 98dccb65bf1d188eb4bf32821188dbb00678c3e1 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Sun, 22 Feb 2009 19:17:30 +0000 Subject: Detect libsoundtouch 1.4 and higher. In libsoundtouch 1.4, libBPM appears to have been subsumed into libSoundTouch, and into the soundtouch namespace. --- ext/soundtouch/Makefile.am | 2 +- ext/soundtouch/gstbpmdetect.cc | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'ext') diff --git a/ext/soundtouch/Makefile.am b/ext/soundtouch/Makefile.am index 0c4ec826..bd23cdce 100644 --- a/ext/soundtouch/Makefile.am +++ b/ext/soundtouch/Makefile.am @@ -7,7 +7,7 @@ libgstsoundtouch_la_SOURCES = \ libgstsoundtouch_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(SOUNDTOUCH_CFLAGS) libgstsoundtouch_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(SOUNDTOUCH_CFLAGS) -libgstsoundtouch_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_CONTROLLER_LIBS) $(GST_LIBS) $(SOUNDTOUCH_LIBS) -lBPM $(LIBM) +libgstsoundtouch_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) -lgstaudio-$(GST_MAJORMINOR) $(GST_BASE_LIBS) $(GST_CONTROLLER_LIBS) $(GST_LIBS) $(SOUNDTOUCH_LIBS) -lm libgstsoundtouch_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstsoundtouch_la_LIBTOOLFLAGS = --tag=disable-static diff --git a/ext/soundtouch/gstbpmdetect.cc b/ext/soundtouch/gstbpmdetect.cc index 8d774303..23dfc185 100644 --- a/ext/soundtouch/gstbpmdetect.cc +++ b/ext/soundtouch/gstbpmdetect.cc @@ -16,6 +16,9 @@ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #define FLOAT_SAMPLES 1 #include @@ -29,10 +32,6 @@ #undef PACKAGE_BUGREPORT #undef PACKAGE -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include #include @@ -47,7 +46,11 @@ GST_DEBUG_CATEGORY_STATIC (gst_bpm_detect_debug); struct _GstBPMDetectPrivate { gfloat bpm; +#if HAVE_SOUNDTOUCH_1_4 + soundtouch::BPMDetect *detect; +#else BPMDetect *detect; +#endif }; #define ALLOWED_CAPS \ @@ -197,8 +200,13 @@ gst_bpm_detect_transform_ip (GstBaseTransform * trans, GstBuffer * in) return GST_FLOW_ERROR; } +#if HAVE_SOUNDTOUCH_1_4 + bpm_detect->priv->detect = + new soundtouch::BPMDetect (filter->format.channels, filter->format.rate); +#else bpm_detect->priv->detect = new BPMDetect (filter->format.channels, filter->format.rate); +#endif } nsamples = GST_BUFFER_SIZE (in) / (4 * filter->format.channels); -- cgit v1.2.1