[vlc-devel] [PATCH 2/3] egl: allow window provider to prevent eglTerminate in vlc_gl_t

Alexandre Janniaux ajanni at videolabs.io
Sun Oct 6 22:31:38 CEST 2019


Hi,

I'm sorry to have a layering issue with this.

My point, having the window requesting VLC to not own EGL
means that every clients that needs that need to be aware of
this and use a general-purpose public interface to
workaround the flaws of a legacy display resource
integration.

With what you suggest, the flaws of EGL litterally bleeds on
the whole public API, meaning that not only EGL-aware
clients have to suggest they will use EGL, but
EGL-safe-and-unaware clients like XDG-shell have to suggest
they won't use EGL.

I understand that you want to solve the EGL design mistake
in an elegant way for the VLC framework, so that we never
break any embedding application which might make a
transition from X11 to Wayland. But the expectation on the
extension KHR_display_reference being present are quite low
and I don't even have it on recent Intel or recent AMD
hardware. In the case the application developer has the
extension (which is usually more likely than the end user
having the extension), the application will work as expected
without the safe flag, and will fail miserably on the end
machine, so this doesn't really solve the issue correctly
neither for an added complexity where it shouldn't be
important.

The EGL terminate API design is made so that there is only
one owner in the worst case. For all other WSI we always
make sure we're the owner by creating a display connection
ourselves. But it doesn't work with wayland yet and the flag
I added is litterally:

    "is VLC the owner of this display or not".

We can probably make more elaborated hacks to workaround any
user oversights but it becomes more and more convoluted for
an exagerated cost on the API level and without any strong
safety guarantees. Still, I support you in the absurdity of
this non-refcounted design for nowadays needs, although it's
not the only occurrence we met.

> Really, it's more that if AND ONLY IF it is known there is
> no EGL display, then creating a non-reference-counted EGL
> display is acceptable, because we can safely assume that
> eglTerminate() will drop the one and only reference.

This patch serie has been posted to make wayland video
integration works. What you're saying is litterally that
this wayland integration shouldn't work in EGL
non-refcounted OpenGL mode, which basically means that
there won't be OpenGL neither on the Wayland integration
nor in phonon-vlc backend.

To sum up, it really boils down to getting to what you want
to solve with a tristate value, and explain your stance on
wayland integration with OpenGL support.

Regards,
--
Alexandre Janniaux
Videolabs

On Fri, Oct 04, 2019 at 11:23:37PM +0300, Rémi Denis-Courmont wrote:
> Le torstaina 26. syyskuuta 2019, 12.04.40 EEST Alexandre Janniaux a écrit :
> > If a window provider is using EGL with the same display, the EGL state
> > should be terminated from there instead of from the vlc_gl_t provider.
>
> I don't think so.
>
> If there is an existing EGL display on the WL display, or if the existence of
> an EGL display is unknown or non-constant, then the plugin needs to request
> reference counting. But eglTerminate() still has to be called.
>
> Really, it's more that if AND ONLY IF it is known there is no EGL display,
> then creating a non-reference-counted EGL display is acceptable, because we
> can safely assume that eglTerminate() will drop the one and only reference.
>
> --
> 雷米‧德尼-库尔蒙
> http://www.remlab.net/
>
>
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list