summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2016-03-21 15:23:41 +1100
committerMatthew Waters <matthew@centricular.com>2016-03-31 20:53:18 +1100
commit14cf686e619efc6bfd0642b62e3d0cb4b35dd04d (patch)
tree0298e3e08d824ffc67a17ba22fa1e6efdbf6a390 /tests
parent4210e84f2413a42194291275e8639b13c7174d1c (diff)
downloadgstreamer-plugins-bad-14cf686e619efc6bfd0642b62e3d0cb4b35dd04d.tar.gz
gl/examples/3d: additions for wayland support
Diffstat (limited to 'tests')
-rw-r--r--tests/examples/gl/gtk/3dvideo/main.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/examples/gl/gtk/3dvideo/main.cpp b/tests/examples/gl/gtk/3dvideo/main.cpp
index 1d8e5b724..16692f298 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);