[vlc-devel] [PATCH] gl: favor glx for vdpau chromas

Rémi Denis-Courmont remi at remlab.net
Mon Jul 24 10:38:25 CEST 2017


Le 24 juillet 2017 10:50:50 GMT+03:00, Thomas Guillem <thomas at gllm.fr> a écrit :
>
>
>On Sun, Jul 23, 2017, at 19:26, Rémi Denis-Courmont wrote:
>> Le perjantaina 21. heinäkuuta 2017, 11.47.14 EEST Thomas Guillem a
>écrit
>> :
>> > When using X11, favor glx instead of egl in order to use vdpau
>interop.
>> > ---
>> >  modules/video_output/opengl/display.c | 25
>++++++++++++++++++++++++-
>> >  1 file changed, 24 insertions(+), 1 deletion(-)
>> > 
>> > diff --git a/modules/video_output/opengl/display.c
>> > b/modules/video_output/opengl/display.c index
>63376f1cd8..0e3b5e39e7 100644
>> > --- a/modules/video_output/opengl/display.c
>> > +++ b/modules/video_output/opengl/display.c
>> > @@ -103,7 +103,30 @@ static int Open (vlc_object_t *obj)
>> >          goto error;
>> >      }
>> > 
>> > -    sys->gl = vlc_gl_Create (surface, API, "$" MODULE_VARNAME);
>> > +    const char *gl_name = "$" MODULE_VARNAME;
>> > +#ifndef USE_OPENGL_ES2
>> > +    if (surface->type == VOUT_WINDOW_TYPE_XID)
>> > +    {
>> > +        switch (vd->fmt.i_chroma)
>> > +        {
>> > +            case VLC_CODEC_VDPAU_VIDEO_444:
>> > +            case VLC_CODEC_VDPAU_VIDEO_422:
>> > +            case VLC_CODEC_VDPAU_VIDEO_420:
>> > +            {
>> > +                /* VDPAU GL interop works only with glx for now.
>*/
>> > +                char *str = var_InheritString(surface,
>MODULE_VARNAME);
>> > +                if (str == NULL)
>> > +                    gl_name = "glx";
>> > +                free(str);
>> > +                break;
>> > +            }
>> > +            default:
>> > +                break;
>> > +        }
>> > +    }
>> 
>> Overriding the module preference is a terrible idea. Sooner or later,
>> somebody 
>> will assume the variable works, but it won't. E.g. if LibVLC gained
>> callbacks 
>> for custom GL context.
>
>We respect the user choice if he override the variable. "if LibVLC
>gained callbacks for custom GL context." This is not a problem for 3.0,
>right ? 
>
>> 
>> -- 
>> 雷米‧德尼-库尔蒙
>> https://www.remlab.net/
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

I don't know if it is yet a problem. But this looks like it *will* cause run-time bugs sooner or later, and I don't really see what tge sunset/exit strategy would then be...
-- 
Rémi Denis-Courmont
Typed on an inconvenient virtual keyboard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20170724/9c13a5aa/attachment.html>


More information about the vlc-devel mailing list