macOS gst-plugins-base/gl/cocoa: UI API called on a background thread: -[NSView removeFromSuperview]

The problem inside gstglwindow_cocoa.m, all UI operations must be called from main UI thread.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/568
Fixes #568
This commit is contained in:
Roman Shpuntov 2019-03-20 18:44:12 +07:00
parent 6a99ad2c02
commit 31cb8500ee

View file

@ -240,16 +240,24 @@ gst_gl_window_cocoa_open (GstGLWindow *window, GError **err)
} }
static void static void
gst_gl_window_cocoa_close (GstGLWindow *window) _close_window (gpointer * data)
{ {
GstGLWindowCocoa *window_cocoa = GST_GL_WINDOW_COCOA (window); GstGLWindowCocoa *window_cocoa = GST_GL_WINDOW_COCOA (data);
GstGLNSWindow *internal_win_id = (__bridge GstGLNSWindow *)window_cocoa->priv->internal_win_id; GstGLNSWindow *internal_win_id =
(__bridge GstGLNSWindow *) window_cocoa->priv->internal_win_id;
[[internal_win_id contentView] removeFromSuperview]; [[internal_win_id contentView] removeFromSuperview];
CFBridgingRelease(window_cocoa->priv->internal_win_id); CFBridgingRelease (window_cocoa->priv->internal_win_id);
window_cocoa->priv->internal_win_id = NULL; window_cocoa->priv->internal_win_id = NULL;
} }
static void
gst_gl_window_cocoa_close (GstGLWindow * window)
{
_invoke_on_main ((GstGLWindowCB) _close_window, gst_object_ref (window),
(GDestroyNotify) gst_object_unref);
}
static guintptr static guintptr
gst_gl_window_cocoa_get_window_handle (GstGLWindow *window) gst_gl_window_cocoa_get_window_handle (GstGLWindow *window)
{ {