summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-23 10:10:35 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-01-28 16:49:43 +0100
commit2183eb54c12f65767e3d20d38767b96ced97b470 (patch)
tree54fc7191c2b09c01a3b299666fa78925cfe5b07d
parentbd25aeb6ca3201d50bd8780c288b44b1c8b2fc44 (diff)
wayland: fix frame_redraw callback.
The redraw callback needs to be attached to the surface prior to the commit. Otherwise, the callback notifies the next surface repaint, which is not the desired behaviour. i.e. we want to be notified for the surface we have just filled. Another isse was the redraw_pending was reset before the actual completion of the frame redraw callback function, thus causing concurrency issues. e.g. the callback could have been called again, but with a NULL buffer.
-rw-r--r--gst-libs/gst/vaapi/gstvaapiwindow_wayland.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
index c22c6787..850dae40 100644
--- a/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
+++ b/gst-libs/gst/vaapi/gstvaapiwindow_wayland.c
@@ -208,10 +208,10 @@ frame_redraw_callback(void *data, struct wl_callback *callback, uint32_t time)
{
GstVaapiWindowWaylandPrivate * const priv = data;
- priv->redraw_pending = FALSE;
wl_buffer_destroy(priv->buffer);
priv->buffer = NULL;
wl_callback_destroy(callback);
+ priv->redraw_pending = FALSE;
}
static const struct wl_callback_listener frame_callback_listener = {
@@ -292,14 +292,13 @@ gst_vaapi_window_wayland_render(
priv->opaque_region = NULL;
}
- wl_surface_commit(priv->surface);
-
- wl_display_flush(wl_display);
priv->redraw_pending = TRUE;
priv->buffer = buffer;
-
callback = wl_surface_frame(priv->surface);
wl_callback_add_listener(callback, &frame_callback_listener, priv);
+
+ wl_surface_commit(priv->surface);
+ wl_display_flush(wl_display);
GST_VAAPI_OBJECT_UNLOCK_DISPLAY(window);
return TRUE;
}