Commit graph

169 commits

Author SHA1 Message Date
Matthew Waters d00a13f01d glutils: remove trivial helper function
gst_gl_caps_replace_all_caps_features() is only used in two places and can
be trivially reproduced.
2017-12-09 19:32:26 +00:00
Matthew Waters 181dacc77e glfilter: remove display_init/reset
They are mirrors of GstGLBaseFilter's gl_start() and gl_stop() virtual methods
so use them instead.
2017-12-09 19:32:23 +00:00
Matthew Waters 62d0bac993 gl/gi: some annotation updates for called functions
With scope, closure, destroy annotations
2017-12-09 19:32:23 +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 b3d8e09839 glfilter: rewrite subclasses for filter_texture() occuring on GL thread
There's no need for the jump to an extra thread in most cases, especially
when relying solely on a shader to render.  We can use the provided
render_to_target() functions to simplify filter writing.
2017-12-09 19:32:21 +00:00
Matthew Waters 4bbda2b626 glframebuffer: rewrite for a more consistent API
Facilities are given to create fbo's and attach GL memory (renderbuffers
or textures).  It also keeps track of the renderable size for use with
effective use with glViewport().
2017-12-09 19:32:21 +00:00
Matthew Waters 7f10822de4 gl: use GLMemory for accessing textures everywhere
This simplifies and consolidates a lot of duplicated code creating
and modifying textures.
2017-12-09 19:32:21 +00:00
Matthew Waters c7dd43f21a glfilter: rename draw_texture to draw_fullscreen_quad
And remove unused arguments.
2017-12-09 19:32:21 +00:00
Matthew Waters 5efc2e8705 gl/egl: replace gsteglimagememory with an EGLImage wrapper
That can be passed to GstGLMemoryEGL.

This also ports the dmabuf uploader to GstEGLImage and GstGLMemoryEGL.
2017-12-09 19:32:19 +00:00
Vineeth TM e92bbb2a83 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2017-12-09 19:32:18 +00:00
Matthew Waters d5cc277601 glfilter: only allow the same src/sink caps when we are in passthrough mode
If we are given caps with extra features (like the overlay composition
features), we can only deal with that when we are in passthrough mode.

Previously we were bailing entirely and not allowing passthrough filter elements
with things like textoverlay.

Fixes the following pipeline (assuming glfilter supports passthrough):
gl ! textoverlay ! glfilter ! ... ! glimagesinkelement

https://bugzilla.gnome.org/show_bug.cgi?id=763756
2017-12-09 19:32:17 +00:00
Matthew Waters 4406730633 glfilter: retrieve the shader attributes from the GL thread
Otherwise we will receive bogus values

https://bugzilla.gnome.org/show_bug.cgi?id=763365
2017-12-09 19:32:17 +00:00
Mark Nauwelaerts 99f9d4ccc7 glfilter: handle some more unfixed fields when fixating caps 2017-12-09 19:32:17 +00:00
Matthew Waters 86edea9725 glfilter: insert the debug marker from the GL thread
https://bugzilla.gnome.org/show_bug.cgi?id=761538
2017-12-09 19:32:16 +00:00
Sebastian Dröge 72afdda3b3 glfilter: First make caps writable in fixate_caps(), then truncate them
Truncating requires writable caps.
2017-12-09 19:32:15 +00:00
Matthew Waters b56d9bd57b glfilter: recreate the fbo on caps changes
The width/height may change which requires recreating the depth buffer.
2017-12-09 19:32:15 +00:00
Matthew Waters 681cb5b16d glmemory: add support for rectangle textures
Add the various tokens/strings for the differnet texture types (2D, rect, oes)

Changes the GLmemory api to include the GstGLTextureTarget in all relevant
functions.

