GNOME Bugzilla – Bug 756245
glshader: Add GRAY8 support
Last modified: 2018-11-03 11:42:09 UTC
glshader can take as an input only RGBA format. Adding GRAY8 format as an input will be very important for this element.
Do you want to provide a patch?
(In reply to Sebastian Dröge (slomo) from comment #1) > Do you want to provide a patch? I've tried to make glshader support GRAY8 but I couldn't. I hope to get get some clarification about where to start to do this. From where do this element get the information about it's capabilities (RGBA) ?
(In reply to Hamdi Rakkez from comment #2) > (In reply to Sebastian Dröge (slomo) from comment #1) > From where do this element get the information about it's capabilities > (RGBA) ? From its parent class, GstGLFilter.
Adding GRAY8 to GstGLFilter class in GstStaticPadTemplate gst_gl_filter_sink_pad_template does not solve the problem. Still other modifications are required.
You have to select it somehow with a capsfilter or override the fixate_caps virtual method in your element to select GRAY8 instead of RGBA.
I have used a capsfilter to override caps like this : gst-launch-1.0 videotestsrc ! video/x-raw,format=GRAY8,width=800,height=600 ! imagefreeze ! glupload ! capsfilter caps="video/x-raw(memory:GLMemory),format=GRAY8,width=800,height=600" ! glshader location=my_shader.frag ! glimagesink But I have a link error : ERROR GST_PIPELINE grammar.y:617:gst_parse_perform_link: could not link capsfilter0 to glfiltershader0
That generally means you didn't do the modification correctly. Does gst-inspect-1.0 glshader show the GRAY8 caps? Try running with GST_DEBUG=base*:7 to see what caps are being tried.
No in fact, I have done correctly the modification in GstGLFilter So, gst-inspect-1.0 glshader gives : ... Pad Templates: SRC template: 'src' Availability: Always Capabilities: video/x-raw(memory:GLMemory) format: { RGBA, GRAY8 } width: [ 1, 2147483647 ] height: [ 1, 2147483647 ] framerate: [ 0/1, 2147483647/1 ] SINK template: 'sink' Availability: Always Capabilities: video/x-raw(memory:GLMemory) format: { RGBA, GRAY8 } width: [ 1, 2147483647 ] height: [ 1, 2147483647 ] framerate: [ 0/1, 2147483647/1 ] ...
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/230.