mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 09:10:36 +00:00
wayland: refactor _sync() method and rename callback
This patch only intends to improve readability: in the method gst_vaapi_window_wayland_sync() the if/do instructions are squashed into a single while loop. Also renames the frame_redraw_callback() callback into frame_done_callback(), which is a bit more aligned to Wayland API.
This commit is contained in:
parent
7548c72a7d
commit
af8ea3701e
1 changed files with 5 additions and 7 deletions
|
@ -163,14 +163,12 @@ gst_vaapi_window_wayland_sync (GstVaapiWindow * window)
|
|||
GstVaapiWindowWaylandPrivate *const priv =
|
||||
GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (window);
|
||||
|
||||
if (priv->frame_pending) {
|
||||
while (priv->frame_pending) {
|
||||
struct wl_display *const wl_display =
|
||||
GST_VAAPI_OBJECT_NATIVE_DISPLAY (window);
|
||||
|
||||
do {
|
||||
if (wl_display_dispatch_queue (wl_display, priv->event_queue) < 0)
|
||||
return FALSE;
|
||||
} while (priv->frame_pending);
|
||||
if (wl_display_dispatch_queue (wl_display, priv->event_queue) < 0)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -324,7 +322,7 @@ gst_vaapi_window_wayland_resize (GstVaapiWindow * window,
|
|||
}
|
||||
|
||||
static void
|
||||
frame_redraw_callback (void *data, struct wl_callback *callback, uint32_t time)
|
||||
frame_done_callback (void *data, struct wl_callback *callback, uint32_t time)
|
||||
{
|
||||
FrameState *const frame = data;
|
||||
GstVaapiWindowWaylandPrivate *const priv =
|
||||
|
@ -335,7 +333,7 @@ frame_redraw_callback (void *data, struct wl_callback *callback, uint32_t time)
|
|||
}
|
||||
|
||||
static const struct wl_callback_listener frame_callback_listener = {
|
||||
frame_redraw_callback
|
||||
frame_done_callback
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue