Commit graph

336 commits

Author SHA1 Message Date
Filippo Argiolas
270ce448e4 [443/906] sobel: move some highly duplicated code into glfilter
Add a new convenience function in GstGLFilter that just draws an input
texture to a target texture using a simple shader with just a "tex"
uniform sampler.
Move draw_texture from glfiltersobel to glfilter. Still need to update
other plugins to this.
2014-03-15 18:36:40 +01:00
Filippo Argiolas
b3c4eb4c61 [442/906] blur: optimize coordinates calculations
Save 28 instructions on i915 (mainly redundant MOVs) and gain a 25%
(roughly measured with videotestsrc and glimagesink sync=false) speed
bump
2014-03-15 18:36:40 +01:00
Filippo Argiolas
5fd66383ab [441/906] sobel: convolve only luma
Rework Sobel a little bit again making it work as the old one:
1. desaturate input texture
2. calculate horizontal convolution for x gradient and vertical
   convolution for y gradient at the same time (halves the number of
   needed texture lookups)
3. store results in a single texture (red and green channel)
4. calculate remaining convolution (same as above switching vertical and
   horizontal)
5. calculate length of gradient using red and green as x and y
   components.
Optimize wherever possible, store kernels as constants in the shaders,
remove unneeded uniforms. Restore invert property carefully avoiding
using IF.
Still not sure if "full color" convolution will be needed, glfiltersobel
is to be intended as a demo filter and xray, the only effect which uses
sobel only needs edge intensity. Dropping it for now.
2014-03-15 18:36:40 +01:00
Filippo Argiolas
49df4dca3c [440/906] sobel: implement sobel filter using separable kernels
Reimplement sobel in a multipass fully separated convolution:
- calculate x gradient map convolving first horizontally with blurring
  kernel and then vertically with differentiating kernel
- calculate y gradient map convolving first vertically with blurring
  kernel and then horizonally with differentiating kernel
- calculate length of the gradient vector
Particular care was needed with normalization of the blurring kernel and
with grey level offset of the differentiating one to prevent overflow of
rgb values from the [0.0,1.0] range in intermediate passes.
Now works on i915.
2014-03-15 18:36:40 +01:00
Filippo Argiolas
002f069962 [439/906] sobel: get rid of #version 120 dependent array constructors 2014-03-15 18:36:40 +01:00
Pierre Pouzol
f8871ff33a [438/906] glfilterreflectedscreen: improve behavior and add some properties
Fixes bug #612163
2014-03-15 18:36:40 +01:00
Julien Isorce
7660fcbd30 [437/906] glfilterreflectedscreen: remove unused code (copied/pasted from glfilterglass) 2014-03-15 18:36:40 +01:00
Julien Isorce
28a11181c8 [436/906] gleffectssources: fix some warnings from msvc9 2014-03-15 18:36:40 +01:00
Julien Isorce
a1cd1cdc69 [435/906] GNUStep build: add glfilterreflectedscreen sources 2014-03-15 18:36:40 +01:00
Pierre Pouzol
8c9500e9d6 [434/906] glfilterreflectedscreen: forgot to add sources 2014-03-15 18:36:40 +01:00
Pierre Pouzol
59b9cc9ebd [433/906] glfilterreflectedscreen: add new OpenGL Reflected Screen filter
Fixes bug #612163
2014-03-15 18:36:40 +01:00
Filippo Argiolas
0cae67172a [430/906] convolution: save some indirection grouping math and sampling
Thanks to Eric Anholt I've finally understood (at least I hope) how to
count texture indirections and save up some.  Texture sampling dependent
on the result of some math counts as an indirection phase. Grouped
texture lookups with no math involved count as a single indirection.
Math on the coordinates count as indirection.
So the best thing is to group all the math involving coordinates and
then do all the lookups.
This saves enough indirections to make glfilterblur and glow effect
work, albeit a bit slowly, on i915.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
e7d083fcc0 [429/906] laplacian: remove unused norm_const and norm_offset uniforms
Remove unused uniforms from the laplacian filter. Also remove if
kernel[i] != 0 checks so that it compiles where IF is not available.
Again, big thanks to Eric Anholt for the hints.
2014-03-15 18:36:39 +01:00
Eric Anholt
2c905bda24 [428/906] laplacian: Avoid using GLSL 1.20 features in a non-#versioned shader.
Fixes compile on Mesa.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
b59d050e84 [427/906] rgb_to_curve: save up a texture indirection
Apparently assigning gl_TexCoord to a temp count as an indirection.
Using it directly avoids it and limits indirections to four not
exceeding i915 limit. Now xpro effect works on i915.
2014-03-15 18:36:39 +01:00
Vinson Lee
f6b0a1db7b [426/906] multiply: fix a compilation error with Apple compiler
Fix multiply_fragment_source to compile with Apple GLSL compiler.

https://bugzilla.gnome.org/show_bug.cgi?id=616748
2014-03-15 18:36:39 +01:00
Filippo Argiolas
7ee7688ae8 [425/906] twirl: get rid of polar coordinates conversion
Get rid of polar coordinates in the twirl effect. The same can be done
using a rotation matrix, saving alu instructions and, most of all,
avoiding the use of the evil atan() function (which uses IF operators).
Calculate rotation angle in a saner, understandable way.
Works on i915! (Hope it still works elsewhere too as I'm not able to
test at the moment)
2014-03-15 18:36:39 +01:00
Filippo Argiolas
797250d9c2 [424/906] tunnel: get rid of polar coordinates conversion
Get rid of polar coordinates in the tunnel effect as the same can easily
be done just clamping the radius and multiplying.
Remove the evil atan() call that uses branching and a lot of unneeded alu
instructions. Now works on i915!
2014-03-15 18:36:39 +01:00
Filippo Argiolas
98752e51da [423/906] convolution: generate gaussian kernel on the fly
Generate a normalized gaussian kernel with given size and standard
deviation on the fly.
Remove "norm_const" uniform from convolution shaders and provide a
normalized kernel instead. Remove norm_offset uniform as it was always
zero, will reintroduce it if really needed in the future. Thanks to Eric
Anholt for suggesting it.
Save some ALU instruction calculating directly the coordinate for
texture lookup instead of summing an offset.
Still exceed maximum indirect texture lookups on i915, the only solution
I see is using a 3x3 kernel.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
e602d818e3 [422/906] convolution: reduce the number of register used
Reduce the number of register calculating texture lookup offset on the
fly. It was just a simple sequence, no need to store it in a array.
Fixes maximum number of registers exceeded error with i915. Still
exceed maximum indirect texture lookups and maximum ALU instructions.
Maybe we should gave up some blur goodness and use lightly more little
kernels.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
a3454365fc [421/906] convolution: don't check kernel[i] to be non zero
Apparently saving up some texture lookup for zero kernel elements is
definitely not worth the use of branching. This way convolution
fragment programs also work where IF operator is not supported (tested
on i915 and nouveau). See also discussion on bug #615696.
Thanks to Eric Anholt for spotting this.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
f979b52e5c [420/906] blur: use common shader sources
Port blur filter to use the common convolution shaders in
gstgleffectssources.c. This reduces code duplication and, incidentally,
the shaders in the common file were already updated to not use array
constructor and to not depend on #version 120.
First step towards bug #615696 fixing.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
fe42e22e84 [419/906] blur: remove horizontal flip
Apparently there was some stale horizontal flip function still there
from my summer of code experiments. Remove it.
2014-03-15 18:36:39 +01:00
Filippo Argiolas
4ff22b2c67 [418/906] effects: disable gst-indent in the sources
Fix some crazy formatting caused by gst-indent previous runs and disable
the script for this file. The best would be to move shaders into
separate files and load them at runtime or hardcode them at compile
time.
2014-03-15 18:36:39 +01:00
Руслан Ижбулатов
e42b3eddbf [417/906] glbumper: Use png_sig_cmp() instead of png_check_sig()
Fixes bug #613186
2014-03-15 18:36:39 +01:00
Tim-Philipp Müller
f82dd7d5e2 [416/906] gl: use gst_element_class_set_details_simple()
Fixes #613371.
2014-03-15 18:36:39 +01:00
David Hoyt
9a49a81c22 [414/906] glbumper/gldifferencematte/gloverlay: libpng 1.4.x compatible
Fix bug #608643
2014-03-15 18:36:39 +01:00
Julien Isorce
8937128d62 [412/906] Cocoa backend: improve support on GNUStep 2014-03-15 18:36:38 +01:00
Julien Isorce
ba4ca3bced [409/906] gleffects: indent and fix some warnings in ES 2.0 mode 2014-03-15 18:36:38 +01:00
Julien Isorce
e002f92e6d [408/906] gleffects: start to make it compatible with OpenGL ES 2.0
For now only identity, mirror and squeeze effects are available.
Maybe some factorization is needed about compilation shader
before to put the other effects since only a copy/past is needed,
at least until effect number 9: heat.
The effects from 10:sepia to 15:glow require more work.
2014-03-15 18:36:38 +01:00
Julien Isorce
3e1bffc802 [406/906] glimagesink: add a client-data property
Also add it to glfilterapp.

Fixes #559131
2014-03-15 18:36:38 +01:00
Julien Isorce
dec44e571b [404/906] glupload: repair external_opengl_context property
qglwtextureshare now works again. In this example,
the pipeline is src ! glupload ! fakesink.
So in this case the glupload element is a sink in
terms of gl chain.
But the problem is still there if the pipeline is
src ! glupload ! glfilter ! fakesink
(it's the case in sdlshare and cluttershare examples)
because since recent changes about how the gstgldisplay
is transmitted to the gl element, the context is usually
created by the sink in terms of gl chain.
A solution would be to also install this property on glfilter.
2014-03-15 18:36:38 +01:00
Julien Isorce
416a4c6161 [402/906] gloverlay: fix some warnings 2014-03-15 18:36:38 +01:00
Anthony Violo
a7a5c7ee8a [401/906] gloverlay: Added rotate texture
fix #601277
2014-03-15 18:36:38 +01:00
Julien Isorce
0ba1945c57 [398/906] gldownload: do not forgot to create the gl context
fix #600630
2014-03-15 18:36:38 +01:00
Julien Isorce
621aabe378 [397/906] glmosaic: fix a comparison warning 2014-03-15 18:36:38 +01:00
Julien Isorce
12e0bff437 [396/906] gldifferencematte: fix some warnings from vc9 2014-03-15 18:36:38 +01:00
Filippo Argiolas
d02a585e7b [395/906] differencematte: fix regressions from gdkpixbuf to libpng migration
The background image needs to be scaled to fit current texture size.
Previously this was done by gdk_pixbuf_scale_simple but that's been
removed.
Create a texture from the background pixbuf with correct dimensions and
use interpolation shader to scale it to the right size. Interpolation
fragment shader doesn't have too much sense if all the textures don't
have the same size so this seemed the most natural place to do the
scaling. It could probably be done with some custom texture mapping
outside the shader but it involved more code.

Fixes bug #599883.
2014-03-15 18:36:37 +01:00
Julien Isorce
aeb793497d [393/906] glmosaic: for now it's a cube mosaic
Also use GPtrArray instead of GArray in glmixer.
And add a pipeline to tests/pieplines
2014-03-15 18:36:37 +01:00
Julien Isorce
ea2962e44f [392/906] glmosaic: desactivate shader when done 2014-03-15 18:36:37 +01:00
Julien Isorce
144427fe3e [390/906] remove warnings from vs9 2014-03-15 18:36:37 +01:00
Julien Isorce
42720ef3ff [388/906] just fix builds and indent 2014-03-15 18:36:37 +01:00
Julien Isorce
db7d436bd8 [387/906] glmixer: add a glmixer base element
glmixer can be seen as a glfilter except it handles N requested
sink pads.
Each sink pad and the src pad are video/x-raw-gl.
glmixer is responsible for managing different framerates from inputs.
It uses OpenGL context sharing. It means that each input is in its
own OpenGL context shared together and shared with the OpenGL context
of the ouput gl chain.
Also add a glmosaic which is an example of implementation of glmixer.
For now glmosaic is a cube but it will be fixed in the next commits.
For now the glmixer has some weird behaviours in some configurations
but it will be improved in the next commits.
The autotools builds is temporarly broken since those changes
have been made on win32.
2014-03-15 18:36:37 +01:00
Julien Isorce
65f4d40e6d [385/906] rewrite the way a gstgldisplay is transmited to the gl elements
Before, a gstgldisplay was instancied by the gl src in terms of gl chain.
And then the next element got it through the first gstglbuffer.
Now, this is done though queries.
All glelements get their ref on a gstgldisplay in READY state.
This rewrite is mainly a first step to be able to share OpenGL context hold
by the gstgldisplay using more complex glelements.
For example, with a glvideomixer. The associated gstgldisplay of each gl chain
of the sink pads will share their OpenGL context.
2014-03-15 18:36:37 +01:00
Julien Isorce
3700180345 [382/906] ES2.0: remove warnings
Partially fix #593786
2014-03-15 18:36:37 +01:00
Anthony Violo
5fef0569f0 [380/906] gloverlay: can put video over png images
Fix bug #595303
2014-03-15 18:36:37 +01:00
Anthony Violo
5943045bf6 [379/906] gloverlay: add support to use RGB png images
Previously restricted to RGBA, now gloverlay can also handle a RGB image.
2014-03-15 18:36:37 +01:00
Stefan Kost
1cb459d4d5 [376/906] build: support openGLES on linux via autofoo. Partialy fixes #593786
Add a pkg-config check for opengl and if not found assume opengl-es. If user has
none of both one still get build error later on (there is no pkg-config for
opengl-es).
Add more files to EXTRA dist and build the opengles variant if selected.
Simmilar changes could be done for the winCE backend.
2014-03-15 18:36:36 +01:00
Anthony Violo
a86d07acca [375/906] gloverlay: can control image size and position
Fix bug #591591
2014-03-15 18:36:36 +01:00
Christian Schaller
48bea6b3ea [370/906] Add missing header file to Makefile.am and update spec file to actually be for this package 2014-03-15 18:36:36 +01:00
Stefan Kost
26bb5badb8 [367/906] docs: fix GstXvImageSInk -> GstGLImageSink and reindent 2014-03-15 18:36:36 +01:00
Tim-Philipp Müller
6516ecb3cc [366/906] docs: make remaining elements show up in docs
Split out declarations into header files and hook everything up so
that five more elements show up in the plugin docs. Fixes #559135.
2014-03-15 18:36:36 +01:00
Julien Isorce
579b74d845 [364/906] make the cmake build work on MacOSX
We can now generate a Xcode project (or Unix Makfiles),
see INSTALL file
2014-03-15 18:36:36 +01:00
Sebastian Dröge
6ce63cd366 [359/906] gl: Link with -lm and fix indention 2014-03-15 18:36:35 +01:00
Jan Schmidt
09a2e19512 [356/906] build: Fix typo: gstglbumber.h -> gstglbumper.h 2014-03-15 18:36:35 +01:00
Julien Isorce
56d656adf6 [355/906] same motion compensation 2014-03-15 18:36:35 +01:00
Julien Isorce
df4e712ca2 [354/906] fix and add gldeinterlace filter to the builds 2014-03-15 18:36:35 +01:00
julien
3eddae28a9 [353/906] add a gldeinterlace filter
Greedyh operation implemented using OpenGL Shading Language.
We could add other operations later.
Does some good results but still not as expected.
That's why I do not add it yet to the build.
2014-03-15 18:36:35 +01:00
Jan Schmidt
f5ac0a784d [352/906] fix typo
Change GST_GL_DISPLAY_PROJECTION_PERSPECIVE to
GST_GL_DISPLAY_PROJECTION_PERSPECTIVE.

Re-indent a couple of files that needed it.
2014-03-15 18:36:35 +01:00
Julien Isorce
2680375248 [351/906] allow to switch xoverlay while being in paused state 2014-03-15 18:36:35 +01:00
Julien Isorce
6292d5af16 [349/906] can switch xoverlays while playing
Fixes bug #584877

Before this commit calling "gst_x_overlay_set_xwindow_id" more
than one time, had no effect.
It mainly affects the glimagesink implementation.
But on win32 (and CE), some stuff has to be done to
release the old parent.

And add a switchxoverlay example where the user
can click on left/right part of the main window to
switch the xoverlay.
2014-03-15 18:36:35 +01:00
LRN
47beeb1083 [348/906] Add gstvideo to glimagesink LIBADD. Fixes bug #584680 2014-03-15 18:36:35 +01:00
Julien Isorce
911cf141c4 [334/906] [win32/winCE] fix some pointer cast warnings with mingw
And turn off deprecated Wp64 msvc compiler option.
2014-03-15 18:36:34 +01:00
Julien Isorce
bcc33ab716 [333/906] add force-aspect-ratio support 2014-03-15 18:36:34 +01:00
Julien Isorce
f735c06c4a [331/906] indent and fix some compiler warnings 2014-03-15 18:36:34 +01:00
Julien Isorce
87a1652216 [330/906] Can now share textures with an external gl context
The external opengl context must be specify when creating
our OpenGL context (glx) or just after (wgl).
When calling glXCreateContext or wglShareLists, the
external opengl context must not be current.
Then our gl context can be current in the gl thread while
the external gl context is current in an other thread.
See tests/examples/clutter/cluttershare.c
2014-03-15 18:36:34 +01:00
Julien Isorce
ec0bb66fe9 [321/906] add OpenGL ES 2.x support.
In OpenGL 2.x for Embedded System, a lot of basic scene/draw functions
have been removed. It means that everything is made using vertex and
fragment shaders.
I have also added a gstglwindow backend for winCE that uses EGL
(Native Platform Graphics Intercace) (which is a full part of
OpenGL ES specification). It remove the use of wgl/glx functions.
2014-03-15 18:36:33 +01:00
Julien Isorce
9584a5ddfd [318/906] rename GNUmakefile(s) to GNUmakefile(s).gnustep 2014-03-15 18:36:33 +01:00
Julien Isorce
49c903d156 [317/906] implement gstglwindow for Cocoa (MacOS and GNUstep) 2014-03-15 18:36:33 +01:00
Julien Isorce
51ee1f5976 [316/906] remove some unused HAVE_LIBPNG: libpng is a required package 2014-03-15 18:36:33 +01:00
Julien Isorce
b2143adee3 [315/906] add GNUstep build 2014-03-15 18:36:33 +01:00
Stefan Kost
8af0cb09f8 [313/906] indent: don't use tabs inside property descriptions 2014-03-15 18:36:33 +01:00
Stefan Kost
aea83171e2 [312/906] build: include stdlib.h when using free(). 2014-03-15 18:36:33 +01:00
Sebastian Dröge
c6ad604c8c [311/906] Cast GstBuffer subclasses to GstBuffer * before passing to gst_buffer_unref() 2014-03-15 18:36:33 +01:00
David Schleef
d015d5862d [310/906] Global reindent
Indent parameters:
INDENT_PARAMETERS="--braces-on-if-line \
        --case-brace-indentation0 \
        --case-indentation2 \
        --braces-after-struct-decl-line \
        --line-length80 \
        --no-tabs \
        --cuddle-else \
        --dont-line-up-parentheses \
        --honour-newlines \
        --continuation-indentation4 \
        --tab-size8 \
        --indent-level2"
2014-03-15 18:36:33 +01:00
David Schleef
4778241500 [308/906] Rename glpixbufoverlay to gloverlay 2014-03-15 18:36:32 +01:00
David Schleef
72691ce147 [307/906] Remove conditionals on gdkpixbuf 2014-03-15 18:36:32 +01:00
Julien Isorce
4d4e3ad4f9 [306/906] fix CMake build and frozen CodeBlocks build 2014-03-15 18:36:32 +01:00
Julien Isorce
e17c93723f [305/906] CMake build now checks for libpng 2014-03-15 18:36:32 +01:00
Julien Isorce
92e733dce0 [304/906] only load RGBA files.png 2014-03-15 18:36:32 +01:00
David Schleef
b6735ace5d [303/906] Add libpng dependency 2014-03-15 18:36:32 +01:00
David Schleef
ed2be67ba8 [302/906] Fix some warnings 2014-03-15 18:36:32 +01:00
Julien Isorce
994a25ca7e [301/906] depends on libpng instead of gdk_pixbuf 2014-03-15 18:36:32 +01:00
Julien Isorce
1f89d69c74 [300/906] use libpng in glpixbufoverlay filter. 2014-03-15 18:36:32 +01:00
Julien Isorce
3b9456e384 [299/906] use libpng to load the normal map instead of using gdkpixbuf 2014-03-15 18:36:32 +01:00
David Schleef
43e574aa8f [298/906] Revert "Fix indention"
This reverts commit 96e4ab18c2cf9876f6c031b9aba6282d0bd45a93.

You should have asked first.  And you would have been told "no",
because it causes people on development branches to do a huge
amount of extra work.
2014-03-15 18:36:32 +01:00
Sebastian Dröge
369b1d4ff2 [295/906] Fix indention 2014-03-15 18:36:32 +01:00
Julien Isorce
8997a6e82b [293/906] minimal gtk doc 2014-03-15 18:36:32 +01:00
David Schleef
f64da834ab [292/906] Add 'extern' for data symbols in headers 2014-03-15 18:36:31 +01:00
David Schleef
e4b26b46fd [289/906] build fixes for Windows libraries 2014-03-15 18:36:31 +01:00
Julien Isorce
4b53383385 [285/906] fix gl framerate in gst caps. Consider position in xoverlay. Fix inversion bettween COLS and ROWS, and move windows. 2014-03-15 18:36:31 +01:00
Julien Isorce
c8c7f8733b [280/906] Remove set_visible, because it's now automatically done when the first post redisplay comes. 2014-03-15 18:36:31 +01:00
Julien Isorce
94f74d4b50 [273/906] add some debug outputs about Visual and XVisualInfo 2014-03-15 18:36:30 +01:00
Julien Isorce
747e2cf0de [264/906] Rewrite gstglwindow_x11.c because X API is not thread safe. 2014-03-15 18:36:30 +01:00
Julien Isorce
d404163d79 [262/906] Works on linux but still some bugs. Fix autotools build. 2014-03-15 18:36:30 +01:00
Julien Isorce
cfd7f1be38 [257/906] begin gstglwindow_x11.c implementation 2014-03-15 18:36:29 +01:00
Julien Isorce
f4bfade861 [253/906] win32: re-implement supports for gst xoverlay interface, on this branch 2014-03-15 18:36:29 +01:00
Julien Isorce
2c9bb405a0 [251/906] Properly clean OpenGL contexts 2014-03-15 18:36:29 +01:00
Julien Isorce
25af2c116e [248/906] fix msvc warnings and update CMake build, win32 CodeBlocks build and vs8 build 2014-03-15 18:36:29 +01:00
Filippo Argiolas
0ac54fdc55 [247/906] Import xray effect
Add xray effect. Maps luma to a negative, slightly cyan tinted, curve,
applies some light gaussian blur and multiplies it with its sobel edges. Not
sure about the name, likely to change. Probably still needs some tuning.
2014-03-15 18:36:29 +01:00