[vlc-devel] [PATCH 1/8] glx: make GLX_ARB_get_proc_address mandatory

Thomas Guillem thomas at gllm.fr
Wed May 23 17:29:59 CEST 2018


On Wed, May 23, 2018, at 15:16, Rémi Denis-Courmont wrote:
> Hmm, so there is a catch-22. We need the extension to load the
> function provided by the extension.> 
>  We can still check at runtime and return an error. If the plugin is
>  loaded lazily, it will prevent aborting on first GPA call. If the
>  plugin is loaded immediately, then loading will fail due to missing
>  GPA (and module subsystem will fall back cleanly).> 
>  Either way compiling a module that always fails makes no sense, and
>  would raise warnings.Do we want to complexity the configure.ac to check for this function ?

I think it's a corner case that is very unlikely to happen for system
running VLC 4.0, that's why this commit was fine to me.
> 
> Le 23 mai 2018 13:43:48 GMT+03:00, Thomas Guillem <thomas at gllm.fr>
> a écrit :>> On Wed, May 23, 2018, at 12:18, Rémi Denis-Courmont wrote:
>>> Err, this is a runtime feature. You can't test it at build time
>>> AFAIK.>> 
>> It's already tested at build time. it just move the check to the
>> opening of the module.>> 
>>> 
>>> Le 23 mai 2018 10:19:21 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a
>>> écrit :>>>> Since the GL display now depends on getProcAddress().
>>>> 
>>>> 
>>>> 
>>>> 
>>>> ---
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  modules/video_output/glx.c | 10 ++++------
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  1 file changed, 4 insertions(+), 6 deletions(-)
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>>>> diff --git a/modules/video_output/glx.c
>>>> b/modules/video_output/glx.c
>>>>>>>> 
>>>> 
>>>> 
>>>> index cb5d53b7db..17188f24b2 100644
>>>> 
>>>> 
>>>> 
>>>> 
>>>> --- a/modules/video_output/glx.c
>>>> 
>>>> 
>>>> 
>>>> 
>>>> +++ b/modules/video_output/glx.c
>>>> 
>>>> 
>>>> 
>>>> 
>>>> @@ -68,11 +68,7 @@ static void SwapBuffers (vlc_gl_t *gl)
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  static void *GetSymbol(vlc_gl_t *gl, const char *procname)
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  {
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      (void) gl;
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -#ifdef GLX_ARB_get_proc_address
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      return glXGetProcAddressARB ((const GLubyte *)procname);
>>>>>>>> 
>>>> 
>>>> 
>>>> -#else
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -    return NULL;
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -#endif
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  }
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  static bool CheckGLX (vlc_object_t *vd, Display *dpy)
>>>> 
>>>> 
>>>> 
>>>> 
>>>> @@ -117,6 +113,10 @@ static int Open (vlc_object_t *obj)
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  {
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      vlc_gl_t *gl = (vlc_gl_t *)obj;
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>> +#ifndef GLX_ARB_get_proc_address
>>>> 
>>>> 
>>>> 
>>>> 
>>>> +    return VLC_EGENERIC;
>>>> 
>>>> 
>>>> 
>>>> 
>>>> +#endif
>>>> 
>>>> 
>>>> 
>>>> 
>>>> +
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      if (gl->surface->type != VOUT_WINDOW_TYPE_XID ||
>>>>      !vlc_xlib_init (obj))
>>>>>>>> 
>>>> 
>>>> 
>>>>          return VLC_EGENERIC;
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>> @@ -209,7 +209,6 @@ static int Open (vlc_object_t *obj)
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      gl->swap = SwapBuffers;
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      gl->getProcAddress = GetSymbol;
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -#ifdef GLX_ARB_get_proc_address
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      bool is_swap_interval_set = false;
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      MakeCurrent (gl);
>>>> 
>>>> 
>>>> 
>>>> 
>>>> @@ -235,7 +234,6 @@ static int Open (vlc_object_t *obj)
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      }
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  # endif
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      ReleaseCurrent (gl);
>>>> 
>>>> 
>>>> 
>>>> 
>>>> -#endif
>>>> 
>>>> 
>>>> 
>>>> 
>>>>  
>>>> 
>>>> 
>>>> 
>>>> 
>>>>      /* XXX: Prevent other gl backends (like EGL) to be opened
>>>>      within the same
>>>>>>>> 
>>>> 
>>>> 
>>>>       * X11 window instance. Indeed, using EGL after GLX on the
>>>>         same X11 window
>>>>>>>> 
>>>> 
>>>> 
>>> 
>>> --
>>> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez
>>> excuser ma brièveté.>>> _________________________________________________
>>> 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é.> _________________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180523/bba6f2e6/attachment.html>


More information about the vlc-devel mailing list