mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
gl/wayland: allow a NULL wl_event_queue
perform operations on the default wl_display event queue in that case
This commit is contained in:
parent
79f4a5fcf3
commit
8404981dfb
1 changed files with 12 additions and 4 deletions
|
@ -62,9 +62,14 @@ gst_gl_wl_display_roundtrip_queue (struct wl_display *display,
|
||||||
if (callback == NULL)
|
if (callback == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
wl_callback_add_listener (callback, &sync_listener, &done);
|
wl_callback_add_listener (callback, &sync_listener, &done);
|
||||||
|
if (queue) {
|
||||||
wl_proxy_set_queue ((struct wl_proxy *) callback, queue);
|
wl_proxy_set_queue ((struct wl_proxy *) callback, queue);
|
||||||
while (!done && ret >= 0)
|
while (!done && ret >= 0)
|
||||||
ret = wl_display_dispatch_queue (display, queue);
|
ret = wl_display_dispatch_queue (display, queue);
|
||||||
|
} else {
|
||||||
|
while (!done && ret >= 0)
|
||||||
|
ret = wl_display_dispatch (display);
|
||||||
|
}
|
||||||
|
|
||||||
if (ret == -1 && !done)
|
if (ret == -1 && !done)
|
||||||
wl_callback_destroy (callback);
|
wl_callback_destroy (callback);
|
||||||
|
@ -114,7 +119,10 @@ wayland_event_source_dispatch (GSource * base,
|
||||||
WaylandEventSource *source = (WaylandEventSource *) base;
|
WaylandEventSource *source = (WaylandEventSource *) base;
|
||||||
|
|
||||||
if (source->pfd.revents) {
|
if (source->pfd.revents) {
|
||||||
|
if (source->queue)
|
||||||
wl_display_roundtrip_queue (source->display, source->queue);
|
wl_display_roundtrip_queue (source->display, source->queue);
|
||||||
|
else
|
||||||
|
wl_display_roundtrip (source->display);
|
||||||
source->pfd.revents = 0;
|
source->pfd.revents = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue