[vlc-devel] [PATCH] egl_wl: fallback to eglGetDisplay/eglCreateWindowSurface

Thomas Guillem thomas at gllm.fr
Fri Jun 15 17:33:45 CEST 2018


On Fri, Jun 15, 2018, at 15:54, Rémi Denis-Courmont wrote:
> How do you know that eglGetDisplay expects Wayland?? AFAIK, on Unices,
> it expects a Xlib Display pointer.
I don't, that's why I proposed to the ML.
Apparently, it can be autodetected, cf. here
https://bugs.freedesktop.org/show_bug.cgi?id=103757But it's still recommended to use the extension, so we can drop
this patch.
> 
> Le 15 juin 2018 15:53:17 GMT+03:00, Thomas Guillem <thomas at gllm.fr>
> a écrit :>> If the EGL_EXT_platform_wayland extension is not available.
>> 
>> ---
>> 
>>  modules/video_output/opengl/egl.c | 17 +++++++++++------
>> 
>>  1 file changed, 11 insertions(+), 6 deletions(-)
>> 
>> 
>> 
>> diff --git a/modules/video_output/opengl/egl.c
>> b/modules/video_output/opengl/egl.c
>>>> index 3cfc3f41c3..b30b10af31 100644
>> 
>> --- a/modules/video_output/opengl/egl.c
>> 
>> +++ b/modules/video_output/opengl/egl.c
>> 
>> @@ -267,18 +267,23 @@ static int Open (vlc_object_t *obj, const
>> struct gl_api *api)
>>>>          goto error;
>> 
>>  
>> 
>>  # ifdef EGL_EXT_platform_wayland
>> 
>> -    if (!CheckClientExt("EGL_EXT_platform_wayland"))
>> 
>> -        goto error;
>> 
>> -
>> 
>>      /* Resize() should be called with the proper size before Swap()
>>      */
>>>>      window = wl_egl_window_create(wnd->handle.wl, 1, 1);
>> 
>>      if (window == NULL)
>> 
>>          goto error;
>> 
>>      sys->window = window;
>> 
>>  
>> 
>> -    sys->display = GetDisplayEXT(EGL_PLATFORM_WAYLAND_EXT, wnd-
>>      >display.wl,
>>>> -                                 NULL);
>> 
>> -    createSurface = CreateWindowSurfaceEXT;
>> 
>> +    if (!CheckClientExt("EGL_EXT_platform_wayland"))
>> 
>> +    {
>> 
>> +        sys->display = eglGetDisplay(wnd->display.wl);
>> 
>> +        window = &sys->window;
>> 
>> +    }
>> 
>> +    else
>> 
>> +    {
>> 
>> +        sys->display = GetDisplayEXT(EGL_PLATFORM_WAYLAND_EXT, wnd-
>>          >display.wl,
>>>> +                                     NULL);
>> 
>> +        createSurface = CreateWindowSurfaceEXT;
>> 
>> +    }
>> 
>>  
>> 
>>  # endif 
>> 
> 
> --
>  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/20180615/66f0ab32/attachment.html>


More information about the vlc-devel mailing list