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:
parent
b60fe0271f
commit
7d48fe1c1e
@ -513,6 +513,8 @@ _ensure_gl_setup (GstGLImageSink * gl_sink)
|
|||||||
goto context_error;
|
goto context_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gst_gl_window_handle_events (window, gl_sink->handle_events);
|
||||||
|
|
||||||
/* setup callbacks */
|
/* setup callbacks */
|
||||||
gst_gl_window_set_resize_callback (window,
|
gst_gl_window_set_resize_callback (window,
|
||||||
GST_GL_WINDOW_RESIZE_CB (gst_glimage_sink_on_resize),
|
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);
|
GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (overlay);
|
||||||
|
|
||||||
glimage_sink->handle_events = handle_events;
|
glimage_sink->handle_events = handle_events;
|
||||||
|
|
||||||
_ensure_gl_setup (glimage_sink);
|
|
||||||
|
|
||||||
if (G_LIKELY (glimage_sink->context)) {
|
if (G_LIKELY (glimage_sink->context)) {
|
||||||
GstGLWindow *window;
|
GstGLWindow *window;
|
||||||
window = gst_gl_context_get_window (glimage_sink->context);
|
window = gst_gl_context_get_window (glimage_sink->context);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user