From: George Kiagiadakis Date: Fri, 14 Feb 2014 15:08:56 +0000 (+0100) Subject: waylandsink: implement with stubs the GstWaylandVideo & GstVideoOverlay interfaces X-Git-Tag: 1.19.3~507^2~10848 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=68133361eca5f03a85e8f9b168b2aa8026161ebf;p=platform%2Fupstream%2Fgstreamer.git waylandsink: implement with stubs the GstWaylandVideo & GstVideoOverlay interfaces --- diff --git a/ext/wayland/Makefile.am b/ext/wayland/Makefile.am index ffc13ef..8dd6660 100644 --- a/ext/wayland/Makefile.am +++ b/ext/wayland/Makefile.am @@ -3,10 +3,12 @@ plugin_LTLIBRARIES = libgstwaylandsink.la libgstwaylandsink_la_SOURCES = gstwaylandsink.c waylandpool.c \ wldisplay.c wlwindow.c wlvideoformat.c libgstwaylandsink_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \ - $(WAYLAND_CFLAGS) -libgstwaylandsink_la_LIBADD = $(GST_PLUGINS_BASE_LIBS) \ - -lgstvideo-$(GST_API_VERSION) \ - $(WAYLAND_LIBS) + $(WAYLAND_CFLAGS) $(GST_PLUGINS_BAD_CFLAGS) +libgstwaylandsink_la_LIBADD = \ + $(GST_PLUGINS_BASE_LIBS) \ + -lgstvideo-$(GST_API_VERSION) \ + $(WAYLAND_LIBS) \ + $(top_builddir)/gst-libs/gst/wayland/libgstwayland-$(GST_API_VERSION).la libgstwaylandsink_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) libgstwaylandsink_la_LIBTOOLFLAGS = $(GST_PLUGIN_LIBTOOLFLAGS) diff --git a/ext/wayland/gstwaylandsink.c b/ext/wayland/gstwaylandsink.c index cf90509..f7ff3be 100644 --- a/ext/wayland/gstwaylandsink.c +++ b/ext/wayland/gstwaylandsink.c @@ -44,6 +44,9 @@ #include "wlvideoformat.h" #include "waylandpool.h" +#include +#include + /* signals */ enum { @@ -73,10 +76,6 @@ static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (CAPS)) ); -/*Fixme: Add more interfaces */ -#define gst_wayland_sink_parent_class parent_class -G_DEFINE_TYPE (GstWaylandSink, gst_wayland_sink, GST_TYPE_VIDEO_SINK); - static void gst_wayland_sink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static void gst_wayland_sink_set_property (GObject * object, @@ -93,8 +92,27 @@ gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query); static gboolean gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer); -static void frame_redraw_callback (void *data, - struct wl_callback *callback, uint32_t time); +/* VideoOverlay interface */ +static void gst_wayland_sink_videooverlay_init (GstVideoOverlayInterface * + iface); +static void gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, + guintptr handle); +static void gst_wayland_sink_expose (GstVideoOverlay * overlay); + +/* WaylandVideo interface */ +static void gst_wayland_sink_waylandvideo_init (GstWaylandVideoInterface * + iface); +static void gst_wayland_sink_set_surface_size (GstWaylandVideo * video, + gint w, gint h); +static void gst_wayland_sink_pause_rendering (GstWaylandVideo * video); +static void gst_wayland_sink_resume_rendering (GstWaylandVideo * video); + +#define gst_wayland_sink_parent_class parent_class +G_DEFINE_TYPE_WITH_CODE (GstWaylandSink, gst_wayland_sink, GST_TYPE_VIDEO_SINK, + G_IMPLEMENT_INTERFACE (GST_TYPE_VIDEO_OVERLAY, + gst_wayland_sink_videooverlay_init) + G_IMPLEMENT_INTERFACE (GST_TYPE_WAYLAND_VIDEO, + gst_wayland_sink_waylandvideo_init)); static void gst_wayland_sink_class_init (GstWaylandSinkClass * klass) @@ -487,6 +505,56 @@ activate_failed: } } +static void +gst_wayland_sink_videooverlay_init (GstVideoOverlayInterface * iface) +{ + iface->set_window_handle = gst_wayland_sink_set_window_handle; + iface->expose = gst_wayland_sink_expose; +} + +static void +gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle) +{ + GstWaylandSink *sink = GST_WAYLAND_SINK (overlay); + g_return_if_fail (sink != NULL); +} + +static void +gst_wayland_sink_expose (GstVideoOverlay * overlay) +{ + GstWaylandSink *sink = GST_WAYLAND_SINK (overlay); + g_return_if_fail (sink != NULL); +} + +static void +gst_wayland_sink_waylandvideo_init (GstWaylandVideoInterface * iface) +{ + iface->set_surface_size = gst_wayland_sink_set_surface_size; + iface->pause_rendering = gst_wayland_sink_pause_rendering; + iface->resume_rendering = gst_wayland_sink_resume_rendering; +} + +static void +gst_wayland_sink_set_surface_size (GstWaylandVideo * video, gint w, gint h) +{ + GstWaylandSink *sink = GST_WAYLAND_SINK (video); + g_return_if_fail (sink != NULL); +} + +static void +gst_wayland_sink_pause_rendering (GstWaylandVideo * video) +{ + GstWaylandSink *sink = GST_WAYLAND_SINK (video); + g_return_if_fail (sink != NULL); +} + +static void +gst_wayland_sink_resume_rendering (GstWaylandVideo * video) +{ + GstWaylandSink *sink = GST_WAYLAND_SINK (video); + g_return_if_fail (sink != NULL); +} + static gboolean plugin_init (GstPlugin * plugin) {