GstWlDisplay * gst_wl_display_new (const gchar * name, GError ** error) { struct wl_display *display; display = wl_display_connect (name); if (!display) { *error = g_error_new (g_quark_from_static_string ("GstWlDisplay"), 0, "Failed to connect to the wayland display '%s'", name ? name : "(default)"); return NULL; } else { return gst_wl_display_new_existing (display, TRUE, error); } }
/* must be called with the display_lock */ static void gst_wayland_sink_set_display_from_context (GstWaylandSink * sink, GstContext * context) { struct wl_display *display; GError *error = NULL; display = gst_wayland_display_handle_context_get_handle (context); sink->display = gst_wl_display_new_existing (display, FALSE, &error); if (error) { GST_ELEMENT_WARNING (sink, RESOURCE, OPEN_READ_WRITE, ("Could not set display handle"), ("Failed to use the external wayland display: '%s'", error->message)); g_error_free (error); } }