mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
gl/examples/3d: additions for wayland support
This commit is contained in:
parent
79935c7ee3
commit
ed1ff251db
1 changed files with 15 additions and 0 deletions
|
@ -47,6 +47,9 @@ typedef struct _localstate
|
||||||
static GstBusSyncReply
|
static GstBusSyncReply
|
||||||
create_window (GstBus * bus, GstMessage * message, GtkWidget * widget)
|
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 */
|
/* ignore anything but 'prepare-window-handle' element messages */
|
||||||
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
|
if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
|
||||||
return GST_BUS_PASS;
|
return GST_BUS_PASS;
|
||||||
|
@ -107,6 +110,17 @@ draw_cb (GtkWidget * widget, cairo_t * cr, GstElement * videosink)
|
||||||
return FALSE;
|
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
|
static void
|
||||||
destroy_cb (GtkWidget * widget, GdkEvent * event, GstElement * pipeline)
|
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) */
|
/* Redraw needed when paused or stopped (PAUSED or READY) */
|
||||||
g_signal_connect (area, "draw", G_CALLBACK (draw_cb), videosink);
|
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);
|
gtk_widget_show_all (window);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue