Merge remote-tracking branch 'oe_21/master' into vuplus-3.0-next
[vuplus_openvuplus_3.0] / meta-openvuplus / recipes-vuplus / enigma2 / enigma2-plugins / enigma2_plugins_gst10_support.patch
1 commit c5618b4c1fb10d9bb8a6128857aa2e8a7cf396b2
2 Author: hschang <chang@dev3>
3 Date:   Thu Jan 22 15:52:21 2015 +0900
4
5     gst10 patch
6
7 diff --git a/configure.ac b/configure.ac
8 index 106756e..f03a743 100755
9 --- a/configure.ac
10 +++ b/configure.ac
11 @@ -22,8 +22,13 @@ AX_PTHREAD
12  
13  TUXBOX_APPS_DVB
14  
15 +dnl versions of gstreamer and plugins-base
16 +AC_ARG_WITH(gstversion,
17 +        AS_HELP_STRING([--with-gstversion],[use gstreamer version (major.minor)]),
18 +        [GST_MAJORMINOR=$withval],[GST_MAJORMINOR=0.10])
19 +
20  PKG_CHECK_MODULES(ENIGMA2, enigma2)
21 -PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 gstreamer-pbutils-0.10)
22 +PKG_CHECK_MODULES(GSTREAMER, gstreamer-$GST_MAJORMINOR gstreamer-pbutils-$GST_MAJORMINOR)
23  PKG_CHECK_MODULES(LIBCRYPTO, libcrypto)
24  
25  AC_ARG_WITH(debug,
26 diff --git a/merlinmusicplayer/src/merlinmp3player/merlinmp3player.cpp b/merlinmusicplayer/src/merlinmp3player/merlinmp3player.cpp
27 index 0f25e41..56b3760 100644
28 --- a/merlinmusicplayer/src/merlinmp3player/merlinmp3player.cpp
29 +++ b/merlinmusicplayer/src/merlinmp3player/merlinmp3player.cpp
30 @@ -123,7 +123,11 @@ eServiceMerlinMP3Player::eServiceMerlinMP3Player(eServiceReference ref):  m_ref(
31                 g_object_set (G_OBJECT (source), "location", m_filename.c_str(), NULL);
32                 gst_bin_add_many (GST_BIN (m_gst_pipeline), source, decoder, sink, NULL);
33                 gst_element_link_many (source, decoder, sink, NULL);
34 +#if GST_VERSION_MAJOR < 1
35                 gst_bus_set_sync_handler(gst_pipeline_get_bus (GST_PIPELINE (m_gst_pipeline)), gstBusSyncHandler, this);
36 +#else
37 +               gst_bus_set_sync_handler(gst_pipeline_get_bus (GST_PIPELINE (m_gst_pipeline)), gstBusSyncHandler, this, NULL);
38 +#endif
39                 gst_element_set_state (m_gst_pipeline, GST_STATE_PLAYING);
40         }
41         else
42 @@ -240,8 +244,11 @@ RESULT eServiceMerlinMP3Player::getLength(pts_t &pts)
43         
44         GstFormat fmt = GST_FORMAT_TIME;
45         gint64 len;
46 -       
47 +#if GST_VERSION_MAJOR < 1
48         if (!gst_element_query_duration(m_gst_pipeline, &fmt, &len))
49 +#else
50 +       if (!gst_element_query_duration(m_gst_pipeline, fmt, &len))
51 +#endif
52                 return -1;
53         
54                 /* len is in nanoseconds. we have 90 000 pts per second. */
55 @@ -295,8 +302,11 @@ RESULT eServiceMerlinMP3Player::getPlayPosition(pts_t &pts)
56         
57         GstFormat fmt = GST_FORMAT_TIME;
58         gint64 len;
59 -       
60 +#if GST_VERSION_MAJOR < 1      
61         if (!gst_element_query_position(m_gst_pipeline, &fmt, &len))
62 +#else
63 +       if (!gst_element_query_position(m_gst_pipeline, fmt, &len))
64 +#endif
65                 return -1;
66         
67                 /* len is in nanoseconds. we have 90 000 pts per second. */