glupload: provide the output buffer that is rendered into
authorMatthew Waters <ystreet00@gmail.com>
Sun, 21 Sep 2014 11:36:49 +0000 (21:36 +1000)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:31:46 +0000 (19:31 +0000)
commit6491af9ffcac1d3524da0e53c3001fcde2916005
tree786056958e93e0713b505547817cd4f19b575a74
parent4e75ceba467232466a72675645a2d57d383c2bfd
glupload: provide the output buffer that is rendered into

Allows callers to properly reference count the buffers used for
rendering.

Fixes a redraw race in glimagesink where the previous buffer
(the one used for redraw operations) is freed as soon as the next
buffer is uploaded.

1. glimagesink uploads in _prepare() to texture n
1.1 glupload holds buffer n
2. glimagesink _render()s texture n
3. glimagesink uploads texture n+1
3.1 glupload free previous buffer which deletes texture n
3.2 glupload holds buffer n+1
4. glwindow resize/expose
5. glimagesink redraws with texture n

The race is that the buffer n (the one used for redrawing) is freed as soon as
the buffer n+1 arrives.  There could be any amount of time and number of
redraws between this event and when buffer n+1 is actually rendered and thus
replaces buffer n as the redraw source.

https://bugzilla.gnome.org/show_bug.cgi?id=736740
ext/gl/gstglimagesink.c
ext/gl/gstglimagesink.h
ext/gl/gstglmixer.c
gst-libs/gst/gl/gstglfilter.c
gst-libs/gst/gl/gstglupload.c
gst-libs/gst/gl/gstglupload.h