[vlc-devel] [PATCH] opengl: prevent opengl calls from different threads

Rémi Denis-Courmont remi at remlab.net
Thu Sep 26 20:35:12 CEST 2019


Le torstaina 26. syyskuuta 2019, 10.41.57 EEST Steve Lhomme a écrit :
> > @@ -230,7 +242,6 @@ static int Control (vout_display_t *vd, int query,
> > va_list ap)> 
> >         {
> >         
> >           vout_display_cfg_t c = *va_arg (ap, const vout_display_cfg_t *);
> >           const video_format_t *src = &vd->source;
> > 
> > -        vout_display_place_t place;
> > 
> >           /* Reverse vertical alignment as the GL tex are Y inverted */
> >           if (c.align.vertical == VLC_VIDEO_ALIGN_TOP)
> > 
> > @@ -238,13 +249,9 @@ static int Control (vout_display_t *vd, int query,
> > va_list ap)> 
> >           else if (c.align.vertical == VLC_VIDEO_ALIGN_BOTTOM)
> >           
> >               c.align.vertical = VLC_VIDEO_ALIGN_TOP;
> > 
> > -        vout_display_PlacePicture(&place, src, &c);
> > +        vout_display_PlacePicture(&sys->place, src, &c);
> > +        sys->place_changed = true;
> > 
> >           vlc_gl_Resize (sys->gl, c.display.width, c.display.height);
> > 
> > -        if (vlc_gl_MakeCurrent (sys->gl) != VLC_SUCCESS)
> > -            return VLC_SUCCESS;
> > -        vout_display_opengl_SetWindowAspectRatio(sys->vgl,
> > (float)place.width / place.height); -       
> > vout_display_opengl_Viewport(sys->vgl, place.x, place.y, place.width,
> > place.height); -        vlc_gl_ReleaseCurrent (sys->gl);
> 
> Since it's not synchronous anymore, does it work when you're paused ? I
> don't expect PictureDisplay() to be called in that case.

Currently, rendering is forced at a minimum interval when paused because of 
both OSD and window damage (in a large sense, including resizing).

Eventually, we should only render when the content actually needs to be 
rendered again due to OSD update, or window damage, but that makes no 
difference to this particular patchset.

-- 
雷米‧德尼-库尔蒙
http://www.remlab.net/





More information about the vlc-devel mailing list