[clutter-gst] video-sink: subclass GstVideoSink rather than GstBaseSink



commit 5c6ff85f14c681571482883971792e30031d9c95
Author: Lionel Landwerlin <llandwerlin gmail com>
Date:   Mon Jun 9 12:41:27 2014 +0100

    video-sink: subclass GstVideoSink rather than GstBaseSink

 clutter-gst/clutter-gst-video-sink.c |   12 +++++++++++-
 clutter-gst/clutter-gst-video-sink.h |    6 +++---
 2 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/clutter-gst/clutter-gst-video-sink.c b/clutter-gst/clutter-gst-video-sink.c
index db69028..3bdacce 100644
--- a/clutter-gst/clutter-gst-video-sink.c
+++ b/clutter-gst/clutter-gst-video-sink.c
@@ -116,7 +116,7 @@ static void color_balance_iface_init (GstColorBalanceInterface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (ClutterGstVideoSink,
                          clutter_gst_video_sink,
-                         GST_TYPE_BASE_SINK,
+                         GST_TYPE_VIDEO_SINK,
                          G_IMPLEMENT_INTERFACE (GST_TYPE_COLOR_BALANCE, color_balance_iface_init))
 
 enum
@@ -2059,6 +2059,13 @@ _clutter_gst_video_sink_render (GstBaseSink *bsink,
   }
 }
 
+static GstFlowReturn
+_clutter_gst_video_sink_show_frame (GstVideoSink *vsink,
+                                    GstBuffer *buffer)
+{
+  return _clutter_gst_video_sink_render (GST_BASE_SINK (vsink), buffer);
+}
+
 static void
 clutter_gst_video_sink_dispose (GObject *object)
 {
@@ -2210,6 +2217,7 @@ static void
 clutter_gst_video_sink_class_init (ClutterGstVideoSinkClass *klass)
 {
   GObjectClass *go_class = G_OBJECT_CLASS (klass);
+  GstVideoSinkClass *gv_class = GST_VIDEO_SINK_CLASS (klass);
   GstBaseSinkClass *gb_class = GST_BASE_SINK_CLASS (klass);
   GstElementClass *ge_class = GST_ELEMENT_CLASS (klass);
   GstPadTemplate *pad_template;
@@ -2242,6 +2250,8 @@ clutter_gst_video_sink_class_init (ClutterGstVideoSinkClass *klass)
   gb_class->get_caps = clutter_gst_video_sink_get_caps;
   gb_class->propose_allocation = clutter_gst_video_sink_propose_allocation;
 
+  gv_class->show_frame = _clutter_gst_video_sink_show_frame;
+
   pspec = g_param_spec_int ("update-priority",
                             "Update Priority",
                             "Priority of video updates in the thread",
diff --git a/clutter-gst/clutter-gst-video-sink.h b/clutter-gst/clutter-gst-video-sink.h
index 692d3ad..ce2c7fe 100644
--- a/clutter-gst/clutter-gst-video-sink.h
+++ b/clutter-gst/clutter-gst-video-sink.h
@@ -36,7 +36,7 @@
 #define __CLUTTER_GST_VIDEO_SINK_H__
 
 #include <cogl/cogl.h>
-#include <gst/base/gstbasesink.h>
+#include <gst/video/gstvideosink.h>
 #include <clutter-gst/clutter-gst-types.h>
 
 G_BEGIN_DECLS
@@ -78,7 +78,7 @@ typedef struct _ClutterGstVideoSinkPrivate ClutterGstVideoSinkPrivate;
 struct _ClutterGstVideoSink
 {
   /*< private >*/
-  GstBaseSink parent;
+  GstVideoSink parent;
   ClutterGstVideoSinkPrivate *priv;
 };
 
@@ -92,7 +92,7 @@ struct _ClutterGstVideoSink
 struct _ClutterGstVideoSinkClass
 {
   /*< private >*/
-  GstBaseSinkClass parent_class;
+  GstVideoSinkClass parent_class;
 
   /*< public >*/
   void (* new_frame)      (ClutterGstVideoSink *sink);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]