<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    Hi,<br>
    <br>
    <div class="moz-cite-prefix">On 6/5/21 9:40 pm, Yu You via
      gstreamer-devel wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CAB+yMgsRqMewbDXdS8CqztSMU5W1qZkrLjZwQKBWA1-OHTgVWQ@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hi,
        <div><br>
        </div>
        <div>There's a way to modify uniform variables for the glshader
          element.</div>
        <div>The following is an example of changing simple value types
          like float.</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>    uniforms = Gst.Structure.new_empty("uniforms")<br>
              u1 = GObject.Value(GObject.TYPE_FLOAT)<br>
        </div>
            u1.set_float(hdegree)<br>
            uniforms.set_value("u1", u1)
        <div>    shader.set_property("uniforms", uniforms)<br>
              uniforms.free()<br>
        </div>
        <div><br>
        </div>
        <div>But it is common in GLSL shader we use data types like
          Vec2/Vec3.</div>
        <div>The following code did not work.</div>
        <div>    v1 = Graphene.Vec2()<br>
              v1.init(0.5,0.5)<br>
              uniforms.set_value("v1", v1)<br>
        </div>
        <div><br>
        </div>
        <div>Should I create GObject.Value() with GObject.TYPE_??
          for Graphene.Vec2?</div>
        <div>How to set the  Graphene.Vec2 object to the GObject.Value?</div>
      </div>
    </blockquote>
    <br>
    This may depend on if your GStreamer GL set up was built with
    graphene enabled at compile time<br>
    <br>
    The code is definitely there for this: <a moz-do-not-send="true"
href="https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/blob/master/ext/gl/gstglfiltershader.c#L365">https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/blob/master/ext/gl/gstglfiltershader.c#L365</a>.<br>
    <br>
    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.<br>
    <br>
    Cheers<br>
    -Matt<br>
    <br>
    <blockquote type="cite"
cite="mid:CAB+yMgsRqMewbDXdS8CqztSMU5W1qZkrLjZwQKBWA1-OHTgVWQ@mail.gmail.com">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks.</div>
        <div><br>
        </div>
        <div>Regards,</div>
        <div><br>
        </div>
        <div>Yu</div>
        <div><br>
        </div>
        <div>  </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>