mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
examples: Fix gl usage without wayland support
Not all platforms have wayland support. Handle that gracefully at compile time
This commit is contained in:
parent
7ae1efa8b3
commit
786b857e62
1 changed files with 6 additions and 1 deletions
|
@ -46,12 +46,13 @@ gst_gtk_handle_need_context (GstBus * bus, GstMessage * msg, gpointer data)
|
|||
case GST_MESSAGE_NEED_CONTEXT:
|
||||
{
|
||||
const gchar *context_type;
|
||||
GstContext *context = NULL;
|
||||
|
||||
gst_message_parse_context_type (msg, &context_type);
|
||||
g_print ("got need context %s\n", context_type);
|
||||
|
||||
if (g_strcmp0 (context_type, "GstWaylandDisplayHandleContextType") == 0) {
|
||||
#if GST_GL_HAVE_WINDOW_WAYLAND && defined(GDK_WINDOWING_WAYLAND)
|
||||
GstContext *context = NULL;
|
||||
GdkDisplay *gdk_display = gdk_display_get_default ();
|
||||
if (GDK_IS_WAYLAND_DISPLAY (gdk_display)) {
|
||||
struct wl_display *wayland_display =
|
||||
|
@ -71,6 +72,10 @@ gst_gtk_handle_need_context (GstBus * bus, GstMessage * msg, gpointer data)
|
|||
ret = TRUE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
GST_ERROR
|
||||
("Asked for wayland display context, but compiled without wayland support");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue