From kde-commits Mon Mar 18 04:03:13 2013 From: Rohan Garg Date: Mon, 18 Mar 2013 04:03:13 +0000 To: kde-commits Subject: [phonon-gstreamer/1.0-porting-for-merge] gstreamer: Build fixes for GStreamer 0.10 Message-Id: <20130318040313.49360A604F () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=136357940626597 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/ba7c73769adc9a877c833a3b8435e5aee69= f40ed 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_aboutToF= inish), this); = GstBus *bus =3D 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 #include #include + +/* Make sure the ordering is correct over here, + * gstmessage.h should always be included after gsttoc.h + */ +#include "phonon-config-gstreamer.h" // krazy:exclude=3Dincludes +#include +#if GST_VERSION > GST_VERSION_CHECK (1,0,0,0) #include +#endif + #include #include -#include "phonon-config-gstreamer.h" // krazy:exclude=3Dincludes = 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() !=3D pos) { if (!streamSeekable()) { @@ -119,12 +124,21 @@ GstFlowReturn StreamReader::read(quint64 pos, int len= gth, char *buffer) // Abort instantly if we got unlocked, whether we got sufficient d= ata 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 =3D=3D currentBufferSize()) { // We didn't get any data, check if we are at the end of strea= m 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 } } }