Fix Gstreamer 1.0/0.10 compliance 15/3615/1
authorXavier Roche <barock@frignu.net>
Fri, 5 Apr 2013 10:17:43 +0000 (12:17 +0200)
committerBaptiste DURAND <baptiste.durand@eurogiciel.fr>
Tue, 30 Apr 2013 15:56:01 +0000 (17:56 +0200)
  - Check require Gstreamer version in specfile : set suitable CFlags
  - Add require version in configure.ac according to the chosen version of Gstreamer

configure.ac
packaging/libmm-radio.spec
src/include/mm_radio_priv.h

index a6595128230f10936672237e7a852785827f1b0f..eeb81b2ccef347d63742e6b63e0f32661baecdaf 100755 (executable)
@@ -42,13 +42,23 @@ PKG_CHECK_MODULES(MMTA, mm-ta)
 AC_SUBST(MMTA_CFLAGS)
 AC_SUBST(MMTA_LIBS)
 
-PKG_CHECK_MODULES(GST, gstreamer-0.10)
-AC_SUBST(GST_CFLAGS)
-AC_SUBST(GST_LIBS)
+if test "$use_gstreamer_1" = "1"; then 
+  PKG_CHECK_MODULES(GST, gstreamer-1.0)
+  AC_SUBST(GST_CFLAGS)
+  AC_SUBST(GST_LIBS)
 
-PKG_CHECK_MODULES(GSTAPP, gstreamer-app-0.10)
-AC_SUBST(GSTAPP_CFLAGS)
-AC_SUBST(GSTAPP_LIBS)
+  PKG_CHECK_MODULES(GSTAPP, gstreamer-app-1.0)
+  AC_SUBST(GSTAPP_CFLAGS)
+  AC_SUBST(GSTAPP_LIBS)
+else
+  PKG_CHECK_MODULES(GST, gstreamer-0.10)
+  AC_SUBST(GST_CFLAGS)
+  AC_SUBST(GST_LIBS)
+
+  PKG_CHECK_MODULES(GSTAPP, gstreamer-app-0.10)
+  AC_SUBST(GSTAPP_CFLAGS)
+  AC_SUBST(GSTAPP_LIBS)
+fi
 
 PKG_CHECK_MODULES(MMSESSION, mm-session)
 AC_SUBST(MMSESSION_CFLAGS)
index 03a080543a94d4b12bdfc98f1db3ea9313f08d4e..736c64f0901de3f54b9e80dd4d793775ac2cdf60 100644 (file)
@@ -11,8 +11,13 @@ BuildRequires:  pkgconfig(mm-log)
 BuildRequires:  pkgconfig(mm-ta)
 BuildRequires:  pkgconfig(mm-session)
 BuildRequires:  pkgconfig(mm-sound)
+%if %{defined with_Gstreamer0.10}
 BuildRequires:  pkgconfig(gstreamer-0.10)
 BuildRequires:  pkgconfig(gstreamer-plugins-base-0.10)
+%else
+BuildRequires:  pkgconfig(gstreamer-1.0)
+BuildRequires:  pkgconfig(gstreamer-plugins-base-1.0)
+%endif
 
 %description
 Descirption: Multimedia Framework Radio Library
@@ -31,7 +36,15 @@ Description: Multimedia Framework Radio Library (DEV)
 
 %build
 ./autogen.sh
-CFLAGS=" %{optflags}  -DGST_EXT_TIME_ANALYSIS -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" "; export CFLAGS;
+
+%if %{defined with_Gstreamer0.10}
+export GSTREAMER_API=""
+%else
+export GSTREAMER_API="-DGST_API_VERSION_1=1"
+export use_gstreamer_1=1
+%endif
+
+CFLAGS=" %{optflags}  -DGST_EXT_TIME_ANALYSIS -DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\" $GSTREAMER_API"; export CFLAGS;
 %configure --disable-static --prefix=%{_prefix}
 
 make %{?jobs:-j%jobs}
index 04c14b82fdeb080900a7eb877790949868090ae1..419316e35f7b1fc6e90963f4e316e05af93a2d72 100644 (file)
@@ -221,7 +221,7 @@ int _mmradio_destroy_pipeline(mm_radio_t* radio);
 #endif
 int _mmradio_apply_region(mm_radio_t*radio, MMRadioRegionType region, bool update);
 int _mmradio_get_region_type(mm_radio_t*radio, MMRadioRegionType *type);
-int _mmradio_get_region_frequency_range(mm_radio_t* radio, uint *min_freq, uint *max_freq);
+int _mmradio_get_region_frequency_range(mm_radio_t* radio, unsigned int *min_freq, unsigned int *max_freq);
 #if 0
 int mmradio_set_attrs(mm_radio_t*  radio, MMRadioAttrsType type, MMHandleType attrs);
 MMHandleType mmradio_get_attrs(mm_radio_t*  radio, MMRadioAttrsType type);