[prev in list] [next in list] [prev in thread] [next in thread]
List: gstreamer-cvs
Subject: gst-plugins-bad: gl/examples/3d: additions for wayland support
From: ystreet () kemper ! freedesktop ! org (Matthew Waters)
Date: 2016-03-31 10:17:07
Message-ID: 20160331101707.4090C761E0 () kemper ! freedesktop ! org
[Download RAW message or body]
Module: gst-plugins-bad
Branch: master
Commit: 14cf686e619efc6bfd0642b62e3d0cb4b35dd04d
URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=14cf686e619efc6bfd0642b62e3d0cb4b35dd04d
Author: Matthew Waters <matthew@centricular.com>
Date: Mon Mar 21 15:23:41 2016 +1100
gl/examples/3d: additions for wayland support
---
tests/examples/gl/gtk/3dvideo/main.cpp | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tests/examples/gl/gtk/3dvideo/main.cpp \
b/tests/examples/gl/gtk/3dvideo/main.cpp index 1d8e5b7..16692f2 100644
--- a/tests/examples/gl/gtk/3dvideo/main.cpp
+++ b/tests/examples/gl/gtk/3dvideo/main.cpp
@@ -47,6 +47,9 @@ typedef struct _localstate
static GstBusSyncReply
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
{
+ if (gst_gtk_handle_need_context (bus, message, NULL))
+ return GST_BUS_DROP;
+
/* ignore anything but 'prepare-window-handle' element messages */
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
return GST_BUS_PASS;
@@ -107,6 +110,17 @@ draw_cb (GtkWidget * widget, cairo_t * cr, GstElement * \
videosink) return FALSE;
}
+static gboolean
+resize_cb (GtkWidget * widget, GdkEvent * event, gpointer sink)
+{
+ GtkAllocation allocation;
+
+ gtk_widget_get_allocation (widget, &allocation);
+ gst_video_overlay_set_render_rectangle (GST_VIDEO_OVERLAY (sink), allocation.x, \
allocation.y, allocation.width, allocation.height); +
+ return G_SOURCE_CONTINUE;
+}
+
static void
destroy_cb (GtkWidget * widget, GdkEvent * event, GstElement * pipeline)
{
@@ -406,6 +420,7 @@ main (gint argc, gchar * argv[])
/* Redraw needed when paused or stopped (PAUSED or READY) */
g_signal_connect (area, "draw", G_CALLBACK (draw_cb), videosink);
+ g_signal_connect(area, "configure-event", G_CALLBACK(resize_cb), videosink);
gtk_widget_show_all (window);
_______________________________________________
gstreamer-commits mailing list
gstreamer-commits@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic