gst_glsl_stage_new_default_fragment returns NULL

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

gst_glsl_stage_new_default_fragment returns NULL

Samuel Hurst
Hi All,


I'm currently trying to debug some code I've been given that is using
the client-draw-callback in glimagesinkelement to overlay some
dynamically created graphics on a video. The first time it's being
called, it follows a code path that seems to be setting up shaders for
the overlayed graphics, but it seems that a call to
gst_glsl_stage_new_default_fragment(ctx) is returning NULL and causing
repercussions later on.

The documentation for this function is seemingly non-existent, and this
isn't my code, so I'm a bit lost as to what could possibly be going
wrong here. Does anyone have any pointers they can give me on how to
debug what's going wrong here?

For reference, this seems to work okay on a desktop, but when trying to
run it on a Raspberry Pi (and hence OpenGL ES 2.0) it seems to fail.
I've pulled out the bits of the code that deal with setting up the
textures, right up until the failure, and you can find this attached.


Thanks in advance,
-Sam

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

gst-glsl-stub.txt (2K) Download Attachment
signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: gst_glsl_stage_new_default_fragment returns NULL

Eric M
You will probably want to make sure you are running the new Stretch release
of Raspbian with the full OpenGL 2 driver (Fake KMS) with gstreamer 1.10.

glimagesink didn't seem to work very well in Jessie, which only comes with
gstreamer 1.4

The client-draw callback did work for me with this example in Stretch with
gstreamer 1.10 and the fake KMS driver with this example, but I found it to
be too slow for my application on the Pi:
https://github.com/GStreamer/gst-plugins-bad/blob/master/tests/examples/gl/generic/cube/main.cpp

After much tinkering, I figured out how to use glfilterapp which was much
faster, and may be an option for you.
https://github.com/Swap-File/gst-context-share/tree/master



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: gst_glsl_stage_new_default_fragment returns NULL

Matthew Waters
In reply to this post by Samuel Hurst
If you look through the code at
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglslstage.c#n191,
you will see that it reaches gst_glsl_stage_new_with_strings() which can
fail when

1. The GL function table does not contain the necessary shader
functions.  On the RPi, this could mean you're not building/running
against the correct OpenGL library/ies.
2. gst_gl_context_supports_glsl_profile_version() returns FALSE. Code
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/gst-libs/gst/gl/gstglsl.c#n558.
This doesn't seem to be the problem here though.

As usual, GST_DEBUG is your friend. Particularly the glshader and *glsl*
categories for shader-specific things.

Hope that helps.
-Matt


On 31/08/17 23:19, Samuel Hurst wrote:



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (527 bytes) Download Attachment