static void
gst_wayland_sink_class_init (GstWaylandSinkClass * klass)
{
+ FUNCTION_ENTER ();
GObjectClass *gobject_class;
GstElementClass *gstelement_class;
GstBaseSinkClass *gstbasesink_class;
static void
gst_wayland_sink_init (GstWaylandSink * sink)
{
+ FUNCTION_ENTER ();
g_mutex_init (&sink->display_lock);
g_mutex_init (&sink->render_lock);
}
gst_wayland_sink_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
- GstWaylandSink *sink = GST_WAYLAND_SINK (object);
+ FUNCTION_ENTER ();
+ GstWaylandSink *sink = GST_WAYLAND_SINK (object);
switch (prop_id) {
case PROP_DISPLAY:
GST_OBJECT_LOCK (sink);
gst_wayland_sink_set_property (GObject * object,
guint prop_id, const GValue * value, GParamSpec * pspec)
{
- GstWaylandSink *sink = GST_WAYLAND_SINK (object);
+ FUNCTION_ENTER ();
+ GstWaylandSink *sink = GST_WAYLAND_SINK (object);
switch (prop_id) {
case PROP_DISPLAY:
GST_OBJECT_LOCK (sink);
static void
gst_wayland_sink_finalize (GObject * object)
{
- GstWaylandSink *sink = GST_WAYLAND_SINK (object);
+ FUNCTION_ENTER ();
+ GstWaylandSink *sink = GST_WAYLAND_SINK (object);
GST_DEBUG_OBJECT (sink, "Finalizing the sink..");
if (sink->last_buffer)
gst_wayland_sink_set_display_from_context (GstWaylandSink * sink,
GstContext * context)
{
+ FUNCTION_ENTER ();
+
struct wl_display *display;
GError *error = NULL;
static gboolean
gst_wayland_sink_find_display (GstWaylandSink * sink)
{
+ FUNCTION_ENTER ();
+
GstQuery *query;
GstMessage *msg;
GstContext *context = NULL;
static GstStateChangeReturn
gst_wayland_sink_change_state (GstElement * element, GstStateChange transition)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (element);
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
static void
gst_wayland_sink_set_context (GstElement * element, GstContext * context)
{
- GstWaylandSink *sink = GST_WAYLAND_SINK (element);
+ FUNCTION_ENTER ();
+ GstWaylandSink *sink = GST_WAYLAND_SINK (element);
if (gst_context_has_context_type (context,
GST_WAYLAND_DISPLAY_HANDLE_CONTEXT_TYPE)) {
g_mutex_lock (&sink->display_lock);
- if (G_LIKELY (!sink->display))
+ if (G_LIKELY (!sink->display)) {
gst_wayland_sink_set_display_from_context (sink, context);
- else
+ } else {
GST_WARNING_OBJECT (element, "changing display handle is not supported");
+ g_mutex_unlock (&sink->display_lock);
+ return;
+ }
g_mutex_unlock (&sink->display_lock);
}
+ GST_INFO ("element %p context %p", element, context);
if (GST_ELEMENT_CLASS (parent_class)->set_context)
GST_ELEMENT_CLASS (parent_class)->set_context (element, context);
}
static GstCaps *
gst_wayland_sink_get_caps (GstBaseSink * bsink, GstCaps * filter)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink;
GstCaps *caps;
-
sink = GST_WAYLAND_SINK (bsink);
caps = gst_pad_get_pad_template_caps (GST_VIDEO_SINK_PAD (sink));
static gboolean
gst_wayland_sink_set_caps (GstBaseSink * bsink, GstCaps * caps)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink;
GstBufferPool *newpool;
GstVideoInfo info;
gint i;
GstStructure *structure;
static GstAllocationParams params = { 0, 0, 0, 15, };
-
sink = GST_WAYLAND_SINK (bsink);
GST_DEBUG_OBJECT (sink, "set caps %" GST_PTR_FORMAT, caps);
config_failed:
{
GST_DEBUG_OBJECT (bsink, "failed setting config");
+ gst_object_unref (newpool);
return FALSE;
}
}
static gboolean
gst_wayland_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (bsink);
GstBufferPool *pool = NULL;
GstStructure *config;
static GstFlowReturn
gst_wayland_sink_preroll (GstBaseSink * bsink, GstBuffer * buffer)
{
+ FUNCTION_ENTER ();
+
GST_DEBUG_OBJECT (bsink, "preroll buffer %p", buffer);
return gst_wayland_sink_render (bsink, buffer);
}
static void
frame_redraw_callback (void *data, struct wl_callback *callback, uint32_t time)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = data;
GST_LOG ("frame_redraw_cb");
static void
render_last_buffer (GstWaylandSink * sink)
{
+ FUNCTION_ENTER ();
+
GstWlMeta *meta;
struct wl_surface *surface;
struct wl_callback *callback;
static GstFlowReturn
gst_wayland_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (bsink);
GstBuffer *to_render;
GstWlMeta *meta;
if (G_UNLIKELY (sink->video_info_changed)) {
gst_wl_window_set_video_info (sink->window, &sink->video_info);
sink->video_info_changed = FALSE;
+
}
+ GST_INFO ("window->render_rectangle(%d,%d %d x %d)",
+ sink->window->render_rectangle.x,
+ sink->window->render_rectangle.y,
+ sink->window->render_rectangle.w, sink->window->render_rectangle.h);
+ GST_INFO ("window->surface_width(%d),window->surface_height(%d)",
+ sink->window->surface_width, sink->window->surface_height);
/* now that we have for sure set the video info on the window, it must have
* a valid size, otherwise this means that the application has called
static void
gst_wayland_sink_videooverlay_init (GstVideoOverlayInterface * iface)
{
+ FUNCTION_ENTER ();
+
iface->set_window_handle = gst_wayland_sink_set_window_handle;
iface->set_render_rectangle = gst_wayland_sink_set_render_rectangle;
iface->expose = gst_wayland_sink_expose;
static void
gst_wayland_sink_set_window_handle (GstVideoOverlay * overlay, guintptr handle)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
struct wl_surface *surface = (struct wl_surface *) handle;
g_return_if_fail (sink != NULL);
+ if (sink->window != NULL) {
+ GST_WARNING_OBJECT (sink, "changing window handle is not supported");
+ return;
+ }
+
g_mutex_lock (&sink->render_lock);
GST_DEBUG_OBJECT (sink, "Setting window handle %" GST_PTR_FORMAT,
"display handle from your application with GstContext"));
} else {
sink->window = gst_wl_window_new_in_surface (sink->display, surface);
+ GST_ERROR ("sink->window %p", sink->window);
}
} else {
GST_ERROR_OBJECT (sink, "Failed to find display handle, "
gst_wayland_sink_set_render_rectangle (GstVideoOverlay * overlay,
gint x, gint y, gint w, gint h)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
g_return_if_fail (sink != NULL);
static void
gst_wayland_sink_expose (GstVideoOverlay * overlay)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (overlay);
g_return_if_fail (sink != NULL);
static void
gst_wayland_sink_waylandvideo_init (GstWaylandVideoInterface * iface)
{
+ FUNCTION_ENTER ();
+
iface->begin_geometry_change = gst_wayland_sink_begin_geometry_change;
iface->end_geometry_change = gst_wayland_sink_end_geometry_change;
}
static void
gst_wayland_sink_begin_geometry_change (GstWaylandVideo * video)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (video);
g_return_if_fail (sink != NULL);
static void
gst_wayland_sink_end_geometry_change (GstWaylandVideo * video)
{
+ FUNCTION_ENTER ();
+
GstWaylandSink *sink = GST_WAYLAND_SINK (video);
g_return_if_fail (sink != NULL);
static gboolean
plugin_init (GstPlugin * plugin)
{
+ FUNCTION_ENTER ();
+
GST_DEBUG_CATEGORY_INIT (gstwayland_debug, "waylandsink", 0,
" wayland video sink");
#include "wlwindow.h"
G_BEGIN_DECLS
-
#define GST_TYPE_WAYLAND_SINK \
(gst_wayland_sink_get_type())
#define GST_WAYLAND_SINK(obj) \
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_WAYLAND_SINK))
#define GST_WAYLAND_SINK_GET_CLASS(inst) \
(G_TYPE_INSTANCE_GET_CLASS ((inst), GST_TYPE_WAYLAND_SINK, GstWaylandSinkClass))
-
+#if 0
+#define FUNCTION_ENTER() GST_INFO("<ENTER>")
+#else
+#define FUNCTION_ENTER()
+#endif
typedef struct _GstWaylandSink GstWaylandSink;
typedef struct _GstWaylandSinkClass GstWaylandSinkClass;
GstVideoSinkClass parent;
};
-GType gst_wayland_sink_get_type (void) G_GNUC_CONST;
+GType
+gst_wayland_sink_get_type (void)
+ G_GNUC_CONST;
G_END_DECLS
-
#endif /* __GST_WAYLAND_VIDEO_SINK_H__ */
static void
gst_wl_display_class_init (GstWlDisplayClass * klass)
{
+ FUNCTION_ENTER ();
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gst_wl_display_finalize;
}
static void
gst_wl_display_init (GstWlDisplay * self)
{
+ FUNCTION_ENTER ();
+
self->formats = g_array_new (FALSE, FALSE, sizeof (uint32_t));
self->wl_fd_poll = gst_poll_new (TRUE);
}
static void
gst_wl_display_finalize (GObject * gobject)
{
+ FUNCTION_ENTER ();
+
GstWlDisplay *self = GST_WL_DISPLAY (gobject);
gst_poll_set_flushing (self->wl_fd_poll, TRUE);
static void
sync_callback (void *data, struct wl_callback *callback, uint32_t serial)
{
+ FUNCTION_ENTER ();
+
gboolean *done = data;
*done = TRUE;
}
static gint
gst_wl_display_roundtrip (GstWlDisplay * self)
{
+ FUNCTION_ENTER ();
+
struct wl_callback *callback;
gint ret = 0;
gboolean done = FALSE;
static void
shm_format (void *data, struct wl_shm *wl_shm, uint32_t format)
{
+ FUNCTION_ENTER ();
+
GstWlDisplay *self = data;
g_array_append_val (self->formats, format);
registry_handle_global (void *data, struct wl_registry *registry,
uint32_t id, const char *interface, uint32_t version)
{
+
+ FUNCTION_ENTER ();
GstWlDisplay *self = data;
if (g_strcmp0 (interface, "wl_compositor") == 0) {
static gpointer
gst_wl_display_thread_run (gpointer data)
{
+ FUNCTION_ENTER ();
+
GstWlDisplay *self = data;
GstPollFD pollfd = GST_POLL_FD_INIT;
GstWlDisplay *
gst_wl_display_new (const gchar * name, GError ** error)
{
+ FUNCTION_ENTER ();
+
struct wl_display *display;
display = wl_display_connect (name);
gst_wl_display_new_existing (struct wl_display * display,
gboolean take_ownership, GError ** error)
{
+ FUNCTION_ENTER ();
+
GstWlDisplay *self;
GError *err = NULL;
gint i;
#include "scaler-client-protocol.h"
G_BEGIN_DECLS
-
#define GST_TYPE_WL_DISPLAY (gst_wl_display_get_type ())
#define GST_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplay))
#define GST_IS_WL_DISPLAY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_DISPLAY))
#define GST_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
#define GST_IS_WL_DISPLAY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_DISPLAY))
#define GST_WL_DISPLAY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_DISPLAY, GstWlDisplayClass))
-
+#if 0
+#define FUNCTION_ENTER() GST_INFO("<ENTER>")
+#else
+#define FUNCTION_ENTER()
+#endif
typedef struct _GstWlDisplay GstWlDisplay;
typedef struct _GstWlDisplayClass GstWlDisplayClass;
GType gst_wl_display_get_type (void);
GstWlDisplay *gst_wl_display_new (const gchar * name, GError ** error);
-GstWlDisplay *gst_wl_display_new_existing (struct wl_display * display,
+GstWlDisplay *gst_wl_display_new_existing (struct wl_display *display,
gboolean take_ownership, GError ** error);
G_END_DECLS
-
#endif /* __GST_WL_DISPLAY_H__ */
handle_ping (void *data, struct wl_shell_surface *shell_surface,
uint32_t serial)
{
+ FUNCTION_ENTER ();
+
wl_shell_surface_pong (shell_surface, serial);
}
handle_configure (void *data, struct wl_shell_surface *shell_surface,
uint32_t edges, int32_t width, int32_t height)
{
+ FUNCTION_ENTER ();
+
}
static void
handle_popup_done (void *data, struct wl_shell_surface *shell_surface)
{
+ FUNCTION_ENTER ();
+
}
static const struct wl_shell_surface_listener shell_surface_listener = {
static void
gst_wl_window_class_init (GstWlWindowClass * klass)
{
+ FUNCTION_ENTER ();
+
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->finalize = gst_wl_window_finalize;
}
static void
gst_wl_window_init (GstWlWindow * self)
{
+ FUNCTION_ENTER ();
+
}
static void
gst_wl_window_finalize (GObject * gobject)
{
+ FUNCTION_ENTER ();
+
GstWlWindow *self = GST_WL_WINDOW (gobject);
if (self->shell_surface) {
static GstWlWindow *
gst_wl_window_new_internal (GstWlDisplay * display, struct wl_surface *surface)
{
+ FUNCTION_ENTER ();
+
GstWlWindow *window;
struct wl_region *region;
GstWlWindow *
gst_wl_window_new_toplevel (GstWlDisplay * display, GstVideoInfo * video_info)
{
+ FUNCTION_ENTER ();
+
GstWlWindow *window;
window = gst_wl_window_new_internal (display,
gst_wl_window_new_in_surface (GstWlDisplay * display,
struct wl_surface * parent)
{
+ FUNCTION_ENTER ();
+
GstWlWindow *window;
window = gst_wl_window_new_internal (display,
GstWlDisplay *
gst_wl_window_get_display (GstWlWindow * window)
{
+ FUNCTION_ENTER ();
+
g_return_val_if_fail (window != NULL, NULL);
return g_object_ref (window->display);
struct wl_surface *
gst_wl_window_get_wl_surface (GstWlWindow * window)
{
+ FUNCTION_ENTER ();
+
g_return_val_if_fail (window != NULL, NULL);
return window->surface;
gboolean
gst_wl_window_is_toplevel (GstWlWindow * window)
{
+ FUNCTION_ENTER ();
+
g_return_val_if_fail (window != NULL, FALSE);
return (window->shell_surface != NULL);
static void
gst_wl_window_resize_internal (GstWlWindow * window, gboolean commit)
{
- GstVideoRectangle src, res;
+ FUNCTION_ENTER ();
+
+ GstVideoRectangle src = { 0, };
+ GstVideoRectangle res;
src.w = window->video_width;
src.h = window->video_height;
void
gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info)
{
+ FUNCTION_ENTER ();
+
g_return_if_fail (window != NULL);
window->video_width =
gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
gint w, gint h)
{
+ FUNCTION_ENTER ();
+
g_return_if_fail (window != NULL);
window->render_rectangle.x = x;
#include <gst/video/video.h>
G_BEGIN_DECLS
-
#define GST_TYPE_WL_WINDOW (gst_wl_window_get_type ())
#define GST_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_WL_WINDOW, GstWlWindow))
#define GST_IS_WL_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_WL_WINDOW))
#define GST_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_WL_WINDOW, GstWlWindowClass))
#define GST_IS_WL_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_WL_WINDOW))
#define GST_WL_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_WL_WINDOW, GstWlWindowClass))
-
+#if 0
+#define FUNCTION_ENTER() GST_INFO("<ENTER>")
+#else
+#define FUNCTION_ENTER()
+#endif
typedef struct _GstWlWindow GstWlWindow;
typedef struct _GstWlWindowClass GstWlWindowClass;
GType gst_wl_window_get_type (void);
GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
- GstVideoInfo * video_info);
+ GstVideoInfo * video_info);
GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
- struct wl_surface * parent);
+ struct wl_surface *parent);
GstWlDisplay *gst_wl_window_get_display (GstWlWindow * window);
struct wl_surface *gst_wl_window_get_wl_surface (GstWlWindow * window);
-gboolean gst_wl_window_is_toplevel (GstWlWindow *window);
+gboolean gst_wl_window_is_toplevel (GstWlWindow * window);
/* functions to manipulate the size on non-toplevel windows */
void gst_wl_window_set_video_info (GstWlWindow * window, GstVideoInfo * info);
void gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
- gint w, gint h);
+ gint w, gint h);
G_END_DECLS
-
#endif /* __GST_WL_WINDOW_H__ */
+libgstwaylandincludedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/wayland
+
lib_LTLIBRARIES = libgstwayland-@GST_API_VERSION@.la
-libgstwayland_@GST_API_VERSION@_la_SOURCES = wayland.c
+libgstwaylandinclude_HEADERS = wayland.h
-libgstwayland_@GST_API_VERSION@includedir = \
- $(includedir)/gstreamer-@GST_API_VERSION@/gst/wayland
+libgstwayland_@GST_API_VERSION@_la_SOURCES = wayland.c
libgstwayland_@GST_API_VERSION@_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
$(GST_LIB_LDFLAGS) \
$(GST_ALL_LDFLAGS) \
$(GST_LT_LDFLAGS)
-
-noinst_HEADERS = \
- wayland.h
-
Name: gst-plugins-bad
Version: 1.4.1
-Release: 1
+Release: 2
Summary: GStreamer Streaming-Media Framework Plug-Ins
License: GPL-2.0+ and LGPL-2.1+
Group: Multimedia/Framework
%{_libdir}/pkgconfig/gstreamer-plugins-bad-%{gst_branch}.pc
%{_libdir}/pkgconfig/gstreamer-insertbin-%{gst_branch}.pc
%{_libdir}/pkgconfig/gstreamer-mpegts-%{gst_branch}.pc
-
+%if %{with wayland}
+%{_libdir}/pkgconfig/gstreamer-wayland-%{gst_branch}.pc
+%{_includedir}/gstreamer-%{gst_branch}/gst/wayland/wayland.h
+%endif
-
### all of the standard pc files we need to generate
pcverfiles = \
gstreamer-plugins-bad-@GST_API_VERSION@.pc \
pcverfiles_uninstalled += gstreamer-gl-@GST_API_VERSION@-uninstalled.pc
endif
+if USE_WAYLAND
+pcverfiles += gstreamer-wayland-@GST_API_VERSION@.pc
+pcverfiles_uninstalled += gstreamer-wayland-@GST_API_VERSION@-uninstalled.pc
+endif
+
all-local: $(pcverfiles) $(pcverfiles_uninstalled)
cp_verbose = $(cp_verbose_$(V))
pkgconfig_DATA = $(pcverfiles)
CLEANFILES = $(pcverfiles) $(pcverfiles_uninstalled)
+
pcinfiles = \
gstreamer-plugins-bad.pc.in gstreamer-plugins-bad-uninstalled.pc.in \
gstreamer-codecparsers.pc.in gstreamer-codecparsers-uninstalled.pc.in \
gstreamer-gl.pc.in gstreamer-gl-uninstalled.pc.in \
gstreamer-insertbin.pc.in gstreamer-insertbin-uninstalled.pc.in \
gstreamer-mpegts.pc.in gstreamer-mpegts-uninstalled.pc.in
+if USE_WAYLAND
+pcinfiles += gstreamer-wayland.pc.in gstreamer-wayland-uninstalled.pc.in
+endif
DISTCLEANFILES = $(pcinfiles:.in=)
EXTRA_DIST = $(pcinfiles)