mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-13 02:45:35 +00:00
Revert "gl/window/x11: don't create our own X11 display"
This reverts commit 5697b6b89b
.
https://bugzilla.gnome.org/show_bug.cgi?id=751003
This commit is contained in:
parent
30e13d6623
commit
5df0fbfbca
1 changed files with 14 additions and 1 deletions
|
@ -149,7 +149,8 @@ gst_gl_window_x11_open (GstGLWindow * window, GError ** error)
|
||||||
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
|
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
|
||||||
GstGLDisplayX11 *display_x11 = (GstGLDisplayX11 *) window->display;
|
GstGLDisplayX11 *display_x11 = (GstGLDisplayX11 *) window->display;
|
||||||
|
|
||||||
window_x11->device = display_x11->display;
|
window_x11->device = XOpenDisplay (display_x11->name);
|
||||||
|
// window_x11->device = display_x11->display;
|
||||||
if (window_x11->device == NULL) {
|
if (window_x11->device == NULL) {
|
||||||
g_set_error (error, GST_GL_WINDOW_ERROR,
|
g_set_error (error, GST_GL_WINDOW_ERROR,
|
||||||
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
GST_GL_WINDOW_ERROR_RESOURCE_UNAVAILABLE,
|
||||||
|
@ -157,6 +158,8 @@ gst_gl_window_x11_open (GstGLWindow * window, GError ** error)
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XSynchronize (window_x11->device, FALSE);
|
||||||
|
|
||||||
GST_LOG ("gl device id: %ld", (gulong) window_x11->device);
|
GST_LOG ("gl device id: %ld", (gulong) window_x11->device);
|
||||||
|
|
||||||
window_x11->screen = DefaultScreenOfDisplay (window_x11->device);
|
window_x11->screen = DefaultScreenOfDisplay (window_x11->device);
|
||||||
|
@ -272,8 +275,13 @@ void
|
||||||
gst_gl_window_x11_close (GstGLWindow * window)
|
gst_gl_window_x11_close (GstGLWindow * window)
|
||||||
{
|
{
|
||||||
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
|
GstGLWindowX11 *window_x11 = GST_GL_WINDOW_X11 (window);
|
||||||
|
GstGLDisplay *display = window->display;
|
||||||
|
XEvent event;
|
||||||
|
|
||||||
if (window_x11->device) {
|
if (window_x11->device) {
|
||||||
|
/* Avoid BadDrawable Errors... */
|
||||||
|
if (gst_gl_display_get_handle_type (display) & GST_GL_DISPLAY_TYPE_X11)
|
||||||
|
XSync (GST_GL_DISPLAY_X11 (display)->display, FALSE);
|
||||||
|
|
||||||
if (window_x11->internal_win_id)
|
if (window_x11->internal_win_id)
|
||||||
XUnmapWindow (window_x11->device, window_x11->internal_win_id);
|
XUnmapWindow (window_x11->device, window_x11->internal_win_id);
|
||||||
|
@ -285,7 +293,12 @@ gst_gl_window_x11_close (GstGLWindow * window)
|
||||||
window_x11->root, 0, 0);
|
window_x11->root, 0, 0);
|
||||||
XDestroyWindow (window_x11->device, window_x11->internal_win_id);
|
XDestroyWindow (window_x11->device, window_x11->internal_win_id);
|
||||||
}
|
}
|
||||||
|
XSync (window_x11->device, FALSE);
|
||||||
|
|
||||||
|
while (XPending (window_x11->device))
|
||||||
|
XNextEvent (window_x11->device, &event);
|
||||||
|
|
||||||
|
XCloseDisplay (window_x11->device);
|
||||||
GST_DEBUG ("display receiver closed");
|
GST_DEBUG ("display receiver closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue