<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi! <div class=""><br class=""></div><div class="">Working on a project to perform GL rendering based on multiple inputs in GLMemory using the gstreamer rust bindings. </div><div class="">From previous suggestions we decided to use the GstAggregator as a base class for our element. (Rust impl exists)</div><div class="">(See prev thread for more context: <a href="https://lists.freedesktop.org/archives/gstreamer-devel/2022-November/080619.html" class="">https://lists.freedesktop.org/archives/gstreamer-devel/2022-November/080619.html</a>)</div><div class=""><br class=""></div><div class="">I have stumbled upon some issues with handling the GLContext when creating custom shaders. When I try to create a GLSL Stage I fail with:</div><div class=""><br class=""></div><div class="">* (gst-launch-1.0:93053): GStreamer-GL-CRITICAL **: 10:10:35.633: gst_gl_context_thread_add: assertion 'GST_IS_GL_CONTEXT (context)’ failed</div><div class=""><br class=""></div><div class="">It might seem that I fail to crate the context somehow or I don’t set it properly. How should the GLContext be handled using the aggregator as a base class?</div><div class="">I simply create the GLContext in the start method for my element and intent to pass the context trough to the methods where I intend to use GL calls.</div><div class=""><br class=""></div><div class="">// fn start</div><span class="">let gl_display = GLDisplay::new();<br class="">let gl_context = GLContext::new(&gl_display);<br class="">gl_context.activate(true).unwrap();</span><div class=""><span class=""><br class=""></span><span class="">let shader_program = GLShader::new(gl_context);<br class="">let vertex_shader = GLSLStage::new_default_vertex(gl_context); // Crash<br class=""></span><span class=""><br class=""></span><div class="">And also can I expect to input GLMemory and output GLMemory using this baseclass  by using glupload/gldownload? </div><div class="">I am guessing that there might be a performance hit if I don’t input/output GLMemory, and instead handle that in the element.. </div><div class=""> </div><div class="">I have previous successfully managed to get gl textures passing through the element like so feels like I am not handling the context correct.</div><div class="">(gst-launch-1.0 videotestsrc ! ... ! glupload ! <ELEMENT>  ! gldownload ! ... ! autovideosink</div><div class=""><br class=""></div><div class="">Any tips and help is greatly appreciated!</div><div class=""><br class=""></div><div class="">Daniel Pendse</div></div></body></html>