Commit graph

2054 commits

Author SHA1 Message Date
Haihua Hu 8a92c66440 gleffects: fix little rectangle that appears at the center of squeeze and tunnel effects
These two shader will calculate the vector length and use it as denominator.
But length could be zero which will cause undefine behaviour. Add protection for
this condition

https://bugzilla.gnome.org/show_bug.cgi?id=767635
2017-12-09 19:32:20 +00:00
Matthew Waters e9ba0b88e7 glsl: add some debugging 2017-12-09 19:32:20 +00:00
Matthew Waters 072b47d5b8 glutils: remove unused functions for texture creation/deletion
Everyone uses GstGLMemory now and any future code should as well.
2017-12-09 19:32:20 +00:00
Matthew Waters 632cc16767 glfilter: remove unused class fields in/out_tex_id
The functionality is not used by any subclass nor are the values set anywhere.
2017-12-09 19:32:20 +00:00
Matthew Waters 2a545d3bd1 gldeinterlace: remove dead code accessing filter->in_tex_id
It's not set by anyone or anything and gldeinterlace is the only user of it now.
2017-12-09 19:32:20 +00:00
Matthew Waters 1da12235c3 gl/upload/meta: remove unneeded texture deletion
The textures are managed by the GstGLMemory inside the output buffer.  Freeing
them prematurely may result in a use-after-free.
2017-12-09 19:32:20 +00:00
Guillaume Desmottes b23a008ab6 gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2017-12-09 19:32:20 +00:00
Havard Graff c8eef7bf44 gl: glquery: cast to silence compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2017-12-09 19:32:20 +00:00
Havard Graff 61120b8c86 gltestsrc: gltestsrc.h already defines GstGLTestSrc
And redefinition is not allowed.

https://bugzilla.gnome.org/show_bug.cgi?id=766973
2017-12-09 19:32:20 +00:00
Matthew Waters 57acec4b1c gldisplay: always unref the context on a collision
Otherwise we will leak GstGLContext's when adding the same context more than
once.

Fixes a regression caused by 5f9d10f603 in the
gstglcontext unit test that failed with:

Assertion 'tmp == NULL' failed
2017-12-09 19:32:20 +00:00
Nicolas Dufresne e369cee5de caopengllayersink: Don't cache buffer pool
Pools cannot be used by the two elements at the same time.

https://bugzilla.gnome.org/show_bug.cgi?id=766611
2017-12-09 19:32:20 +00:00
Xavier Claessens 1f58a480c9 gl: win32: Add debug category in gstglcontext_wgl.c
https://bugzilla.gnome.org/show_bug.cgi?id=766867
2017-12-09 19:32:20 +00:00
Haihua Hu 3cf27dd1c8 glimagesink: support video rotation using transform matrix
Add "rotate-method" to glimagesink and apply transform matrix
to vertex coordinate to control rotation.

https://bugzilla.gnome.org/show_bug.cgi?id=765795
2017-12-09 19:32:20 +00:00
Matthew Waters 3548dc5af9 glvideomixer: fix race retrieving the GL context from the display
_get_gl_context() can be called concurrently from either propose_allocation() or
decide_allocation().  If it so happens that this happens at the same time,
the check for whether we already had a GL context was outside the lock.  Inside
the lock and loop, the first thing that happens is that we unref the current GL
context (if valid) as if there was a conflict adding it to the display.  If the
timing was unlucky, subsequent use of the GL context would be referencing an
already unreffed GL context object resulting in a critical:

g_object_ref: assertion 'object->ref_count > 0' failed

https://bugzilla.gnome.org/show_bug.cgi?id=766703
2017-12-09 19:32:20 +00:00
Matthew Waters 537d1996e9 gldisplay: add some debugging about retrieving GL contexts 2017-12-09 19:32:20 +00:00
Sebastian Dröge 0ea3706901 eglimage: Re-add accidentially removed GST_DEFINE_MINI_OBJECT_TYPE() 2017-12-09 19:32:20 +00:00
Sebastian Dröge b054da4c96 eglimage: Ensure that the debug category is always initalized
Before the initializer was only run if dmabuf support was used.

https://bugzilla.gnome.org/show_bug.cgi?id=766794
2017-12-09 19:32:20 +00:00
Arjen Veenhuizen d7512e85b4 gltransformation: make the pivot-z property READWRITE
Instead of just being READABLE.

https://bugzilla.gnome.org/show_bug.cgi?id=766818
2017-12-09 19:32:20 +00:00
Guillaume Desmottes 7a00688122 gltestsrc: fix src_impl leak
https://bugzilla.gnome.org/show_bug.cgi?id=766661
2017-12-09 19:32:20 +00:00
Tim-Philipp Müller 7bf17ac500 g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2017-12-09 19:32:20 +00:00
Guillaume Desmottes a12ce7a150 gltestsrc: fix shaders ref counting
The gltestsrc element uses two shaders: color_shader and snow_shader.
Those are alternatively assigned to the SrcShader->shader pointer and
their reference was transferred to it. Only the SrcShader->shader was
unreffed (in _src_shader_deinit()) so only one shader was properly
freed, the other one was leaked.

Fixed this by giving an extra ref to SrcShader->shader and unreffing the
2 shaders in _src_smpte_free().

https://bugzilla.gnome.org/show_bug.cgi?id=766661
2017-12-09 19:32:20 +00:00
Guillaume Desmottes 8cf9e94c63 glmosaic: fix shader leak
gst_gl_mosaic_init_shader() is called twice with test_glmosaic so the
first shader was leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=766661
2017-12-09 19:32:19 +00:00
Xavier Claessens 719298af98 gl: win32: Unparent internal window before destroying it
For some reason DestroyWindow() deadlock if it's called from
parent window's KeyPress event.

https://bugzilla.gnome.org/show_bug.cgi?id=766533
2017-12-09 19:32:19 +00:00
Xavier Claessens e2731f35bf gl: win32: Don't steal parent focus when creating internal window
This fix regression introduced by 0acc18c60f.

https://bugzilla.gnome.org/show_bug.cgi?id=766520
2017-12-09 19:32:19 +00:00
Matthew Waters 7e7aef92c2 gldisplay: demote no platform display debug to info
Avoids confusing everyone with a warning that's not always fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=746933
2017-12-09 19:32:19 +00:00
Matthew Waters 8ebea54758 gltransformation: use the affine transformation meta if available downstream
We can avoid a render pass if downstream supports the affine transformation meta
and increase the performance of some pipelines involving gltransformation.

Implemented by checking for the affine transformation in the allocation query
from downstream and combining our matrix with that of upstream's (or creating
our own).
2017-12-09 19:32:19 +00:00
Matthew Waters 2d62b2910c gl: take the affine transformation in NDC
Provide a function to get the affine matrix in the meta in terms of NDC
coordinates and use as a standard opengl matrix.

Also advertise support for the affine transformation meta in the allocation
query.
2017-12-09 19:32:19 +00:00
Matthew Waters d23808a877 glbasemixer: actually attempt to propose an allocation upstream
We were always failing the allocation query as a flag was never being set to
signal a successful negotiation.  Fix by setting the required flag on a
successful caps event from upstream.
2017-12-09 19:32:19 +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
Gwang Yoon Hwang ecfe5b0801 gl: implement GstGLMemoryEGL
Because current GstEGLImageMemory does not inherit GstGLMemory, GLUpload
allocates additional GLMemory and upload the decoded contents from the decoder
which uses EGLImage (e.g. gst-omx in RPi).

This work adds GstGLMemoryEGL to avoid this overhead. Decoders allocate
GstGLMemoryEGL and decode its contents to the EGLImage of GstGLMemoryEGL.  And
GLUpload uses this memory without allocation of additional textures and blit
operations.

[Matthew Waters]: gst-indent the sources and fix a critical retreiving the egl
display from the memory.

https://bugzilla.gnome.org/show_bug.cgi?id=760916
2017-12-09 19:32:19 +00:00
Matthew Waters 2753b4243e glmemory: add wrapped data pointers to setup_buffer
Allows creating wrapped memories with GstGLAllocationParams.

The wrapped pointers will be set in the parameters before being passed
to the memory allocation function.
2017-12-09 19:32:19 +00:00
Matthew Waters 04e92acd3b glbasememory: take a pointer as the wrapped gpu handle
Allows passing arbitrary data to wrap the the specific memory implementation
which is required for some memory implementations.
2017-12-09 19:32:19 +00:00
Matthew Waters c459894f78 gl: fix gles3 header usage for older platforms
Some platforms provide an old version of GLES2/gl2.h and GLES2/gl2ext.h that
will fail when including GLES3/gl3.h due to missing typedef's.

Seen on the RPi.
2017-12-09 19:32:19 +00:00
Haihua Hu 0d1a65e86b gl: enable gldeinterlace on OpenGL ES
1.Porting the exist deinterlace shader and OpenGL callback
  to be compatible with OpenGL ES.
