<html><head></head><body>Hi,<br><br>You wrote already in the previous thread that the window consumer should not have to care about such parameter. If so, it's not a question of how the flag is passed - it should not be passed, and the provider should not use a non-refcounted EGL, and/or not provide a window.<br><br>It's not entirely clear how this works if a legacy GL WSI is used. On X11 it might work regardless of GLX and EGL because different Display* are allocated, but is that guaranteed? What about other windowing systems?<br><br>It's also questionable if the provider can compute the flag at all. I don't know to what extent Qt guarantees that EGL is used but in general, LibVLC bindings or other UI framework might not provide the necessary info and/or guarantees. In other words, on second thought, this is not a boolean, but a tristate: EGL not used, EGL used, and unknown.<br><br>With that, there are three options, make it the responsibility of the GL provider, or the window provider, or go with a tristate. In the earlier case, it means refuse to use EGL on affected windowing systems unless reference counting is available, i.e. LibVLC playing it safe.<br><br>In the second case, it means the window provider has to ensure reference counting is available, otherwise fail safe, i.e. make it someone else's, LibVLC app developers' problem (not safe IMO).<br><br>In the third case, we essentially whitelist window providers with which EGL can be used without reference counting. But we don't fix the ugly entanglement between provider and consumer.<br><br><div class="gmail_quote">Le 26 septembre 2019 12:04:39 GMT+03:00, Alexandre Janniaux <ajanni@videolabs.io> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">UI integration of the video might need shared display, for instance with<br>wayland. When the display connection is shared, calling eglTerminate<br>will destroy every other context. The `has_shared_egl` flag prevents<br>this by notifying the possible EGL clients of the window that they<br>should not terminate the EGLDisplay themselves.<hr> include/vlc_vout_window.h | 15 +++++++++++++++<br> src/video_output/window.c |  1 +<br> 2 files changed, 16 insertions(+)<br><br>diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h<br>index 9116fa65614..10cdc410e51 100644<br>--- a/include/vlc_vout_window.h<br>+++ b/include/vlc_vout_window.h<br>@@ -381,6 +381,21 @@ typedef struct vout_window_t {<br>     struct {<br>         bool has_double_click; /**< Whether double click events are sent,<br>                                     or need to be emulated */<br>+        /**<br>+         * Define whether EGL is used elsewhere within the same display.<br>+         *<br>+         * When this flag is set to `true`, the underlying opengl providers<br>+         * won't terminate EGLDisplay, so the other clients are expected to<br>+         * terminate the EGLDisplay after all VLC OpenGL providers linked to<br>+         * this EGLDisplay have been closed.<br>+         *<br>+         * \remark {<br>+         *   The main reason for this flags is to allow embedding a video into<br>+         *   a client UI which would be using EGL, whenever the window display<br>+         *   needs to be the same between both the UI and the video.<br>+         *   In particular, it would happen with Wayland and a QML client. }<br>+         * */<br>+        bool has_shared_egl;<br>     } info;<br><br>     /* Private place holder for the vout_window_t module (optional)<br>diff --git a/src/video_output/window.c b/src/video_output/window.c<br>index 16ebf9ef5a2..363f5f21854 100644<br>--- a/src/video_output/window.c<br>+++ b/src/video_output/window.c<br>@@ -67,6 +67,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj, const char *module,<br><br>     memset(&window->handle, 0, sizeof(window->handle));<br>     window->info.has_double_click = false;<br>+    window->info.has_shared_egl = false;<br>     window->sys = NULL;<br>     assert(owner != NULL);<br>     window->owner = *owner;<br>--<br>2.23.0<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>