Update GLSL uniforms (glshader element)

Yu You youyu.youyu at gmail.com
Fri May 7 07:07:31 UTC 2021


Thanks Matt

Yes, I am sure I have Graphene compiled to the gst-plugin-base.

The question is how to create a GObject.Value with "Graphene.Vec2"? The
sample code is shown in *Python*. I simply could not find any document
about how to assign a "Graphene.Vec2" object as the GObject.Value to the
Gst.Structure. Should I define the value as a boxed one?

Thanks.

BRs,

Yu



On Thu, 6 May 2021 at 16:18, Matthew Waters <ystreet00 at gmail.com> wrote:

> Hi,
>
> On 6/5/21 9:40 pm, Yu You via gstreamer-devel wrote:
>
> Hi,
>
> There's a way to modify uniform variables for the glshader element.
> The following is an example of changing simple value types like float.
>
>
>     uniforms = Gst.Structure.new_empty("uniforms")
>     u1 = GObject.Value(GObject.TYPE_FLOAT)
>     u1.set_float(hdegree)
>     uniforms.set_value("u1", u1)
>     shader.set_property("uniforms", uniforms)
>     uniforms.free()
>
> But it is common in GLSL shader we use data types like Vec2/Vec3.
> The following code did not work.
>     v1 = Graphene.Vec2()
>     v1.init(0.5,0.5)
>     uniforms.set_value("v1", v1)
>
> Should I create GObject.Value() with GObject.TYPE_?? for Graphene.Vec2?
> How to set the  Graphene.Vec2 object to the GObject.Value?
>
>
> This may depend on if your GStreamer GL set up was built with graphene
> enabled at compile time
>
> The code is definitely there for this:
> https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/blob/master/ext/gl/gstglfiltershader.c#L365
> .
>
> Setting GST_DEBUG=3 in the environment will get you the GST_FIXME below if
> the glshader element doesn't understand the GValue's type.
>
> Cheers
> -Matt
>
>
> Thanks.
>
> Regards,
>
> Yu
>
>
>
> _______________________________________________
> gstreamer-devel mailing listgstreamer-devel at lists.freedesktop.orghttps://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20210507/7791a5d3/attachment-0001.htm>


More information about the gstreamer-devel mailing list