diff options
author | Matthew Waters <ystreet00@gmail.com> | 2014-03-12 23:46:58 +1100 |
---|---|---|
committer | Matthew Waters <ystreet00@gmail.com> | 2014-03-12 23:46:58 +1100 |
commit | a4ae695cf8d5ff4065a21277ff58493da79aee07 (patch) | |
tree | ff9f7ad06254258f5373dff4536abd0b6e4539db | |
parent | 3cce5e43310ec78116f9eb367f4f0c9a5c7b7968 (diff) |
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.
-rw-r--r-- | gst-libs/gst/gl/x11/gstglcontext_glx.c | 10 |
1 files 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; |