sdlshare2: Fix race conditions
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 24 Nov 2017 21:58:21 +0000 (16:58 -0500)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:31 +0000 (19:32 +0000)
commit9e208ba0b6bea2372f55746c7b4a38161f27480d
tree0e4d10251b256e5f6a3221bec6043e2c5dbc4631
parentdea918a835d134fb9f7a2cb423d7108eecd73557
sdlshare2: Fix race conditions

The client-draw callback is running on the GL Thread, which will
be required to map the buffer. Map early, and pass the mapped
frame instead. On top of that, make sure to signal any pending
draw before trying to push EOS, as some pad locks might be taken.
This is the cost of using the same thread to control GStreamer and
to render GL.
tests/examples/gl/sdl/sdlshare2.c