From dc469454d7883375c47c47eed8fef8f13a6e8bad Mon Sep 17 00:00:00 2001 From: Matthew Waters Date: Mon, 28 Sep 2015 22:31:09 +1000 Subject: [PATCH] gl: set the context on the element on a context query Otherwise it's possible to lose the context information if the context is only propagated through queries. --- gst-libs/gst/gl/gstglutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c index 2091f4d..cdb341a 100644 --- a/gst-libs/gst/gl/gstglutils.c +++ b/gst-libs/gst/gl/gstglutils.c @@ -512,10 +512,12 @@ _gst_context_query (GstElement * element, gst_query_parse_context (query, &ctxt); GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element, "found context (%p) in downstream query", ctxt); + gst_element_set_context (element, ctxt); } else if (gst_gl_run_query (element, query, GST_PAD_SINK)) { gst_query_parse_context (query, &ctxt); GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element, "found context (%p) in upstream query", ctxt); + gst_element_set_context (element, ctxt); } else { /* 3) Post a GST_MESSAGE_NEED_CONTEXT message on the bus with * the required context type and afterwards check if a @@ -654,6 +656,8 @@ gst_gl_display_context_propagate (GstElement * element, GstGLDisplay * display) context = gst_context_new (GST_GL_DISPLAY_CONTEXT_TYPE, TRUE); gst_context_set_gl_display (context, display); + gst_element_set_context (element, context); + GST_CAT_INFO_OBJECT (GST_CAT_CONTEXT, element, "posting have context (%p) message with display (%p)", context, display); msg = gst_message_new_have_context (GST_OBJECT_CAST (element), context); -- 2.7.4