sdlshare2: Fix race conditions
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 24 Nov 2017 21:58:21 +0000 (16:58 -0500)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 24 Nov 2017 21:58:21 +0000 (16:58 -0500)
commit4f36f75eb1e944bac0aaabc6c4c4aebf67b77251
treed82e3df065e9af07e3e75445b31e79247f3915e5
parentc9e755d79e84b7e5436df9cbb45b8a878f7df476
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