amrnb, amrwbdec: fix build with opencore-amr >= 0.1.3
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Mar 2012 17:17:31 +0000 (17:17 +0000)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Sat, 3 Mar 2012 17:21:28 +0000 (17:21 +0000)
In previous versions, the opencore-amr include sub-directory
would be specified in the include path in the CFLAGS, but this
is no longer the case in newer versions, so we need to add those
to our include directives.

Based on patch by: Christian Morales Vega

https://bugzilla.gnome.org/show_bug.cgi?id=671123

configure.ac
ext/amrnb/amrnbdec.h
ext/amrnb/amrnbenc.h
ext/amrwbdec/amrwbdec.h

index 3c2e341b912c02cea27736245c97afac43541f97..18f2904e6fbac1686a93f8d5b1168fbfb7a082ef 100644 (file)
@@ -251,6 +251,9 @@ dnl *** amr-nb ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRNB, true)
 AG_GST_CHECK_FEATURE(AMRNB, [amrnb library], amrnb, [
   PKG_CHECK_MODULES(AMRNB, opencore-amrnb, [
+    if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrnb; then
+      AC_DEFINE(HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrnb])
+    fi
     HAVE_AMRNB="yes"
   ], [
     HAVE_AMRNB="no"
@@ -263,6 +266,9 @@ dnl *** amr-wb dec ***
 translit(dnm, m, l) AM_CONDITIONAL(USE_AMRWB, true)
 AG_GST_CHECK_FEATURE(AMRWB, [amrwb library], amrwbdec, [
   PKG_CHECK_MODULES(AMRWB, opencore-amrwb, [
+    if $PKG_CONFIG --atleast-version=0.1.3 opencore-amrwb; then
+      AC_DEFINE(HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER, 1, [Defined for newer opencore-amrwb])
+    fi
     HAVE_AMRWB="yes"
   ], [
     HAVE_AMRWB="no"
index 1e818395b9190ce10350e4ddde691ed5e534f089..5fe698290ccabae528f99f115dea277201e1af9e 100644 (file)
 
 #include <gst/gst.h>
 #include <gst/audio/gstaudiodecoder.h>
+
+#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER
+#include <opencore-amrnb/interf_dec.h>
+#else
 #include <interf_dec.h>
+#endif
 
 G_BEGIN_DECLS
 
index 7f673ac69a1523967bb572969ca27cd628606836..48a8fe8c624248ea3e89356ae899e3ca579043a4 100644 (file)
 #define __GST_AMRNBENC_H__
 
 #include <gst/gst.h>
-#include <interf_enc.h>
 #include <gst/audio/gstaudioencoder.h>
 
+#ifdef HAVE_OPENCORE_AMRNB_0_1_3_OR_LATER
+#include <opencore-amrnb/interf_enc.h>
+#else
+#include <interf_enc.h>
+#endif
+
 G_BEGIN_DECLS
 
 #define GST_TYPE_AMRNBENC \
index c3528fca0058392f5217f1e1472dc049efd21bcc..6b82ae992023ce715e24abdf1a4665c6b8928fbd 100644 (file)
 
 #include <gst/gst.h>
 #include <gst/audio/gstaudiodecoder.h>
+
+#ifdef HAVE_OPENCORE_AMRWB_0_1_3_OR_LATER
+#include <opencore-amrwb/dec_if.h>
+#include <opencore-amrwb/if_rom.h>
+#else
 #include <dec_if.h>
 #include <if_rom.h>
+#endif
 
 G_BEGIN_DECLS