Update the relevant caps/templates for 2D only textures.
2017-12-09 19:32:10 +00:00
Matthew Waters bf98930546 gl: sprinkle some debug markers to ease debugging 2017-12-09 19:32:08 +00:00
Julien Isorce 231e91c883 glfilter: use GL_ELEMENT_ARRAY_BUFFER for vbo indices
Fixes this error with chromium gpu process:
GL_INVALID_OPERATION, glBindBuffer: buffer bound to more than 1 target

https://bugzilla.gnome.org/show_bug.cgi?id=755618
2017-12-09 19:32:08 +00:00
Vineeth T M 6944433677 gl: Fix GError leaks during failures
https://bugzilla.gnome.org/show_bug.cgi?id=755140
2017-12-09 19:32:08 +00:00
Matthew Waters 3ba30d42a4 gl: use gles2 shaders everywhere
This effectively limits a glfilter subclass to be > GL(ES) 2.0.
rather than a possible GL 1.4.
2017-12-09 19:32:07 +00:00
Nicolas Dufresne 79d5bbdc35 glfilter: Don't cache buffer pool
Caching and sharing to multiple element the same pool prevents
renegotiation from passthrough to not passthrough.
2017-12-09 19:32:05 +00:00
Jan Schmidt 5007311198 glfilter: Add transform_internal_caps() vfunc
Add a vfunc that is called by glfilter before it sets
caps features and intersects with the peer caps, and
move removing the size from caps into its default
implementation. Allows sub-classes to do more
sophisticated management of the size fields in case they
don't support arbitrary resizing or have distinct
preferences.
2017-12-09 19:32:03 +00:00
Jan Schmidt 697107fe7d glfilter: Don't remove size fields from caps
Instead of removing size fields, set them to the full range
like videoscale does, so the caps are clearly unfixed in
all cases.
2017-12-09 19:32:03 +00:00
Xavier Claessens 840157230d gl: propagate return value from filter and filter_texture
https://bugzilla.gnome.org/show_bug.cgi?id=749846
2017-12-09 19:32:02 +00:00
Matthew Waters 72993f54fa gl: remove useless gl{En,Dis}able (GL_TEXTURE_*) calls
We are using shaders everywhere and so they are not needed
2017-12-09 19:32:01 +00:00
Matthew Waters 65c57b77ff gl: element buffers are part of vao state
Use them as such.  They are also required for GL3 core profile support
with glDrawElements on OS X.
2017-12-09 19:32:01 +00:00
Sebastian Dröge 51d3a0a059 Revert "gl: readd glupload/download onto element pads"
This reverts commit 87d8270f30.
2017-12-09 19:32:00 +00:00
Matthew Waters 343947f383 gl: readd glupload/download onto element pads
Allows insertion of gl elements into non-gl pipelines without converter
(upload/download) elements.

https://bugzilla.gnome.org/show_bug.cgi?id=743974
2017-12-09 19:32:00 +00:00
Sebastian Dröge ee6bfe0127 glfilter: De-camelcase onInitFBO() vfunc 2017-12-09 19:31:59 +00:00
Sebastian Dröge 3613ecfd0a glfilter: Remove onStart/onStop vfuncs, and unused onReset()
onStart/onStop are just duplicates of the basetransform ones, onReset
was never called but was used everywhere when stop should've been used.
2017-12-09 19:31:59 +00:00
Matthew Waters 93968916a4 glsyncmeta: make context to wait and set sync explicit
otherwise we may wait on a sync object in same context by accident
2017-12-09 19:31:58 +00:00
Matthew Waters 92f0aa9bd8 gl: get the context from basemixer/basefilter 2017-12-09 19:31:57 +00:00
Matthew Waters 51620950e4 gl: retreive the gldisplay/app gl context as soon as possible
fixes the usage of gst_gl_display_filter_gl_api
2017-12-09 19:31:57 +00:00
Matthew Waters 3e608bcce7 glfilter: don't use the library upload/convert objects 2017-12-09 19:31:57 +00:00
Matthew Waters 2ead0d97ed gl: add a new glbasefilter class below glfilter
It deals with propagating the gl display/contexts throughout the
application/pipeline
2017-12-09 19:31:56 +00:00
Matthew Waters f9ac4984eb glfilter: advertise resize in the caps negotiation properly 2017-12-09 19:31:56 +00:00
Jan Schmidt ebbdf29a24 glfilter: Remove redundant check for clearing context on reset.
The context is already cleared a few lines above.
2017-12-09 19:31:56 +00:00
Jan Schmidt 6350c35352 Remove a bunch of silly ';;' typos at the end of lines 2017-12-09 19:31:56 +00:00
Nicolas Dufresne da41207841 glfilter: Don't chain downstream pool
Chaining a downstream pool would lead to two owner of the same
pool. In dynamic pipeline, if one owner is removed from the pipeline
the pool will be stopped, and the rest of the pipeline will fail
since the pool will now be flushing. Also fix proposed pool caching,
filter->pool was never set, never unrefed.

