[vlc-devel] [PATCH v2 29/29] opengl: reorder renderers initialization

Alexandre Janniaux ajanni at videolabs.io
Thu Feb 6 17:53:34 CET 2020


Hi,

I'd say that the renderer can more easily fail (more different
kind of input, input chroma, etc) while the sub_renderer almost
always use the same formats.

I believe that would be a valid reason.

Regards,
--
Alexandre Janniaux
Videolabs

On Thu, Feb 06, 2020 at 04:54:50PM +0100, Romain Vimont wrote:
> On Thu, Feb 06, 2020 at 04:35:51PM +0100, Alexandre Janniaux wrote:
> > Hi,
> >
> > On Thu, Feb 06, 2020 at 02:17:58PM +0100, Romain Vimont wrote:
> > > Initialize the main renderer, then the sub renderer. Because.
> >
> > Because what ? :D
>
> I have no good reason to provide :D
> It just seems weird to initialize the sub renderer first ;)
>
> >
> > > ---
> > >  modules/video_output/opengl/vout_helper.c | 23 ++++++++++++-----------
> > >  1 file changed, 12 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/modules/video_output/opengl/vout_helper.c b/modules/video_output/opengl/vout_helper.c
> > > index b7bb6bc363..d4a2eda148 100644
> > > --- a/modules/video_output/opengl/vout_helper.c
> > > +++ b/modules/video_output/opengl/vout_helper.c
> > > @@ -240,16 +240,6 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
> > >
> > >      bool b_dump_shaders = var_InheritInteger(gl, "verbose") >= 4;
> > >
> > > -    vgl->sub_renderer =
> > > -        vlc_gl_sub_renderer_New(gl, &vgl->vt, supports_npot);
> > > -    if (!vgl->sub_renderer)
> > > -    {
> > > -        msg_Err(gl, "Could not create sub renderer");
> > > -        free(vgl);
> > > -        return NULL;
> > > -    }
> > > -
> > > -    GL_ASSERT_NOERROR();
> > >      struct vlc_gl_renderer *renderer = vgl->renderer =
> > >          vlc_gl_renderer_New(gl, &vgl->vt, context, fmt, supports_npot,
> > >                              b_dump_shaders);
> > > @@ -257,7 +247,18 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
> > >      {
> > >          msg_Warn(gl, "Could not create renderer for %4.4s",
> > >                   (const char *) &fmt->i_chroma);
> > > -        vlc_gl_sub_renderer_Delete(vgl->sub_renderer);
> > > +        free(vgl);
> > > +        return NULL;
> > > +    }
> > > +
> > > +    GL_ASSERT_NOERROR();
> > > +
> > > +    vgl->sub_renderer =
> > > +        vlc_gl_sub_renderer_New(gl, &vgl->vt, supports_npot);
> > > +    if (!vgl->sub_renderer)
> > > +    {
> > > +        msg_Err(gl, "Could not create sub renderer");
> > > +        vlc_gl_renderer_Delete(vgl->renderer);
> > >          free(vgl);
> > >          return NULL;
> > >      }
> > > --
> > > 2.25.0
> > >
> > > _______________________________________________
> > > 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
> _______________________________________________
> 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