From 143f9abf49f9e011669319cbd0327f622ff5b4d2 Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Fri, 1 Sep 2017 15:00:12 +1000 Subject: [PATCH] gtkglsink: expose the created display and context correctly 1. Propagate the GstGLDisplay we create 2. Add the created GstGLContext to the propagated GstGLDisplay Otherwise with multi-branch GL pipelines involving gtkglsink, things will fall apart and errors will be genarated somewhere. --- gst-libs/gst/gl/gstglutils.c | 7 ++++--- gst-libs/gst/gl/gstglutils.h | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 9f7c06d3a6..8310c415f6 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -218,8 +218,9 @@ gst_gl_context_query (GstElement * element) /* 4) Create a context by itself and post a GST_MESSAGE_HAVE_CONTEXT * message. */ -static void -gst_gl_display_context_propagate (GstElement * element, GstGLDisplay * display) +void +gst_gl_element_propagate_display_context (GstElement * element, + GstGLDisplay * display) { GstContext *context; GstMessage *msg; @@ -295,7 +296,7 @@ gst_gl_ensure_element_data (gpointer element, GstGLDisplay ** display_ptr, *display_ptr = display; - gst_gl_display_context_propagate (element, display); + gst_gl_element_propagate_display_context (element, display); get_gl_context: if (*other_context_ptr) diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h index 4139302c2b..d39f68306b 100644 --- a/gst-libs/gst/gl/gstglutils.h +++ b/gst-libs/gst/gl/gstglutils.h @@ -41,6 +41,9 @@ GST_EXPORT gboolean gst_gl_query_local_gl_context (GstElement * element, GstPadDirection direction, GstGLContext ** context_ptr); +GST_EXPORT +void gst_gl_element_propagate_display_context (GstElement * element, GstGLDisplay * display); + GST_EXPORT gsize gst_gl_get_plane_data_size (GstVideoInfo * info, GstVideoAlignment * align, guint plane);