Commit graph

22 commits

Author SHA1 Message Date
Thibault Saunier 2fd28195ca Move files from gst-plugins-base into the "subprojects/gst-plugins-base/" subdir 2021-09-24 16:13:26 -03:00
Michael Tretter c9d15fec7e glslstage: delete shader on finalize of stage
GLSLstage creates the glShader using glCreateShader, but never calls
glDeleteShader if the glShader is not used anymore. This forces the GL
library to keep the compiled shader around, because it might be used in
the future. Therefore, the glShader is leaked whenever a GLSLStage is
destroyed.

Fix the leak by deleting the glShader when finishing the GLSLStage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/886>
2020-10-21 15:28:09 +02:00
Marijn Suijten 57a23786f3 gl: glslstage: Sync new_default_{fragment,vertex} documentation name
Documentation for the parameter and return value don't show up when
this header mismatches the function it tries to describe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/814>
2020-10-12 07:20:15 +00:00
Thibault Saunier 909baa2360 Pass the code through codespell 2019-08-30 13:05:36 +00:00
Matthew Waters 675415bf2e gl: try to use highp precision where supported
The use of mediump as a specifier in GLSL shaders will have limited
resolution and when used as texture coordinates may become inaccurate
over texture sizes of 1024.
2019-02-28 17:26:32 +11:00
Tim-Philipp Müller d736bfc855 gl: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:58:44 +02:00
Mark Nauwelaerts 710990d5cf gl: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Julien Isorce 4952fdd956 gl: do not include GL headers in public gstgl headers
Except for gst/gl/gstglfuncs.h

It is up to the client app to include these headers.
It is coherent with the fact that gstreamer-gl.pc does not
require any egl.pc/gles.pc. I.e. it is the responsability
of the app to search these headers within its build setup.

For example gstreamer-vaapi includes explicitly EGL/egl.h
and search for it in its configure.ac.

For example with this patch, if an app includes the headers
  gst/gl/egl/gstglcontext_egl.h
  gst/gl/egl/gstgldisplay_egl.h
  gst/gl/egl/gstglmemoryegl.h
it will *no longer* automatically include EGL/egl.h and GLES2/gl2.h.
Which is good because the app might want to use the gstgl api only
without the need to bother about gl headers.

Also added a test: cd tests/check && make libs/gstglheaders.check

https://bugzilla.gnome.org/show_bug.cgi?id=784779
2017-12-09 19:32:29 +00:00
Sebastian Dröge a9a05c01a9 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-12-09 19:32:28 +00:00
Juan Pablo Ugarte c469827ddb glslstage: define GL constants if needed instead of using #ifdef
https://bugzilla.gnome.org/show_bug.cgi?id=777144
2017-12-09 19:32:26 +00:00
Matthew Waters 9bafa08a5d gl/docs: massive update
- add Since: markers where necessary.
- document structs
- add documentation headers for each module (short_description,
  see_also, etc)
- reduce the number of warnings gtk-doc outputs
- fix spelling mistakes
2017-12-09 19:32:23 +00:00
Matthew Waters fdca1dec0d glshader: some compatibility changes for GL 1.4
GL 1.4 (with GL_ARB_shader_objects) doesn't have glIsProgram or glIsShader
equivalents.  As they are simply assertions, skip them when there isn't a
valid function pointer.
2017-12-09 19:32:17 +00:00
Matthew Waters 31b1094744 gl: misc docs fixes/additions 2017-12-09 19:32:17 +00:00
Reynaldo H. Verdejo Pinochet 68e668168d Remove unnecessary NULL checks before g_free()
g_free() is NULL-safe
2017-12-09 19:32:11 +00:00
Vineeth TM 7a75684566 glslstage: Fix vertex_sources memory leak
vertex_sources is being allocated but not freed resulting in leak

https://bugzilla.gnome.org/show_bug.cgi?id=757974
2017-12-09 19:32:11 +00:00
Matthew Waters 1f35fcf06d glslstage: properly return an error when we could not create the shader stage
While it was erroring out correctly later, there were GLib warnings about
setting a GError over the top of another GError.
2017-12-09 19:32:10 +00:00
Matthew Waters ec0a93dd7e glslstage: add debug as to why _set_strings() failed 2017-12-09 19:32:10 +00:00
Matthew Waters b1ac029b87 glslstage: expose the default shader strings as public
Add some other simple strings for external-oes textures or transforming
the texture coordinates with a transformation matrix
2017-12-09 19:32:10 +00:00
Julien Isorce 6bb560a4eb glslstage: initialize output params to 0 before calling gl functions
The client side API of the Chromium's GPU Process has asserts
in debug mode that check that output params are initialized to 0.
2017-12-09 19:32:10 +00:00
Matthew Waters 06de6998e5 gl: be consistent in gobject boilerpate
GST_GL_IS_* vs GST_IS_GL_*

git grep -l 'GST_GL_IS_' | xargs sed -i 's/GST_GL_IS_/GST_IS_GL_/g'
2017-12-09 19:32:09 +00:00
Matthew Waters 463e23bb47 glslstage: add brackets around pointer dereference referencing an array
While technically, i is always 0 and *vertex_sources[i++] is equivalant
to (*vertex_sources)[i++].  Be future-proof in the case of code
moves/changes/etc.

CID 1327406
2017-12-09 19:32:09 +00:00
Matthew Waters 8c922ca96b glsl: add a shader stage object GstGLSLStage
Represents a stage (vertex, geometry, fragment, etc) in the shader
pipeline.
2017-12-09 19:32:09 +00:00