From: Edward Hervey Date: Mon, 1 Jun 2015 12:05:06 +0000 (+0200) Subject: examples: Fix gl usage without wayland support X-Git-Tag: 1.16.2~955^2~814 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=786b857e623a67236e4403d1d2c7083ad7d0940d;p=platform%2Fupstream%2Fgst-plugins-base.git examples: Fix gl usage without wayland support Not all platforms have wayland support. Handle that gracefully at compile time --- diff --git a/tests/examples/gl/gtk/gstgtk.c b/tests/examples/gl/gtk/gstgtk.c index 3f89c5b..493d6b3 100644 --- a/tests/examples/gl/gtk/gstgtk.c +++ b/tests/examples/gl/gtk/gstgtk.c @@ -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: