summaryrefslogtreecommitdiff
path: root/gst-libs/gst/vaapi
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-11-02 18:18:37 +0000
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2012-11-19 09:29:50 +0100
commit5650202903c65ce7448495923ab961d3d4c9faf4 (patch)
treefac4fc2698ef69cc2d254c4616f98e6cef1a79d3 /gst-libs/gst/vaapi
parent262ad0419dd0d4d5d2fa63ca82161a3fe37e2000 (diff)
wayland: port to 1.0 version of the protocol.
This patch updates to relect the 1.0 version of the protocol. The main changes are the switch to wl_registry for global object notifications and the way that the event queue and file descriptor is processed. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Diffstat (limited to 'gst-libs/gst/vaapi')
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay_wayland.c38
-rw-r--r--gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h2
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow_wayland.c6
3 files changed, 22 insertions, 24 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
index 1ebeb3d3..ec2c81a2 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
+++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland.c
@@ -253,34 +253,31 @@ static const struct wl_output_listener output_listener = {
};
static void
-display_handle_global(
- struct wl_display *display,
- uint32_t id,
- const char *interface,
- uint32_t version,
- void *data
+registry_handle_global(
+ void *data,
+ struct wl_registry *registry,
+ uint32_t id,
+ const char *interface,
+ uint32_t version
)
{
GstVaapiDisplayWaylandPrivate * const priv = data;
if (strcmp(interface, "wl_compositor") == 0)
- priv->compositor = wl_display_bind(display, id, &wl_compositor_interface);
+ priv->compositor =
+ wl_registry_bind(registry, id, &wl_compositor_interface, 1);
else if (strcmp(interface, "wl_shell") == 0)
- priv->shell = wl_display_bind(display, id, &wl_shell_interface);
+ priv->shell = wl_registry_bind(registry, id, &wl_shell_interface, 1);
else if (strcmp(interface, "wl_output") == 0) {
- priv->output = wl_display_bind(display, id, &wl_output_interface);
+ priv->output = wl_registry_bind(registry, id, &wl_output_interface, 1);
wl_output_add_listener(priv->output, &output_listener, priv);
}
}
-static int
-event_mask_update(uint32_t mask, void *data)
-{
- GstVaapiDisplayWaylandPrivate * const priv = data;
-
- priv->event_mask = mask;
- return 0;
-}
+static const struct wl_registry_listener registry_listener = {
+ registry_handle_global,
+ NULL,
+};
static gboolean
gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
@@ -296,9 +293,9 @@ gst_vaapi_display_wayland_open_display(GstVaapiDisplay * display)
return FALSE;
wl_display_set_user_data(priv->wl_display, priv);
- wl_display_add_global_listener(priv->wl_display, display_handle_global, priv);
- priv->event_fd = wl_display_get_fd(priv->wl_display, event_mask_update, priv);
- wl_display_iterate(priv->wl_display, priv->event_mask);
+ priv->registry = wl_display_get_registry(priv->wl_display);
+ wl_registry_add_listener(priv->registry, &registry_listener, priv);
+ priv->event_fd = wl_display_get_fd(priv->wl_display);
wl_display_roundtrip(priv->wl_display);
if (!priv->compositor) {
@@ -477,7 +474,6 @@ gst_vaapi_display_wayland_init(GstVaapiDisplayWayland *display)
priv->phys_width = 0;
priv->phys_height = 0;
priv->event_fd = -1;
- priv->event_mask = 0;
}
/**
diff --git a/gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h b/gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h
index 429de368..1fff4586 100644
--- a/gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h
+++ b/gst-libs/gst/vaapi/gstvaapidisplay_wayland_priv.h
@@ -51,12 +51,12 @@ struct _GstVaapiDisplayWaylandPrivate {
struct wl_compositor *compositor;
struct wl_shell *shell;
struct wl_output *output;
+ struct wl_registry *registry;
guint width;
guint height;
guint phys_width;
guint phys_height;
gint event_fd;
- guint32 event_mask;
guint create_display : 1;
};
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
index 8e04f2d7..c22c6787 100644
--- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
+++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
@@ -260,7 +260,7 @@ gst_vaapi_window_wayland_render(
/* Wait for the previous frame to complete redraw */
if (priv->redraw_pending)
- wl_display_iterate(wl_display, WL_DISPLAY_READABLE);
+ wl_display_dispatch(wl_display);
/* XXX: use VA/VPP for other filters */
va_flags = from_GstVaapiSurfaceRenderFlags(flags);
@@ -292,7 +292,9 @@ gst_vaapi_window_wayland_render(
priv->opaque_region = NULL;
}
- wl_display_iterate(wl_display, WL_DISPLAY_WRITABLE);
+ wl_surface_commit(priv->surface);
+
+ wl_display_flush(wl_display);
priv->redraw_pending = TRUE;
priv->buffer = buffer;