[vlc-devel] [PATCH 1/3] window: add has_shared_egl info flag

Rémi Denis-Courmont remi at remlab.net
Wed Oct 2 10:18:47 CEST 2019


Hi,

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.

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?

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.

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.

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).

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.

Le 26 septembre 2019 12:04:39 GMT+03:00, Alexandre Janniaux <ajanni at videolabs.io> a écrit :
>UI integration of the video might need shared display, for instance
>with
>wayland. When the display connection is shared, calling eglTerminate
>will destroy every other context. The `has_shared_egl` flag prevents
>this by notifying the possible EGL clients of the window that they
>should not terminate the EGLDisplay themselves.
>---
> include/vlc_vout_window.h | 15 +++++++++++++++
> src/video_output/window.c |  1 +
> 2 files changed, 16 insertions(+)
>
>diff --git a/include/vlc_vout_window.h b/include/vlc_vout_window.h
>index 9116fa65614..10cdc410e51 100644
>--- a/include/vlc_vout_window.h
>+++ b/include/vlc_vout_window.h
>@@ -381,6 +381,21 @@ typedef struct vout_window_t {
>     struct {
>      bool has_double_click; /**< Whether double click events are sent,
>                                     or need to be emulated */
>+        /**
>+         * Define whether EGL is used elsewhere within the same
>display.
>+         *
>+         * When this flag is set to `true`, the underlying opengl
>providers
>+         * won't terminate EGLDisplay, so the other clients are
>expected to
>+         * terminate the EGLDisplay after all VLC OpenGL providers
>linked to
>+         * this EGLDisplay have been closed.
>+         *
>+         * \remark {
>+         *   The main reason for this flags is to allow embedding a
>video into
>+         *   a client UI which would be using EGL, whenever the window
>display
>+         *   needs to be the same between both the UI and the video.
>+         *   In particular, it would happen with Wayland and a QML
>client. }
>+         * */
>+        bool has_shared_egl;
>     } info;
>
>     /* Private place holder for the vout_window_t module (optional)
>diff --git a/src/video_output/window.c b/src/video_output/window.c
>index 16ebf9ef5a2..363f5f21854 100644
>--- a/src/video_output/window.c
>+++ b/src/video_output/window.c
>@@ -67,6 +67,7 @@ vout_window_t *vout_window_New(vlc_object_t *obj,
>const char *module,
>
>     memset(&window->handle, 0, sizeof(window->handle));
>     window->info.has_double_click = false;
>+    window->info.has_shared_egl = false;
>     window->sys = NULL;
>     assert(owner != NULL);
>     window->owner = *owner;
>--
>2.23.0
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20191002/6b51a4d2/attachment.html>


More information about the vlc-devel mailing list