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/e58825647e639ee2675faf550f60650eda4= 80209 diff --git a/gstreamer/videographicsobject.cpp b/gstreamer/videographicsobj= ect.cpp index 011578f..095fa5d 100644 --- a/gstreamer/videographicsobject.cpp +++ b/gstreamer/videographicsobject.cpp @@ -22,8 +22,10 @@ #include "videographicsobject.h" = #include +#include = #include "gsthelper.h" +#include "phonon-config-gstreamer.h" = namespace Phonon { namespace Gstreamer { @@ -38,7 +40,11 @@ VideoGraphicsObject::VideoGraphicsObject(Backend *backen= d, QObject *parent) : = m_bin =3D 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 =3D P_GST_VIDEO_SINK(g_object_new(P_GST_TYPE_VIDEO_SINK, 0)); m_sink->userData =3D 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 = #include "videosink.h" +#include "phonon-config-gstreamer.h" + +#if GST_VERSION > GST_VERSION_CHECK (1,0,0,0) +#include +#endif = #define UNUSED(x) (void)x #define dbg(x) fprintf(stderr, "%s\n", x) @@ -34,21 +39,36 @@ static GstStaticPadTemplate s_sinktemplate =3D 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 =3D 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 =3D GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS( - GST_VIDEO_CAPS_YUV ("{ IYUV, I420, YV1= 2 }"))); + #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 =3D P_GST_VIDEO_SINK(baseSink); if (buffer =3D=3D 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);