mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +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 =
|
GstVaapiWindowWaylandPrivate *const priv =
|
||||||
GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (window);
|
GST_VAAPI_WINDOW_WAYLAND_GET_PRIVATE (window);
|
||||||
|
|
||||||
if (priv->frame_pending) {
|
while (priv->frame_pending) {
|
||||||
struct wl_display *const wl_display =
|
struct wl_display *const wl_display =
|
||||||
GST_VAAPI_OBJECT_NATIVE_DISPLAY (window);
|
GST_VAAPI_OBJECT_NATIVE_DISPLAY (window);
|
||||||
|
|
||||||
do {
|
if (wl_display_dispatch_queue (wl_display, priv->event_queue) < 0)
|
||||||
if (wl_display_dispatch_queue (wl_display, priv->event_queue) < 0)
|
return FALSE;
|
||||||
return FALSE;
|
|
||||||
} while (priv->frame_pending);
|
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -324,7 +322,7 @@ gst_vaapi_window_wayland_resize (GstVaapiWindow * window,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
FrameState *const frame = data;
|
||||||
GstVaapiWindowWaylandPrivate *const priv =
|
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 = {
|
static const struct wl_callback_listener frame_callback_listener = {
|
||||||
frame_redraw_callback
|
frame_done_callback
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue