AW: Dynamic change of glshader element
Christian Winkler
christian at heidelbergs.de
Tue Nov 18 13:18:15 PST 2014
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
More information about the gstreamer-devel
mailing list