2012-11-28 14:01:59 +00:00
|
|
|
/*
|
|
|
|
* GStreamer
|
|
|
|
* Copyright (C) 2008 Julien Isorce <julien.isorce@gmail.com>
|
|
|
|
* Copyright (C) 2012 Matthew Waters <ystreet00@gmail.com>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define GLIB_DISABLE_DEPRECATION_WARNINGS
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
#include <locale.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <unistd.h>
|
2013-10-01 11:46:46 +00:00
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
#include "wayland_event_source.h"
|
|
|
|
|
2013-08-14 00:44:19 +00:00
|
|
|
#include "../gstgl_fwd.h"
|
|
|
|
#include <gst/gl/gstglcontext.h>
|
|
|
|
|
2015-05-21 07:48:31 +00:00
|
|
|
#include "gstgldisplay_wayland.h"
|
2012-11-28 14:01:59 +00:00
|
|
|
#include "gstglwindow_wayland_egl.h"
|
|
|
|
|
2017-08-14 08:33:38 +00:00
|
|
|
#include "../gstglwindow_private.h"
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
const gchar *WlEGLErrorString ();
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
#define GST_CAT_DEFAULT gst_gl_window_debug
|
2012-11-28 14:01:59 +00:00
|
|
|
|
|
|
|
#define gst_gl_window_wayland_egl_parent_class parent_class
|
2012-11-30 06:09:21 +00:00
|
|
|
G_DEFINE_TYPE (GstGLWindowWaylandEGL, gst_gl_window_wayland_egl,
|
2016-10-05 01:19:12 +00:00
|
|
|
GST_TYPE_GL_WINDOW);
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2013-08-15 07:09:04 +00:00
|
|
|
static guintptr gst_gl_window_wayland_egl_get_window_handle (GstGLWindow *
|
|
|
|
window);
|
2012-11-28 14:01:59 +00:00
|
|
|
static void gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
|
|
|
|
guintptr handle);
|
2015-05-27 06:39:06 +00:00
|
|
|
static void gst_gl_window_wayland_egl_show (GstGLWindow * window);
|
2015-01-23 03:11:48 +00:00
|
|
|
static void gst_gl_window_wayland_egl_draw (GstGLWindow * window);
|
2013-06-16 10:38:27 +00:00
|
|
|
static void gst_gl_window_wayland_egl_close (GstGLWindow * window);
|
2013-08-15 07:09:04 +00:00
|
|
|
static gboolean gst_gl_window_wayland_egl_open (GstGLWindow * window,
|
|
|
|
GError ** error);
|
|
|
|
static guintptr gst_gl_window_wayland_egl_get_display (GstGLWindow * window);
|
2015-05-29 08:06:27 +00:00
|
|
|
static gboolean gst_gl_window_wayland_egl_set_render_rectangle (GstGLWindow *
|
|
|
|
window, gint x, gint y, gint width, gint height);
|
2017-10-24 07:09:50 +00:00
|
|
|
static void gst_gl_window_wayland_egl_set_preferred_size (GstGLWindow * window,
|
|
|
|
gint width, gint height);
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
static void
|
|
|
|
pointer_handle_enter (void *data, struct wl_pointer *pointer, uint32_t serial,
|
|
|
|
struct wl_surface *surface, wl_fixed_t sx_w, wl_fixed_t sy_w)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
2013-10-01 11:46:46 +00:00
|
|
|
struct wl_buffer *buffer;
|
|
|
|
struct wl_cursor_image *image = NULL;
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
window_egl->display.serial = serial;
|
2013-10-01 11:46:46 +00:00
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
/* FIXME: Not sure how useful this is */
|
2013-10-01 11:46:46 +00:00
|
|
|
if (window_egl->display.default_cursor) {
|
|
|
|
image = window_egl->display.default_cursor->images[0];
|
|
|
|
buffer = wl_cursor_image_get_buffer (image);
|
|
|
|
wl_pointer_set_cursor (pointer, serial,
|
|
|
|
window_egl->display.cursor_surface, image->hotspot_x, image->hotspot_y);
|
|
|
|
wl_surface_attach (window_egl->display.cursor_surface, buffer, 0, 0);
|
|
|
|
wl_surface_damage (window_egl->display.cursor_surface, 0, 0,
|
|
|
|
image->width, image->height);
|
|
|
|
wl_surface_commit (window_egl->display.cursor_surface);
|
|
|
|
}
|
2012-11-30 06:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pointer_handle_leave (void *data, struct wl_pointer *pointer, uint32_t serial,
|
|
|
|
struct wl_surface *surface)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
window_egl->display.serial = serial;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pointer_handle_motion (void *data, struct wl_pointer *pointer, uint32_t time,
|
|
|
|
wl_fixed_t sx_w, wl_fixed_t sy_w)
|
|
|
|
{
|
2014-11-27 00:47:38 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
2020-02-10 18:17:42 +00:00
|
|
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
2014-11-27 00:47:38 +00:00
|
|
|
|
|
|
|
window_egl->display.pointer_x = wl_fixed_to_double (sx_w);
|
|
|
|
window_egl->display.pointer_y = wl_fixed_to_double (sy_w);
|
2020-02-10 18:17:42 +00:00
|
|
|
gst_gl_window_send_mouse_event (window, "mouse-move", 0,
|
|
|
|
window_egl->display.pointer_x, window_egl->display.pointer_y);
|
2012-11-30 06:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pointer_handle_button (void *data, struct wl_pointer *pointer, uint32_t serial,
|
2020-02-10 18:17:42 +00:00
|
|
|
uint32_t time, uint32_t button, uint32_t state)
|
2012-11-30 06:09:21 +00:00
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
2020-02-10 18:17:42 +00:00
|
|
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
|
|
|
const char *event_type;
|
2014-11-27 00:47:38 +00:00
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
event_type = state == 1 ? "mouse-button-press" : "mouse-button-release";
|
|
|
|
gst_gl_window_send_mouse_event (window, event_type, button,
|
|
|
|
window_egl->display.pointer_x, window_egl->display.pointer_y);
|
2012-11-30 06:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
pointer_handle_axis (void *data, struct wl_pointer *pointer, uint32_t time,
|
|
|
|
uint32_t axis, wl_fixed_t value)
|
|
|
|
{
|
2020-02-10 18:17:42 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
|
|
|
gdouble delta_x, delta_y;
|
|
|
|
gdouble delta = -wl_fixed_to_double (value);
|
|
|
|
if (axis == 1) {
|
|
|
|
delta_x = delta;
|
|
|
|
delta_y = 0;
|
|
|
|
} else {
|
|
|
|
delta_x = 0;
|
|
|
|
delta_y = delta;
|
|
|
|
}
|
|
|
|
gst_gl_window_send_scroll_event (window, window_egl->display.pointer_x,
|
|
|
|
window_egl->display.pointer_y, delta_x, delta_y);
|
2012-11-30 06:09:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_pointer_listener pointer_listener = {
|
|
|
|
pointer_handle_enter,
|
|
|
|
pointer_handle_leave,
|
|
|
|
pointer_handle_motion,
|
|
|
|
pointer_handle_button,
|
|
|
|
pointer_handle_axis,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
seat_handle_capabilities (void *data, struct wl_seat *seat,
|
|
|
|
enum wl_seat_capability caps)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
struct display *display = &window_egl->display;
|
|
|
|
|
|
|
|
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !display->pointer) {
|
|
|
|
display->pointer = wl_seat_get_pointer (seat);
|
|
|
|
wl_pointer_set_user_data (display->pointer, window_egl);
|
|
|
|
wl_pointer_add_listener (display->pointer, &pointer_listener, window_egl);
|
|
|
|
} else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && display->pointer) {
|
|
|
|
wl_pointer_destroy (display->pointer);
|
|
|
|
display->pointer = NULL;
|
|
|
|
}
|
|
|
|
#if 0
|
|
|
|
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !input->keyboard) {
|
|
|
|
input->keyboard = wl_seat_get_keyboard (seat);
|
|
|
|
wl_keyboard_set_user_data (input->keyboard, input);
|
|
|
|
wl_keyboard_add_listener (input->keyboard, &keyboard_listener, input);
|
|
|
|
} else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && input->keyboard) {
|
|
|
|
wl_keyboard_destroy (input->keyboard);
|
|
|
|
input->keyboard = NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
static void
|
|
|
|
seat_name (void *data, struct wl_seat *seat, const char *name)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
|
|
|
|
GST_TRACE_OBJECT (window_egl, "seat %p has name %s", seat, name);
|
|
|
|
}
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
static const struct wl_seat_listener seat_listener = {
|
|
|
|
seat_handle_capabilities,
|
2020-02-10 18:17:42 +00:00
|
|
|
seat_name
|
2012-11-30 06:09:21 +00:00
|
|
|
};
|
2020-02-10 18:17:42 +00:00
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
static void
|
2018-12-14 13:28:26 +00:00
|
|
|
handle_ping (void *data, struct wl_shell_surface *wl_shell_surface,
|
2012-11-28 14:01:59 +00:00
|
|
|
uint32_t serial)
|
|
|
|
{
|
2014-11-27 00:47:38 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
|
|
|
|
GST_TRACE_OBJECT (window_egl, "ping received serial %u", serial);
|
|
|
|
|
2018-12-14 13:28:26 +00:00
|
|
|
wl_shell_surface_pong (wl_shell_surface, serial);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
static void window_resize (GstGLWindowWaylandEGL * window_egl, guint width,
|
|
|
|
guint height);
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
static void
|
2018-12-14 13:28:26 +00:00
|
|
|
handle_configure (void *data, struct wl_shell_surface *wl_shell_surface,
|
2012-11-28 14:01:59 +00:00
|
|
|
uint32_t edges, int32_t width, int32_t height)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
2012-11-30 06:09:21 +00:00
|
|
|
|
2018-12-14 13:28:26 +00:00
|
|
|
GST_DEBUG ("configure event on surface %p, %ix%i", wl_shell_surface, width,
|
2014-11-27 00:47:38 +00:00
|
|
|
height);
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
window_resize (window_egl, width, height);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-12-14 13:28:26 +00:00
|
|
|
handle_popup_done (void *data, struct wl_shell_surface *wl_shell_surface)
|
2012-11-28 14:01:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-12-14 13:28:26 +00:00
|
|
|
static const struct wl_shell_surface_listener wl_shell_surface_listener = {
|
2012-11-28 14:01:59 +00:00
|
|
|
handle_ping,
|
|
|
|
handle_configure,
|
|
|
|
handle_popup_done
|
|
|
|
};
|
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
static void
|
2018-12-14 15:33:50 +00:00
|
|
|
handle_xdg_toplevel_close (void *data, struct xdg_toplevel *xdg_toplevel)
|
|
|
|
{
|
2020-03-03 00:42:11 +00:00
|
|
|
GstGLWindow *window = data;
|
2018-12-14 15:33:50 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("XDG toplevel got a \"close\" event.");
|
|
|
|
|
2020-03-03 00:42:11 +00:00
|
|
|
if (window->close)
|
|
|
|
window->close (window->close_data);
|
|
|
|
|
|
|
|
gst_gl_display_remove_window (window->display, window);
|
2018-12-14 15:33:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
handle_xdg_toplevel_configure (void *data, struct xdg_toplevel *xdg_toplevel,
|
|
|
|
int32_t width, int32_t height, struct wl_array *states)
|
2015-05-27 06:39:06 +00:00
|
|
|
{
|
2018-12-14 15:33:50 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
|
|
|
const uint32_t *state;
|
|
|
|
|
|
|
|
GST_DEBUG ("configure event on XDG toplevel %p, %ix%i", xdg_toplevel,
|
|
|
|
width, height);
|
|
|
|
|
|
|
|
wl_array_for_each (state, states) {
|
|
|
|
switch (*state) {
|
|
|
|
case XDG_TOPLEVEL_STATE_FULLSCREEN:
|
|
|
|
window_egl->window.fullscreen = TRUE;
|
|
|
|
break;
|
|
|
|
case XDG_TOPLEVEL_STATE_MAXIMIZED:
|
|
|
|
case XDG_TOPLEVEL_STATE_RESIZING:
|
|
|
|
case XDG_TOPLEVEL_STATE_ACTIVATED:
|
|
|
|
break;
|
|
|
|
}
|
2015-05-27 06:39:06 +00:00
|
|
|
}
|
2018-12-14 15:33:50 +00:00
|
|
|
|
|
|
|
if (width > 0 && height > 0)
|
|
|
|
window_resize (window_egl, width, height);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
|
|
|
handle_xdg_toplevel_configure,
|
|
|
|
handle_xdg_toplevel_close,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
handle_xdg_surface_configure (void *data, struct xdg_surface *xdg_surface,
|
|
|
|
uint32_t serial)
|
|
|
|
{
|
|
|
|
xdg_surface_ack_configure (xdg_surface, serial);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct xdg_surface_listener xdg_surface_listener = {
|
|
|
|
handle_xdg_surface_configure,
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
destroy_surfaces (GstGLWindowWaylandEGL * window_egl)
|
|
|
|
{
|
|
|
|
g_clear_pointer (&window_egl->window.subsurface, wl_subsurface_destroy);
|
|
|
|
g_clear_pointer (&window_egl->window.xdg_toplevel, xdg_toplevel_destroy);
|
|
|
|
g_clear_pointer (&window_egl->window.xdg_surface, xdg_surface_destroy);
|
|
|
|
g_clear_pointer (&window_egl->window.wl_shell_surface,
|
|
|
|
wl_shell_surface_destroy);
|
|
|
|
g_clear_pointer (&window_egl->window.surface, wl_surface_destroy);
|
|
|
|
g_clear_pointer (&window_egl->window.native, wl_egl_window_destroy);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
create_xdg_surface_and_toplevel (GstGLWindowWaylandEGL * window_egl)
|
|
|
|
{
|
|
|
|
struct xdg_surface *xdg_surface;
|
|
|
|
struct xdg_toplevel *xdg_toplevel;
|
|
|
|
|
|
|
|
GST_DEBUG ("Creating surfaces XDG-shell");
|
|
|
|
|
|
|
|
/* First create the XDG surface */
|
2020-03-03 00:53:53 +00:00
|
|
|
xdg_surface = xdg_wm_base_get_xdg_surface (window_egl->display.xdg_wm_base,
|
2018-12-14 15:33:50 +00:00
|
|
|
window_egl->window.surface);
|
|
|
|
xdg_surface_add_listener (xdg_surface, &xdg_surface_listener, window_egl);
|
|
|
|
|
|
|
|
/* Then the XDG top-level */
|
|
|
|
xdg_toplevel = xdg_surface_get_toplevel (xdg_surface);
|
|
|
|
xdg_toplevel_set_title (xdg_toplevel, "OpenGL Renderer");
|
|
|
|
xdg_toplevel_add_listener (xdg_toplevel, &xdg_toplevel_listener, window_egl);
|
|
|
|
|
|
|
|
/* Commit the xdg_surface state */
|
|
|
|
wl_surface_commit (window_egl->window.surface);
|
|
|
|
|
|
|
|
/* And save them into the fields */
|
|
|
|
window_egl->window.xdg_surface = xdg_surface;
|
|
|
|
window_egl->window.xdg_toplevel = xdg_toplevel;
|
2018-12-14 13:54:24 +00:00
|
|
|
}
|
|
|
|
|
2018-12-14 15:33:50 +00:00
|
|
|
static void
|
|
|
|
create_wl_shell_surface (GstGLWindowWaylandEGL * window_egl)
|
2018-12-14 13:54:24 +00:00
|
|
|
{
|
|
|
|
struct wl_shell_surface *wl_shell_surface;
|
|
|
|
|
2018-12-14 15:33:50 +00:00
|
|
|
GST_DEBUG ("Creating surfaces for wl-shell");
|
|
|
|
|
2020-03-03 00:53:53 +00:00
|
|
|
wl_shell_surface = wl_shell_get_shell_surface (window_egl->display.shell,
|
2018-12-14 13:54:24 +00:00
|
|
|
window_egl->window.surface);
|
|
|
|
|
|
|
|
wl_shell_surface_add_listener (wl_shell_surface, &wl_shell_surface_listener,
|
2018-12-14 15:33:50 +00:00
|
|
|
window_egl);
|
2018-12-14 13:54:24 +00:00
|
|
|
wl_shell_surface_set_title (wl_shell_surface, "OpenGL Renderer");
|
|
|
|
wl_shell_surface_set_toplevel (wl_shell_surface);
|
|
|
|
|
2018-12-14 15:33:50 +00:00
|
|
|
window_egl->window.wl_shell_surface = wl_shell_surface;
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-05-27 06:39:06 +00:00
|
|
|
create_surfaces (GstGLWindowWaylandEGL * window_egl)
|
2012-11-28 14:01:59 +00:00
|
|
|
{
|
2015-05-27 06:39:06 +00:00
|
|
|
gint width, height;
|
|
|
|
|
|
|
|
if (!window_egl->window.surface) {
|
|
|
|
window_egl->window.surface =
|
2020-03-03 00:53:53 +00:00
|
|
|
wl_compositor_create_surface (window_egl->display.compositor);
|
2015-05-27 06:39:06 +00:00
|
|
|
}
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
if (window_egl->window.foreign_surface) {
|
|
|
|
/* (re)parent */
|
2020-03-03 00:53:53 +00:00
|
|
|
if (!window_egl->display.subcompositor) {
|
2015-05-27 06:39:06 +00:00
|
|
|
GST_ERROR_OBJECT (window_egl,
|
|
|
|
"Wayland server does not support subsurfaces");
|
|
|
|
window_egl->window.foreign_surface = NULL;
|
|
|
|
goto shell_window;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!window_egl->window.subsurface) {
|
|
|
|
window_egl->window.subsurface =
|
2020-03-03 00:53:53 +00:00
|
|
|
wl_subcompositor_get_subsurface (window_egl->display.subcompositor,
|
2015-05-27 06:39:06 +00:00
|
|
|
window_egl->window.surface, window_egl->window.foreign_surface);
|
|
|
|
|
|
|
|
wl_subsurface_set_position (window_egl->window.subsurface,
|
|
|
|
window_egl->window.window_x, window_egl->window.window_y);
|
|
|
|
wl_subsurface_set_desync (window_egl->window.subsurface);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
shell_window:
|
2020-03-03 00:53:53 +00:00
|
|
|
if (window_egl->display.xdg_wm_base) {
|
2018-12-14 15:33:50 +00:00
|
|
|
if (!window_egl->window.xdg_surface)
|
|
|
|
create_xdg_surface_and_toplevel (window_egl);
|
|
|
|
} else if (!window_egl->window.wl_shell_surface) {
|
|
|
|
create_wl_shell_surface (window_egl);
|
2015-05-27 06:39:06 +00:00
|
|
|
}
|
|
|
|
}
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2018-08-28 04:31:43 +00:00
|
|
|
/*
|
|
|
|
* render_rect is the application requested size so choose that first if
|
|
|
|
* available.
|
|
|
|
* Else choose the already chosen size if set
|
|
|
|
* Else choose the preferred size if set
|
|
|
|
* Else choose a default value
|
|
|
|
*/
|
|
|
|
if (window_egl->window.render_rect.w > 0)
|
|
|
|
width = window_egl->window.render_rect.w;
|
|
|
|
else if (window_egl->window.window_width > 0)
|
2015-05-27 06:39:06 +00:00
|
|
|
width = window_egl->window.window_width;
|
2017-10-24 07:09:50 +00:00
|
|
|
else if (window_egl->window.preferred_width > 0)
|
|
|
|
width = window_egl->window.preferred_width;
|
2015-05-27 06:39:06 +00:00
|
|
|
else
|
|
|
|
width = 320;
|
|
|
|
window_egl->window.window_width = width;
|
|
|
|
|
2018-08-28 04:31:43 +00:00
|
|
|
if (window_egl->window.render_rect.h > 0)
|
|
|
|
height = window_egl->window.render_rect.h;
|
|
|
|
else if (window_egl->window.window_height > 0)
|
2015-05-27 06:39:06 +00:00
|
|
|
height = window_egl->window.window_height;
|
2017-10-24 07:09:50 +00:00
|
|
|
else if (window_egl->window.preferred_height > 0)
|
|
|
|
height = window_egl->window.preferred_height;
|
2015-05-27 06:39:06 +00:00
|
|
|
else
|
|
|
|
height = 240;
|
|
|
|
window_egl->window.window_height = height;
|
|
|
|
|
|
|
|
if (!window_egl->window.native) {
|
2015-09-17 07:06:37 +00:00
|
|
|
gst_gl_window_resize (GST_GL_WINDOW (window_egl), width, height);
|
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
window_egl->window.native =
|
|
|
|
wl_egl_window_create (window_egl->window.surface, width, height);
|
|
|
|
}
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gl_window_wayland_egl_class_init (GstGLWindowWaylandEGLClass * klass)
|
|
|
|
{
|
|
|
|
GstGLWindowClass *window_class = (GstGLWindowClass *) klass;
|
|
|
|
|
2013-08-15 07:09:04 +00:00
|
|
|
window_class->get_window_handle =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_get_window_handle);
|
2012-11-28 14:01:59 +00:00
|
|
|
window_class->set_window_handle =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_set_window_handle);
|
2015-05-27 06:39:06 +00:00
|
|
|
window_class->show = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_show);
|
2012-11-28 14:01:59 +00:00
|
|
|
window_class->draw = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_draw);
|
2013-06-16 10:38:27 +00:00
|
|
|
window_class->close = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_close);
|
2013-08-15 07:09:04 +00:00
|
|
|
window_class->open = GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_open);
|
|
|
|
window_class->get_display =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_get_display);
|
2015-05-29 08:06:27 +00:00
|
|
|
window_class->set_render_rectangle =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_set_render_rectangle);
|
2017-10-24 07:09:50 +00:00
|
|
|
window_class->set_preferred_size =
|
|
|
|
GST_DEBUG_FUNCPTR (gst_gl_window_wayland_egl_set_preferred_size);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gst_gl_window_wayland_egl_init (GstGLWindowWaylandEGL * window)
|
|
|
|
{
|
2018-08-28 04:31:43 +00:00
|
|
|
window->window.render_rect.w = window->window.render_rect.h = -1;
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Must be called in the gl thread */
|
|
|
|
GstGLWindowWaylandEGL *
|
2015-07-24 07:00:27 +00:00
|
|
|
gst_gl_window_wayland_egl_new (GstGLDisplay * display)
|
2012-11-28 14:01:59 +00:00
|
|
|
{
|
2017-05-15 17:31:31 +00:00
|
|
|
GstGLWindowWaylandEGL *window;
|
|
|
|
|
2015-07-24 07:00:27 +00:00
|
|
|
if ((gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_WAYLAND)
|
|
|
|
== 0)
|
|
|
|
/* we require a wayland display to create wayland surfaces */
|
|
|
|
return NULL;
|
2012-11-30 06:09:21 +00:00
|
|
|
|
|
|
|
GST_DEBUG ("creating Wayland EGL window");
|
|
|
|
|
2017-05-15 17:31:31 +00:00
|
|
|
window = g_object_new (GST_TYPE_GL_WINDOW_WAYLAND_EGL, NULL);
|
|
|
|
gst_object_ref_sink (window);
|
|
|
|
|
|
|
|
return window;
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2020-02-10 18:17:42 +00:00
|
|
|
gst_gl_window_wayland_egl_close (GstGLWindow * gl_window)
|
2012-11-28 14:01:59 +00:00
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl;
|
2020-02-10 18:17:42 +00:00
|
|
|
struct display *display;
|
|
|
|
|
|
|
|
window_egl = GST_GL_WINDOW_WAYLAND_EGL (gl_window);
|
|
|
|
display = &window_egl->display;
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
if (display->pointer != NULL) {
|
|
|
|
wl_pointer_destroy (display->pointer);
|
|
|
|
display->pointer = NULL;
|
|
|
|
}
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
destroy_surfaces (window_egl);
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2015-03-06 04:31:18 +00:00
|
|
|
g_source_destroy (window_egl->wl_source);
|
|
|
|
g_source_unref (window_egl->wl_source);
|
|
|
|
window_egl->wl_source = NULL;
|
2015-06-04 02:16:35 +00:00
|
|
|
|
2020-02-10 18:17:42 +00:00
|
|
|
GST_GL_WINDOW_CLASS (parent_class)->close (gl_window);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
2020-03-03 00:53:53 +00:00
|
|
|
static void
|
|
|
|
handle_xdg_wm_base_ping (void *user_data, struct xdg_wm_base *xdg_wm_base,
|
|
|
|
uint32_t serial)
|
|
|
|
{
|
|
|
|
xdg_wm_base_pong (xdg_wm_base, serial);
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct xdg_wm_base_listener xdg_wm_base_listener = {
|
|
|
|
handle_xdg_wm_base_ping
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
registry_handle_global (void *data, struct wl_registry *registry,
|
|
|
|
uint32_t name, const char *interface, uint32_t version)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_wayland = data;
|
|
|
|
|
|
|
|
GST_TRACE_OBJECT (window_wayland, "registry_handle_global with registry %p, "
|
|
|
|
"interface %s, version %u", registry, interface, version);
|
|
|
|
|
|
|
|
if (g_strcmp0 (interface, "wl_compositor") == 0) {
|
|
|
|
window_wayland->display.compositor =
|
|
|
|
wl_registry_bind (registry, name, &wl_compositor_interface, 1);
|
|
|
|
} else if (g_strcmp0 (interface, "wl_subcompositor") == 0) {
|
|
|
|
window_wayland->display.subcompositor =
|
|
|
|
wl_registry_bind (registry, name, &wl_subcompositor_interface, 1);
|
|
|
|
} else if (g_strcmp0 (interface, "xdg_wm_base") == 0) {
|
|
|
|
window_wayland->display.xdg_wm_base =
|
|
|
|
wl_registry_bind (registry, name, &xdg_wm_base_interface, 1);
|
|
|
|
xdg_wm_base_add_listener (window_wayland->display.xdg_wm_base,
|
|
|
|
&xdg_wm_base_listener, window_wayland);
|
|
|
|
} else if (g_strcmp0 (interface, "wl_shell") == 0) {
|
|
|
|
window_wayland->display.shell =
|
|
|
|
wl_registry_bind (registry, name, &wl_shell_interface, 1);
|
2020-02-10 18:17:42 +00:00
|
|
|
} else if (g_strcmp0 (interface, "wl_seat") == 0) {
|
|
|
|
window_wayland->display.seat =
|
|
|
|
wl_registry_bind (registry, name, &wl_seat_interface, 4);
|
|
|
|
wl_seat_add_listener (window_wayland->display.seat, &seat_listener,
|
|
|
|
window_wayland);
|
2020-03-03 00:53:53 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct wl_registry_listener registry_listener = {
|
|
|
|
registry_handle_global
|
|
|
|
};
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
static gboolean
|
2013-08-15 07:09:04 +00:00
|
|
|
gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error)
|
2013-02-12 12:48:36 +00:00
|
|
|
{
|
2015-07-27 08:21:19 +00:00
|
|
|
GstGLDisplayWayland *display;
|
2013-08-15 07:09:04 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
|
2015-07-27 08:21:19 +00:00
|
|
|
if (!GST_IS_GL_DISPLAY_WAYLAND (window->display)) {
|
|
|
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
|
|
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
|
|
|
"Failed to retrieve Wayland display (wrong type?)");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
display = GST_GL_DISPLAY_WAYLAND (window->display);
|
|
|
|
|
2015-05-21 07:48:31 +00:00
|
|
|
if (!display->display) {
|
2013-02-12 12:48:36 +00:00
|
|
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
|
|
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
2015-06-05 12:35:39 +00:00
|
|
|
"Failed to retrieve Wayland display");
|
2015-05-21 07:48:31 +00:00
|
|
|
return FALSE;
|
2013-02-12 12:48:36 +00:00
|
|
|
}
|
|
|
|
|
2020-03-03 00:53:53 +00:00
|
|
|
/* we create a proxy wrapper for the display so that we can set the queue on
|
|
|
|
* it. This allows us to avoid sprinkling `wl_proxy_set_queue()` calls for
|
|
|
|
* each wayland resource we create as well as removing a race between
|
|
|
|
* creation and the `wl_proxy_set_queue()` call. */
|
|
|
|
window_egl->display.display = wl_proxy_create_wrapper (display->display);
|
|
|
|
window_egl->window.queue =
|
|
|
|
wl_display_create_queue (window_egl->display.display);
|
|
|
|
|
|
|
|
wl_proxy_set_queue ((struct wl_proxy *) window_egl->display.display,
|
|
|
|
window_egl->window.queue);
|
|
|
|
|
|
|
|
window_egl->display.registry =
|
|
|
|
wl_display_get_registry (window_egl->display.display);
|
|
|
|
wl_registry_add_listener (window_egl->display.registry, ®istry_listener,
|
|
|
|
window_egl);
|
|
|
|
|
2020-03-05 01:29:49 +00:00
|
|
|
if (wl_display_roundtrip_queue (display->display,
|
|
|
|
window_egl->window.queue) < 0) {
|
2020-03-03 00:53:53 +00:00
|
|
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
|
|
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
|
|
|
"Failed to perform a wayland roundtrip");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2015-05-22 06:07:49 +00:00
|
|
|
|
|
|
|
window_egl->wl_source = wayland_event_source_new (display->display,
|
|
|
|
window_egl->window.queue);
|
2013-02-12 12:48:36 +00:00
|
|
|
|
2015-06-04 02:16:35 +00:00
|
|
|
if (!GST_GL_WINDOW_CLASS (parent_class)->open (window, error))
|
|
|
|
return FALSE;
|
2012-11-28 14:01:59 +00:00
|
|
|
|
2016-12-14 13:59:45 +00:00
|
|
|
g_source_attach (window_egl->wl_source, window->main_context);
|
2013-07-02 08:33:42 +00:00
|
|
|
|
2015-06-04 02:16:35 +00:00
|
|
|
return TRUE;
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
void
|
|
|
|
gst_gl_window_wayland_egl_create_window (GstGLWindowWaylandEGL * window_egl)
|
|
|
|
{
|
|
|
|
create_surfaces (window_egl);
|
|
|
|
}
|
|
|
|
|
2013-08-15 07:09:04 +00:00
|
|
|
static guintptr
|
|
|
|
gst_gl_window_wayland_egl_get_window_handle (GstGLWindow * window)
|
|
|
|
{
|
|
|
|
return (guintptr) GST_GL_WINDOW_WAYLAND_EGL (window)->window.native;
|
|
|
|
}
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
static void
|
|
|
|
gst_gl_window_wayland_egl_set_window_handle (GstGLWindow * window,
|
|
|
|
guintptr handle)
|
|
|
|
{
|
2015-05-27 06:39:06 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
struct wl_surface *surface = (struct wl_surface *) handle;
|
|
|
|
|
|
|
|
/* already set the NULL handle */
|
|
|
|
if (surface == NULL && window_egl->window.foreign_surface == NULL)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* unparent */
|
|
|
|
destroy_surfaces (window_egl);
|
|
|
|
window_egl->window.foreign_surface = surface;
|
|
|
|
create_surfaces (window_egl);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2018-01-04 04:33:33 +00:00
|
|
|
_roundtrip_async (GstGLWindow * window)
|
2015-05-27 06:39:06 +00:00
|
|
|
{
|
2020-03-03 00:53:53 +00:00
|
|
|
GstGLDisplayWayland *display = GST_GL_DISPLAY_WAYLAND (window->display);
|
2015-05-27 06:39:06 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
|
|
|
|
create_surfaces (window_egl);
|
|
|
|
|
2020-03-05 01:29:49 +00:00
|
|
|
if (wl_display_roundtrip_queue (display->display,
|
|
|
|
window_egl->window.queue) < 0)
|
2015-05-27 06:39:06 +00:00
|
|
|
GST_WARNING_OBJECT (window, "failed a roundtrip");
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
2018-01-04 04:33:33 +00:00
|
|
|
static void
|
|
|
|
gst_gl_window_wayland_egl_show (GstGLWindow * window)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
|
|
|
|
create_surfaces (window_egl);
|
|
|
|
|
|
|
|
gst_gl_window_send_message (window, (GstGLWindowCB) _roundtrip_async, window);
|
|
|
|
}
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
static void
|
|
|
|
window_resize (GstGLWindowWaylandEGL * window_egl, guint width, guint height)
|
|
|
|
{
|
2013-10-01 11:46:46 +00:00
|
|
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
GST_DEBUG ("resizing window from %ux%u to %ux%u",
|
|
|
|
window_egl->window.window_width, window_egl->window.window_height, width,
|
|
|
|
height);
|
|
|
|
|
|
|
|
if (window_egl->window.native) {
|
|
|
|
wl_egl_window_resize (window_egl->window.native, width, height, 0, 0);
|
|
|
|
}
|
|
|
|
|
2015-09-17 07:06:37 +00:00
|
|
|
gst_gl_window_resize (window, width, height);
|
2013-10-01 11:46:46 +00:00
|
|
|
|
2012-11-30 06:09:21 +00:00
|
|
|
window_egl->window.window_width = width;
|
|
|
|
window_egl->window.window_height = height;
|
|
|
|
}
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
static void
|
|
|
|
draw_cb (gpointer data)
|
|
|
|
{
|
2015-01-23 03:11:48 +00:00
|
|
|
GstGLWindowWaylandEGL *window_egl = data;
|
2012-11-30 06:09:21 +00:00
|
|
|
GstGLWindow *window = GST_GL_WINDOW (window_egl);
|
2013-08-15 07:09:04 +00:00
|
|
|
GstGLContext *context = gst_gl_window_get_context (window);
|
2012-11-30 06:09:21 +00:00
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
create_surfaces (window_egl);
|
|
|
|
|
2015-05-29 08:06:27 +00:00
|
|
|
if (window_egl->window.subsurface)
|
|
|
|
wl_subsurface_set_desync (window_egl->window.subsurface);
|
|
|
|
|
2015-09-17 07:06:37 +00:00
|
|
|
if (window->queue_resize) {
|
|
|
|
guint width, height;
|
|
|
|
|
|
|
|
gst_gl_window_get_surface_dimensions (window, &width, &height);
|
|
|
|
gst_gl_window_resize (window, width, height);
|
|
|
|
}
|
|
|
|
|
2012-11-28 14:01:59 +00:00
|
|
|
if (window->draw)
|
|
|
|
window->draw (window->draw_data);
|
|
|
|
|
2017-05-21 10:03:01 +00:00
|
|
|
gst_gl_context_swap_buffers (context);
|
2013-08-15 07:09:04 +00:00
|
|
|
|
2015-05-27 06:39:06 +00:00
|
|
|
if (window_egl->window.subsurface)
|
|
|
|
wl_subsurface_set_desync (window_egl->window.subsurface);
|
|
|
|
|
2013-08-15 07:09:04 +00:00
|
|
|
gst_object_unref (context);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2015-01-23 03:11:48 +00:00
|
|
|
gst_gl_window_wayland_egl_draw (GstGLWindow * window)
|
2012-11-28 14:01:59 +00:00
|
|
|
{
|
2015-01-23 03:11:48 +00:00
|
|
|
gst_gl_window_send_message (window, (GstGLWindowCB) draw_cb, window);
|
2012-11-28 14:01:59 +00:00
|
|
|
}
|
|
|
|
|
2015-05-29 08:06:27 +00:00
|
|
|
struct SetRenderRectangle
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl;
|
|
|
|
GstVideoRectangle rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
_free_set_render_rectangle (struct SetRenderRectangle *render)
|
|
|
|
{
|
|
|
|
if (render) {
|
|
|
|
if (render->window_egl)
|
|
|
|
gst_object_unref (render->window_egl);
|
|
|
|
g_free (render);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_set_render_rectangle (gpointer data)
|
|
|
|
{
|
|
|
|
struct SetRenderRectangle *render = data;
|
|
|
|
|
|
|
|
GST_LOG_OBJECT (render->window_egl, "setting render rectangle %i,%i+%ix%i",
|
|
|
|
render->rect.x, render->rect.y, render->rect.w, render->rect.h);
|
|
|
|
|
|
|
|
if (render->window_egl->window.subsurface) {
|
|
|
|
wl_subsurface_set_sync (render->window_egl->window.subsurface);
|
|
|
|
wl_subsurface_set_position (render->window_egl->window.subsurface,
|
|
|
|
render->rect.x, render->rect.y);
|
|
|
|
render->window_egl->window.window_x = render->rect.x;
|
|
|
|
render->window_egl->window.window_y = render->rect.y;
|
|
|
|
}
|
|
|
|
|
|
|
|
window_resize (render->window_egl, render->rect.w, render->rect.h);
|
2018-08-28 04:31:43 +00:00
|
|
|
|
|
|
|
render->window_egl->window.render_rect = render->rect;
|
2015-05-29 08:06:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gboolean
|
|
|
|
gst_gl_window_wayland_egl_set_render_rectangle (GstGLWindow * window,
|
|
|
|
gint x, gint y, gint width, gint height)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
struct SetRenderRectangle *render;
|
|
|
|
|
|
|
|
render = g_new0 (struct SetRenderRectangle, 1);
|
|
|
|
render->window_egl = gst_object_ref (window_egl);
|
|
|
|
render->rect.x = x;
|
|
|
|
render->rect.y = y;
|
|
|
|
render->rect.w = width;
|
|
|
|
render->rect.h = height;
|
|
|
|
|
|
|
|
gst_gl_window_send_message_async (window,
|
|
|
|
(GstGLWindowCB) _set_render_rectangle, render,
|
|
|
|
(GDestroyNotify) _free_set_render_rectangle);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2017-10-24 07:09:50 +00:00
|
|
|
static void
|
|
|
|
gst_gl_window_wayland_egl_set_preferred_size (GstGLWindow * window, gint width,
|
|
|
|
gint height)
|
|
|
|
{
|
|
|
|
GstGLWindowWaylandEGL *window_egl = GST_GL_WINDOW_WAYLAND_EGL (window);
|
|
|
|
|
|
|
|
window_egl->window.preferred_width = width;
|
|
|
|
window_egl->window.preferred_height = height;
|
2018-08-28 04:31:43 +00:00
|
|
|
if (window_egl->window.render_rect.w < 0
|
|
|
|
&& window_egl->window.render_rect.h < 0) {
|
|
|
|
if (window_egl->window.window_height != height
|
|
|
|
|| window_egl->window.window_width != width) {
|
|
|
|
window_resize (window_egl, width, height);
|
|
|
|
}
|
2017-10-24 07:09:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-15 07:09:04 +00:00
|
|
|
static guintptr
|
|
|
|
gst_gl_window_wayland_egl_get_display (GstGLWindow * window)
|
2013-01-09 13:23:32 +00:00
|
|
|
{
|
2015-05-21 07:48:31 +00:00
|
|
|
GstGLDisplayWayland *display = GST_GL_DISPLAY_WAYLAND (window->display);
|
2013-07-03 07:12:39 +00:00
|
|
|
|
2015-05-21 07:48:31 +00:00
|
|
|
return (guintptr) display->display;
|
2013-01-09 13:23:32 +00:00
|
|
|
}
|