gl/eagl: don't access UIkit objects on the main thread
authorMatthew Waters <matthew@centricular.com>
Fri, 29 May 2020 05:44:55 +0000 (15:44 +1000)
committerMatthew Waters <matthew@centricular.com>
Tue, 2 Jun 2020 04:32:03 +0000 (14:32 +1000)
commitc506adc95003c65be2fd84765e170e1ef76452a5
tree0b649192e4ac3177d24dd8d5b3d497319adae261
parenta57380d7183bb5675a07881959fbfbd1beaeee4a
gl/eagl: don't access UIkit objects on the main thread

This means we cannot access [view layer] or view.bounds from the OpenGL
thread.  This also means that we need to call the main thread when
setting the window handle.  However, we cannot perform that
synchronously as that may deadlock with the application performing the
set_window_handle() call.

We need to defer the actual update and run it asynchronously and wait
for the window handle update internally at each point it is needed.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/372
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/681>
gst-libs/gst/gl/eagl/gstglcontext_eagl.h
gst-libs/gst/gl/eagl/gstglcontext_eagl.m
gst-libs/gst/gl/eagl/gstglios_utils.h [new file with mode: 0644]
gst-libs/gst/gl/eagl/gstglwindow_eagl.h
gst-libs/gst/gl/eagl/gstglwindow_eagl.m
gst-libs/gst/gl/meson.build