2.Add a our blur vertical shader to gldeinterlace.
3.Add a property named “method” to let user choose which
  deinterlace function to use. Default to choose blur vertical
  method for better performance.

[Matthew Waters]: fix name of greedyh in method property (was greedhy) and port
to git master.

https://bugzilla.gnome.org/show_bug.cgi?id=764873
2017-12-09 19:32:19 +00:00
Sebastian Dröge 1066b2a860 glviewconvert: Port more things to GLES/GL 3 compatibility
And move the shader mangling code into a single place instead of having a copy
in glcolorconvert and glviewconvert.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2017-12-09 19:32:19 +00:00
Sebastian Dröge 64c320ca3c glcolorconvert: GLES3 deprecates texture2D() and it does not work at all in newer versions than 3.3
Use the newer texture() function instead. This fixes glimagesink and other
things on various Android devices.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2017-12-09 19:32:19 +00:00
Hyunjun Ko 40182f7959 gl: caopengllayersink: fix a minor warning
Fix "unused variable" warning

https://bugzilla.gnome.org/show_bug.cgi?id=765292
2017-12-09 19:32:19 +00:00
Hyunjun Ko 84be275c4f gl/cocoa: Fix incompatible type warning
https://bugzilla.gnome.org/show_bug.cgi?id=765292
2017-12-09 19:32:19 +00:00
Sebastian Dröge 139ab08cde glimagesink: Fix indentation 2017-12-09 19:32:19 +00:00
Haihua Hu b43af664bc glimagesink: need to clean window_id when state change form READY to NULL
When application change pipeline state NULL->READY and then READY->NULL,
glimagesink will not clear glsink->window_id. After that, when application
change state NULL->READY, the new_window_id is equal to window_id, glimagesink
will not set window handle. It will use the internal window but not the window
create by application.

https://bugzilla.gnome.org/show_bug.cgi?id=765241
2017-12-09 19:32:19 +00:00
Heinrich Fink 981beba52d gl/caopengllayersink: Actually unset caps_change flag after resize
Otherwise, the sink would execute "on_resize" for each frame.

https://bugzilla.gnome.org/show_bug.cgi?id=765194
2017-12-09 19:32:19 +00:00
Heinrich Fink caa9ad59e6 gl/caopengllayer: Apply layer.contentsScale to viewport dims
Fixes blurry content on HiDPI screens

https://bugzilla.gnome.org/show_bug.cgi?id=765194
2017-12-09 19:32:19 +00:00
Matthew Waters 614f80cbcf gl/cocoa/eagl: don't leak GThread's when dispatching messages
gst_gl_context_get_thread() returns a refed pointer, we need to unref it.
2017-12-09 19:32:19 +00:00
Luis de Bethencourt 73110e6985 gltestsrc: don't dereference null pointer
funcs can be NULL, it is one of the two conditions of the OR statement
above, so confirm it isn't before dereferencing with funcs->free.

CID 1358388
2017-12-09 19:32:19 +00:00
Matthew Waters 3ee2183038 glupload: keep the parent buffer around when converting EGLImage to 2D textures
e.g. receiving and releasing a buffer from OMX too early will potentially
cause textures to be overwritten while/before they are displayed.
2017-12-09 19:32:19 +00:00
Matthew Waters 458c3067e4 glbasemixer: chain up to the parent implementation 2017-12-09 19:32:19 +00:00
Alessandro Decina 5c506cd857 libgstgl: cocoa, eagl: use libdispatch to schedule GL calls
Use libdispatch instead of GMainLoop to dispatch GL calls. libdispatch is more
optimized and cuts a lot of poll()/pthread_* overhead.
2017-12-09 19:32:19 +00:00
Alessandro Decina 3d124f498a glwindow: reduce the number of GMutexes and GConds in send_message()
Don't create many short lived locks/conds in gst_gl_window_send_message. This is
a micro optimization to save a bunch of pthread_* calls which are expensive on
OSX/iOS and possibly other platforms.
2017-12-09 19:32:19 +00:00
Matthew Waters 7f8e09523f videoaggregator: repect the result of find_best_format in the default update_caps
We weren't using the result of find_best_format at all.

Also, move the find_best_format usage to the default update_caps() to make
sure that it is also overridable.

https://bugzilla.gnome.org/show_bug.cgi?id=764363
2017-12-09 19:32:19 +00:00
Matthew Waters aae649dc75 glvideomixer: add support for the affine transformation meta 2017-12-09 19:32:18 +00:00