mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 17:50:36 +00:00
[032/906] * sys/glsink/glimagesink.c: (gst_glimage_sink_stop), (gst_glimage_sink_create_window), (gst_glimage_sink_init_display): Sprinkle in some XSync calls to avoid raciness with broken drivers (ATI) when re-using a single glimagesink.
This commit is contained in:
parent
057fd7ae98
commit
7e83b698c4
1 changed files with 12 additions and 0 deletions
|
@ -355,8 +355,16 @@ gst_glimage_sink_stop (GstBaseSink * bsink)
|
||||||
glimage_sink = GST_GLIMAGE_SINK (bsink);
|
glimage_sink = GST_GLIMAGE_SINK (bsink);
|
||||||
|
|
||||||
if (glimage_sink->display) {
|
if (glimage_sink->display) {
|
||||||
XCloseDisplay (glimage_sink->display);
|
if (glimage_sink->context) {
|
||||||
|
glXDestroyContext (glimage_sink->display, glimage_sink->context);
|
||||||
|
glimage_sink->context = NULL;
|
||||||
}
|
}
|
||||||
|
XSync (glimage_sink->display, False);
|
||||||
|
XCloseDisplay (glimage_sink->display);
|
||||||
|
glimage_sink->display = NULL;
|
||||||
|
}
|
||||||
|
glimage_sink->context = NULL;
|
||||||
|
glimage_sink->window = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -696,6 +704,8 @@ gst_glimage_sink_create_window (GstGLImageSink * glimage_sink)
|
||||||
XMapWindow (glimage_sink->display, glimage_sink->window);
|
XMapWindow (glimage_sink->display, glimage_sink->window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XSync (glimage_sink->display, False);
|
||||||
|
|
||||||
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (glimage_sink),
|
gst_x_overlay_got_xwindow_id (GST_X_OVERLAY (glimage_sink),
|
||||||
glimage_sink->window);
|
glimage_sink->window);
|
||||||
|
|
||||||
|
@ -769,6 +779,8 @@ gst_glimage_sink_init_display (GstGLImageSink * glimage_sink)
|
||||||
window = XCreateWindow (glimage_sink->display, root, 0, 0,
|
window = XCreateWindow (glimage_sink->display, root, 0, 0,
|
||||||
100, 100, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
|
100, 100, 0, visinfo->depth, InputOutput, visinfo->visual, mask, &attr);
|
||||||
|
|
||||||
|
XSync (glimage_sink->display, FALSE);
|
||||||
|
|
||||||
glXMakeCurrent (glimage_sink->display, window, glimage_sink->context);
|
glXMakeCurrent (glimage_sink->display, window, glimage_sink->context);
|
||||||
|
|
||||||
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &glimage_sink->max_texture_size);
|
glGetIntegerv (GL_MAX_TEXTURE_SIZE, &glimage_sink->max_texture_size);
|
||||||
|
|
Loading…
Reference in a new issue