glimagesink: don't make gst_glimage_sink_handle_events call _ensure_gl_setup

gst_glimage_sink_handle_events can be called from the overlay interface and from
the main thread before GL is setup. Before this change, that would call
_ensure_gl_setup() and deadlock on OSX.

Change things so that it's always safe to call gst_glimage_sink_handle_events()
without stuff deadlocking.
This commit is contained in:
Alessandro Decina 2014-11-06 23:58:06 +01:00 committed by Tim-Philipp Müller
parent ab8990c89f
commit c3612847ef

View file

@ -513,6 +513,8 @@ _ensure_gl_setup (GstGLImageSink * gl_sink)
goto context_error;
}
gst_gl_window_handle_events (window, gl_sink->handle_events);
/* setup callbacks */
gst_gl_window_set_resize_callback (window,
GST_GL_WINDOW_RESIZE_CB (gst_glimage_sink_on_resize),
@ -976,9 +978,6 @@ gst_glimage_sink_handle_events (GstVideoOverlay * overlay,
GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (overlay);
glimage_sink->handle_events = handle_events;
_ensure_gl_setup (glimage_sink);
if (G_LIKELY (glimage_sink->context)) {
GstGLWindow *window;
window = gst_gl_context_get_window (glimage_sink->context);