[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [phonon-gstreamer/1.0-porting-for-merge] gstreamer: Build fixes for GStreamer 0.10
From:       Rohan Garg <rohangarg () kubuntu ! org>
Date:       2013-03-18 4:03:13
Message-ID: 20130318040313.49360A604F () git ! kde ! org
[Download RAW message or body]

Git commit ba7c73769adc9a877c833a3b8435e5aee69f40ed by Rohan Garg.
Committed on 18/03/2013 at 04:56.
Pushed by garg into branch '1.0-porting-for-merge'.

Build fixes for GStreamer 0.10

* GST_FLOW_EOS is only available in GStreamer 1.0 and above
* Function call was incorrectly ifdef'd

M  +2    -2    gstreamer/pipeline.cpp
M  +9    -1    gstreamer/plugininstaller.h
M  +17   -3    gstreamer/streamreader.cpp

http://commits.kde.org/phonon-gstreamer/ba7c73769adc9a877c833a3b8435e5aee69f40ed

diff --git a/gstreamer/pipeline.cpp b/gstreamer/pipeline.cpp
index b38aa4f..11d5b2a 100644
--- a/gstreamer/pipeline.cpp
+++ b/gstreamer/pipeline.cpp
@@ -69,9 +69,9 @@ Pipeline::Pipeline(QObject *parent)
     g_signal_connect(m_pipeline, "about-to-finish", G_CALLBACK(cb_aboutToFinish), this);
 
     GstBus *bus = gst_pipeline_get_bus(m_pipeline);
-    gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL,
+    gst_bus_set_sync_handler(bus, gst_bus_sync_signal_handler, NULL
                          #if GST_VERSION > GST_VERSION_CHECK (1,0,0,0)
-                             NULL
+                             ,NULL
                          #endif
                              );
     g_signal_connect(bus, "sync-message::eos", G_CALLBACK(cb_eos), this);
diff --git a/gstreamer/plugininstaller.h b/gstreamer/plugininstaller.h
index eb35e81..5b04adf 100644
--- a/gstreamer/plugininstaller.h
+++ b/gstreamer/plugininstaller.h
@@ -21,10 +21,18 @@
 #include <QtCore/QObject>
 #include <QtCore/QHash>
 #include <gst/gstcaps.h>
+
+/* Make sure the ordering is correct over here,
+ * gstmessage.h should always be included after gsttoc.h
+ */
+#include "phonon-config-gstreamer.h" // krazy:exclude=includes
+#include <gst/gst.h>
+#if GST_VERSION > GST_VERSION_CHECK (1,0,0,0)
 #include <gst/gsttoc.h>
+#endif
+
 #include <gst/gstmessage.h>
 #include <gst/pbutils/install-plugins.h>
-#include "phonon-config-gstreamer.h" // krazy:exclude=includes
 
 namespace Phonon
 {
diff --git a/gstreamer/streamreader.cpp b/gstreamer/streamreader.cpp
index ef04324..6d06890 100644
--- a/gstreamer/streamreader.cpp
+++ b/gstreamer/streamreader.cpp
@@ -98,7 +98,12 @@ GstFlowReturn StreamReader::read(quint64 pos, int length, char *buffer)
 
     // If we got unlocked before grabbing the mutex -> return
     if (!m_locked)
-        return GST_FLOW_EOS;
+        return
+        #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+            GST_FLOW_UNEXPECTED;
+        #else
+            GST_FLOW_EOS;
+        #endif
 
     if (currentPos() != pos) {
         if (!streamSeekable()) {
@@ -119,12 +124,21 @@ GstFlowReturn StreamReader::read(quint64 pos, int length, char *buffer)
         // Abort instantly if we got unlocked, whether we got sufficient data or not
         // is absolutely unimportant at this point.
         if (!m_locked)
-            return GST_FLOW_EOS;
+            return
+            #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+              GST_FLOW_UNEXPECTED;
+            #else
+              GST_FLOW_EOS;
+            #endif
 
         if (oldSize == currentBufferSize()) {
             // We didn't get any data, check if we are at the end of stream already.
             if (m_eos) {
-                return GST_FLOW_EOS;
+            #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+              GST_FLOW_UNEXPECTED;
+            #else
+              GST_FLOW_EOS;
+            #endif
             }
         }
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic