Detect libsoundtouch 1.4 and higher.

In libsoundtouch 1.4, libBPM appears to have been subsumed into
libSoundTouch, and into the soundtouch namespace.
This commit is contained in:
Jan Schmidt 2009-02-22 19:17:30 +00:00
parent 731bf5d26e
commit 98dccb65bf
3 changed files with 18 additions and 5 deletions

View file

@ -1172,6 +1172,11 @@ AG_GST_CHECK_FEATURE(SOUNDTOUCH, [soundtouch plug-in], soundtouch, [
[PKG_CHECK_MODULES(SOUNDTOUCH, libSoundTouch,
HAVE_SOUNDTOUCH=yes,
HAVE_SOUNDTOUCH=no)])
dnl We only need -lBPM on soundtouch < 1.4
PKG_CHECK_EXISTS(libSoundTouch >= 1.4,
AC_DEFINE([HAVE_SOUNDTOUCH_1_4], [1],
[Defined if the available libSoundTouch is >= 1.4]),
SOUNDTOUCH_CFLAGS="$SOUNDTOUCH_CFLAGS -lBPM")
AC_SUBST(SOUNDTOUCH_CFLAGS)
AC_SUBST(SOUNDTOUCH_LIBS)
if test "x$HAVE_CXX" != "xyes"; then

View file

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

View file

@ -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 <soundtouch/BPMDetect.h>
@ -29,10 +32,6 @@
#undef PACKAGE_BUGREPORT
#undef PACKAGE
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <gst/audio/audio.h>
#include <gst/audio/gstaudiofilter.h>
#include <math.h>
@ -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);