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

List:       kde-commits
Subject:    [phonon-gstreamer/1.0-porting-for-merge] gstreamer: Partially port QML bits to GStreamer 1.0
From:       Rohan Garg <rohangarg () kubuntu ! org>
Date:       2013-04-01 13:02:21
Message-ID: 20130401130221.80DA5A604F () git ! kde ! org
[Download RAW message or body]

Git commit e58825647e639ee2675faf550f60650eda480209 by Rohan Garg.
Committed on 01/04/2013 at 15:00.
Pushed by garg into branch '1.0-porting-for-merge'.

Partially port QML bits to GStreamer 1.0

M  +6    -0    gstreamer/videographicsobject.cpp
M  +29   -4    gstreamer/videosink.c

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

diff --git a/gstreamer/videographicsobject.cpp b/gstreamer/videographicsobject.cpp
index 011578f..095fa5d 100644
--- a/gstreamer/videographicsobject.cpp
+++ b/gstreamer/videographicsobject.cpp
@@ -22,8 +22,10 @@
 #include "videographicsobject.h"
 
 #include <gst/video/video.h>
+#include <gst/gst.h>
 
 #include "gsthelper.h"
+#include "phonon-config-gstreamer.h"
 
 namespace Phonon {
 namespace Gstreamer {
@@ -38,7 +40,11 @@ VideoGraphicsObject::VideoGraphicsObject(Backend *backend, QObject *parent) :
 
     m_bin = gst_bin_new(0);
     gst_object_ref(GST_OBJECT(m_bin));
+#if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
     gst_object_sink(GST_OBJECT(m_bin));
+#else
+    gst_object_ref_sink(GST_OBJECT(m_bin));
+#endif
 
     m_sink = P_GST_VIDEO_SINK(g_object_new(P_GST_TYPE_VIDEO_SINK, 0));
     m_sink->userData = this;
diff --git a/gstreamer/videosink.c b/gstreamer/videosink.c
index 8754b65..1763e11 100644
--- a/gstreamer/videosink.c
+++ b/gstreamer/videosink.c
@@ -25,6 +25,11 @@
 #include <assert.h>
 
 #include "videosink.h"
+#include "phonon-config-gstreamer.h"
+
+#if GST_VERSION > GST_VERSION_CHECK (1,0,0,0)
+#include <gst/video/video-format.h>
+#endif
 
 #define UNUSED(x) (void)x
 #define dbg(x) fprintf(stderr, "%s\n", x)
@@ -34,21 +39,36 @@ static GstStaticPadTemplate s_sinktemplate =
                                 GST_PAD_SINK,
                                 GST_PAD_ALWAYS,
                                 GST_STATIC_CAPS (
-                                    GST_VIDEO_CAPS_xRGB_HOST_ENDIAN));
+                                    #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+                                        GST_VIDEO_CAPS_xRGB_HOST_ENDIAN)
+                                    #else
+                                        GST_VIDEO_NE(RGB)
+                                    #endif
+                                    ));
 
 static GstStaticPadTemplate s_rgbPadTemplate =
         GST_STATIC_PAD_TEMPLATE("sink",
                                 GST_PAD_SINK,
                                 GST_PAD_ALWAYS,
                                 GST_STATIC_CAPS(
-                                    GST_VIDEO_CAPS_xRGB_HOST_ENDIAN));
+                                    #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+                                        GST_VIDEO_CAPS_xRGB_HOST_ENDIAN)
+                                    #else
+                                        GST_VIDEO_NE(RGB)
+                                    #endif
+                                    ));
 
 static GstStaticPadTemplate s_yuvPadTemplate =
         GST_STATIC_PAD_TEMPLATE("sink",
                                 GST_PAD_SINK,
                                 GST_PAD_ALWAYS,
                                 GST_STATIC_CAPS(
-                                    GST_VIDEO_CAPS_YUV ("{ IYUV, I420, YV12 }")));
+                                    #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+                                        GST_VIDEO_CAPS_YUV (
+                                    #else
+                                        GST_VIDEO_CAPS_MAKE (
+                                     #endif
+                                        "{ IYUV, I420, YV12 }")));
 
 
 G_DEFINE_TYPE(PGstVideoSink, p_gst_video_sink, GST_TYPE_VIDEO_SINK)
@@ -78,7 +98,12 @@ static GstFlowReturn p_gst_video_sink_render(GstBaseSink *baseSink,
     PGstVideoSink *sink = P_GST_VIDEO_SINK(baseSink);
     if (buffer == NULL || G_UNLIKELY(!GST_IS_BUFFER (buffer))) {
 #warning sounds bogus?
-        return GST_FLOW_RESEND;
+        return
+        #if GST_VERSION < GST_VERSION_CHECK (1,0,0,0)
+                GST_FLOW_RESEND;
+        #else
+                GST_FLOW_EOS;
+        #endif
     }
 
     sink->renderCallback(buffer, sink->userData);

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

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