From 6300c2ef1b4db90c59fa107c9effca931b7ebbd8 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Wed, 12 Mar 2014 23:46:58 +1100 Subject: [PATCH] [901/906] glx: use the display handle from the global display Intel drivers require the display handles be the same for context sharing to occur. Also solves some cases of use after free of the display when integrating with gstreamer-vaapi. See https://bugs.freedesktop.org/show_bug.cgi?id=41736 for the intel bug. --- gst-libs/gst/gl/x11/gstglcontext_glx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gst-libs/gst/gl/x11/gstglcontext_glx.c b/gst-libs/gst/gl/x11/gstglcontext_glx.c index aeff736..400e629 100644 --- a/gst-libs/gst/gl/x11/gstglcontext_glx.c +++ b/gst-libs/gst/gl/x11/gstglcontext_glx.c @@ -163,7 +163,7 @@ gst_gl_context_glx_create_context (GstGLContext * context, external_gl_context = gst_gl_context_get_gl_context (other_context); } - device = (Display *) gst_gl_window_get_display (window); + device = (Display *) gst_gl_display_get_handle (window->display); glx_exts = glXQueryExtensionsString (device, DefaultScreen (device)); create_context = gst_gl_check_extension ("GLX_ARB_create_context", glx_exts); @@ -248,7 +248,7 @@ gst_gl_context_glx_destroy_context (GstGLContext * context) context_glx = GST_GL_CONTEXT_GLX (context); window = gst_gl_context_get_window (context); - device = (Display *) gst_gl_window_get_display (window); + device = (Display *) gst_gl_display_get_handle (window->display); glXDestroyContext (device, context_glx->glx_context); @@ -270,7 +270,7 @@ gst_gl_context_glx_choose_format (GstGLContext * context, GError ** error) context_glx = GST_GL_CONTEXT_GLX (context); window = gst_gl_context_get_window (context); window_x11 = GST_GL_WINDOW_X11 (window); - device = (Display *) gst_gl_window_get_display (window); + device = (Display *) gst_gl_display_get_handle (window->display); if (!glXQueryExtension (device, &error_base, &event_base)) { g_set_error (error, GST_GL_CONTEXT_ERROR, @@ -362,7 +362,7 @@ static void gst_gl_context_glx_swap_buffers (GstGLContext * context) { GstGLWindow *window = gst_gl_context_get_window (context); - Display *device = (Display *) gst_gl_window_get_display (window); + Display *device = (Display *) gst_gl_display_get_handle (window->display); Window window_handle = (Window) gst_gl_window_get_window_handle (window); glXSwapBuffers (device, window_handle); @@ -380,7 +380,7 @@ static gboolean gst_gl_context_glx_activate (GstGLContext * context, gboolean activate) { GstGLWindow *window = gst_gl_context_get_window (context); - Display *device = (Display *) gst_gl_window_get_display (window); + Display *device = (Display *) gst_gl_display_get_handle (window->display); Window window_handle = (Window) gst_gl_window_get_window_handle (window); gboolean result; -- 2.7.4