After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 740239 - glshader receives no input from the pipeline
glshader receives no input from the pipeline
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.4.3
Other Mac OS
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-11-17 08:37 UTC by Anton
Modified: 2014-11-17 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Anton 2014-11-17 08:37:19 UTC
When using glshader, you can output image but there is no input. Does it still expect the (deprecated) glupload?

This gives black image, though it should be a zero effect and just output the input.

gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720 ! glshader location=minimal.frag ! glimagesink

Where minimal.frag is:
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect tex;
void main() {
  gl_FragColor = texture2DRect(tex, gl_TexCoord[0].xy);
}


This (correctly) gives blue image:
gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720 ! glshader location=blue.frag ! glimagesink

Where blue.frag is:
#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect tex;
void main() {
  gl_FragColor = vec4(0,0,255,1.0);
}


This just works like it should:
gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720 ! gleffects effect=4 ! glimagesink sync=false
Comment 1 Matthew Waters (ystreet00) 2014-11-17 09:23:48 UTC
(In reply to comment #0)
> When using glshader, you can output image but there is no input. Does it still
> expect the (deprecated) glupload?
> 
> This gives black image, though it should be a zero effect and just output the
> input.
> 
> gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720 ! glshader
> location=minimal.frag ! glimagesink
> 
> Where minimal.frag is:
> #extension GL_ARB_texture_rectangle : enable
> uniform sampler2DRect tex;
> void main() {
>   gl_FragColor = texture2DRect(tex, gl_TexCoord[0].xy);
> }
> 
> 
> This (correctly) gives blue image:
> gst-launch-1.0 videotestsrc ! video/x-raw, width=1280, height=720 ! glshader
> location=blue.frag ! glimagesink
> 
> Where blue.frag is:
> #extension GL_ARB_texture_rectangle : enable
> uniform sampler2DRect tex;
> void main() {
>   gl_FragColor = vec4(0,0,255,1.0);
> }

None of the gl elements use rectangle textures anymore and the use of gl_TexCoord[i] references the fixed function pipeline which is also not supported.  The use of integers in the vec4 definition are also not spec compliant (which suggests you have an nvidia card) and are clamped to the [0.0f, 1.0f] range anyway.

Try going with:

#ifdef GL_ES
precision mediump float;
#endif
varying vec2 v_texcoord;
uniform sampler2D tex;
uniform float time;
uniform float width;
uniform float height;

void main () {
  gl_FragColor = texture2D(tex, v_texcoord);
}
Comment 2 Anton 2014-11-17 18:46:30 UTC
Ok! This works! Thanks!

Will blog about it soon. It's a matter of documentation now. I googled like crazy, but could not find this.