https://bugzilla.gnome.org/show_bug.cgi?id=745705
2017-12-09 19:31:56 +00:00
Sebastian Dröge cb59ace574 gl: Remove format info in glcolorconvert's transform_caps function instead of on every caller
... and let glmixer actually transform the caps it is supposed to transform
instead of inventing new caps.
2017-12-09 19:31:56 +00:00
Nicolas Dufresne c9ee5a4b87 glfilter: Get rid of uploader if caps have changed
We need to update the uploader format if that caps have changed.

https://bugzilla.gnome.org/show_bug.cgi?id=745549
2017-12-09 19:31:56 +00:00
Matthew Waters ff4951fe85 glfilter: ensure that the input upload/colorconvert are always available 2017-12-09 19:31:54 +00:00
Luis de Bethencourt f524507659 gl: fix memory leak
In gst_gl_filter_fixate_caps () it can goto done without freeing the memory of
the tmp GstStructure. This makes it go out of scope and leak.

CID #1265765
2017-12-09 19:31:54 +00:00
Matthew Waters 17dba52ff3 gl: remove the egl caps from the src pads
we don't actually support producing EGLImage buffers anywhere.
2017-12-09 19:31:54 +00:00
Matthew Waters 530ae2cbb0 glupload/download/convert: provide transform_caps functions
Allows finer grain decisions about formats and features at each
stage of the pipeline.
Also provide propose_allocation for glupload besed on the supported
methods.
2017-12-09 19:31:54 +00:00
Alessandro Decina 966cad27d7 gl: initial support for texture targets other than GL_TEXTURE_2D
Make GstGLMemory hold the texture target (tex_target) the texture it represents
(tex_id) is bound to. Modify gst_gl_memory_wrapped_texture and
gst_gl_download_perform_with_data to take the texture target as an argument.

This change is needed to support wrapping textures created outside libgstgl,
which might be bound to a target other than GL_TEXTURE_2D. For example on OSX
textures coming from VideoToolbox have target GL_TEXTURE_RECTANGLE.

With this change we still keep (and sometimes imply) GL_TEXTURE_2D as the
target of textures created with libgstgl.

API: modify GstGLMemory
API: modify gst_gl_memory_wrapped_texture
API: gst_gl_download_perform_with_data
2017-12-09 19:31:53 +00:00
Matthew Waters 1dfeae2c42 gl: split glcolorconvert usage from glupload
the separation allows the transfer operation to occur in a separate
thread/time which may increase performance in specific circumstances.
2017-12-09 19:31:52 +00:00
Luis de Bethencourt 9d9d07168f glfilter: remove logically dead code
Soon after setting two variables to 1, the code checks if their values are
different from each other. This would never be true. Removing this.

CID 1226443
2017-12-09 19:31:52 +00:00
Wang Xin-yu (王昕宇) fc09b8b93c glfilter: fix position/texcoord attrib index usage
https://bugzilla.gnome.org/show_bug.cgi?id=741231
2017-12-09 19:31:52 +00:00