AW: Dynamic change of glshader element

Luc Deschenaux luc.deschenaux.mta at sunrise.ch
Tue Nov 18 21:19:20 PST 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Required syntax is eg "float f=float(0.0);"

Maybe there's a problem with the text file encoding or line ending ?..

Sorry I cannot help a lot right now i'm quite busy, I have no time to
build the latest gstreamer and try to figure out what's happening with a
debugger

There's a script and instructions about how to build gstreamer on this
page (need to add gst-plugins-gl to the list):
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/chapter-developing.html#developing-uninstalled-gstreamer

You should look for "preset" in
gstglfiltershader.c

or check whether "gst_gl_shader_set_uniform_1f" is reached in
gstglshadervariables.c and is feed with the right value.

Regards,

Luc

On 19. 11. 14 04:18, Christian Winkler wrote:
> Dear Luc,
>
> thanks.
> I definitley have trouble setting the presets.
> Either by command line or code, they are not accepted.
>
> For instance:
> gst-launch-1.0.exe -e -v videotestsrc ! "video/x-raw, width=1280,
height=720" ! videoconvert ! glshader location=dist.frag
preset=dist.preset ! glimagesink
>
>
> dist frag:
> precision mediump float;
> varying vec2 v_texcoord;
> uniform sampler2D tex;
>
> const vec4 kappa = vec4(2.75,1.7,0.5,0.5);
> const float screen_width = 1920.0;
> const float screen_height = 1080.0;
> const vec2 leftCenter = vec2(0.25, 0.4);
> const vec2 rightCenter = vec2(0.75, 0.4);
> const float separation = -0.025;
> const bool stereo_input = false;
> uniform float scaleFactor;
> .........
>
> dist.preset:
> float scaleFactor = float(0.2);
>
> or, also tried:
> float scaleFactor = 0.2;
>
>
> The value 0.2 is simply ignored.
> I dont know why that happens
>
> scaleFactor iss et to 0.
>
> -----Ursprüngliche Nachricht-----
> Von: gstreamer-devel
[mailto:gstreamer-devel-bounces at lists.freedesktop.org] Im Auftrag von
luc.deschenaux
> Gesendet: Montag, 17. November 2014 04:45
> An: gstreamer-devel at lists.freedesktop.org
> Betreff: Re: Dynamic change of glshader element
>
> You could also initialize the uniform variables using text values
(using GLSL
> syntax) with something like
>         g_object_set (G_OBJECT (glshader), "preset", str, NULL)
>
> or change their value using text values with
>         g_object_set (G_OBJECT (glshader), "vars", str, NULL)
>
> See
> https://bug600195.bugzilla-attachments.gnome.org/attachment.cgi?id=146619
>
> But since this rely on the gst_gl_shader_set_uniform methods (with the
overhead implied for parsing the text string), calling the
gst_gl_shader_set_uniforms methods directly is more efficient for
modifying values dynamically.
>
>
>
> --
> View this message in context:
http://gstreamer-devel.966125.n4.nabble.com/Dynamic-change-of-glshader-element-tp4669514p4669526.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


- -- 
Luc Deschenaux

t: 0788 266 366
v: 0225 085 085 @ netvoip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJUbChXAAoJEK8C+AaU4Dv9xtwQAIJP4hiDEfvuOoicYlovi0RR
tpldzEIEcRRyr0O+GM4kbyZ1PIGxjnvREuf0qxhUXSjc7gdQFJvj+ZudunbzTvKu
+GR7n9+BQDRxgsf0poQJitFMsmpnNc0HCH36JVcfp3tr7HEwsQ+H9Ds94rs94Pg+
BD0U7WpBXDZVhmKdox5EfhdGNyhmUfzUN95CcJsNPxQlpa+vf2SanQEJOHlM3Mlz
dC68FCDG2bABl554bJKh765ULmFpbiTCHaVvZi6zUeQktW9eHBRBVP22wgOHaaYc
otZAAnFmjOI97rBp4WibUIQbYBBnKiJlVNdbM0+gycBxoByeWjCpyU1ExvfRHlBs
AoW70lcUe6laETOlUQckbClXngq+a0sx1+j9sDgYcOWQayFTWfIScU/Hbie4BMxf
qJe863IOc8IrY5yq8czouv/Kkzm2zCSsAhmiysYgcPST5ktn6vpVY896XoI7G+FV
G/M67zQBxuMDfkCd4U/TeuiM7dtoJyNCyOl6i1VWkdpvJ6mTH3n5W3Aj58yoJk9+
1/Rqa//CM7MPD662mba60YLYIZsJAoir0MXkxYJk2m/VBH/45kb7kNhY1d2NqHvE
FMZRVRufj0QVxSDD4fBKZcJMRbvOj7vhVYIPZktSLvtyOuGBCqWKnxxNpSxIyYWj
UNpO4CTe+vu2D+bs0j3V
=B4IK
-----END PGP SIGNATURE-----




More information about the gstreamer-devel mailing list