Commit graph

1382 commits

Author SHA1 Message Date
Nicolas Dufresne 910d990e4b glbasememory: Don't change maxsize at run-time
Maxsize is initialized once and should never change. Allocating data
should have no impact on the selected max size for this memory. This
causing memory map failure as the maxsize would become smaller then
size. This happened when using direct rendering in avviddec on GL that
does not support PBO transfer.

https://bugzilla.gnome.org/show_bug.cgi?id=763045
2017-12-09 19:32:17 +00:00
Matthew Waters 9d66a5ff06 eglimagememory: add compatibility definitions for EGL dmabuf
e.g. the RPi doesn't have them defined
2017-12-09 19:32:17 +00:00
Matthew Waters 5f87cc0b65 glcontext: add a method to add a context to another share group
Intended for use with wrapped contexts that are created shared with gst's
gl contexts in order to manage the internal sharegroup state correctly.

e.g. with caopengllayer (which is used in glimagesink and caopengllayersink
on OS X), we create a CGL context from the gst context and the sharing state
was not being correctly set on either GL context and gst_gl_context_is_shared()
was always returning FALSE.

With 11fb4fff80 only flushing with multiple
shared contexts, the required flush was not occuring causing screen
corruption or stuttering.

Note: this didn't affect GST_GL_API=opengl pipelines

https://bugzilla.gnome.org/show_bug.cgi?id=762620
2017-12-09 19:32:17 +00:00
Matthew Waters 7e108f4763 gl: fix the build
2d287812 was incomplete
2017-12-09 19:32:17 +00:00
Matthew Waters e71e492413 gl: error out if the configured GL API is unsupported by our element
https://bugzilla.gnome.org/show_bug.cgi?id=759801
2017-12-09 19:32:17 +00:00
Julien Isorce 1377a0a4f9 gldebug: make sure debug is initialized when calling gst_gl_insert_debug_marker
Usually gl debug is initialized in gst_gl_context_create_thread.
But this function is not used when using the GstGLContextGPUProcess
from ChromiumGStreamerBackend.

Received signal 11 SEGV_MAPERR 000000000000
gst_debug_category_get_threshold
gst_gl_insert_debug_marker
gst_gl_base_filter_gl_start
2017-12-09 19:32:17 +00:00
Sebastian Dröge adfd016d01 gl: Fix compiler warning about unused const variable with gcc 6
CC       libgstgl_x11_la-gstglcontext_glx.lo
In file included from gstglcontext_glx.c:39:0:
../utils/opengl_versions.h:52:43: error: ‘gles2_versions’ defined but not used [-Werror=unused-const-variable]
 static const struct { int major, minor; } gles2_versions[] = {
                                           ^~~~~~~~~~~~~~
2017-12-09 19:32:17 +00:00
Sebastian Dröge af5eddc6e8 gl: Move private headers from SOURCES to noinst_HEADERS 2017-12-09 19:32:16 +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 745071b5bf gl: Remove leftover g_prints
One was commented out, but we also don't use // comments :)
2017-12-09 19:32:16 +00:00
Matthew Waters 88d71c10ca gldebug: use the correct spelling for behavior
The headers use the american spelling of behavior not the UK/AUS version with
the extra U.
2017-12-09 19:32:16 +00:00
Matthew Waters 7dcdb1d29c glcontext: don't enable GL debug for messages that won't be logged
This is an optimization to avoid pointless string processing.
2017-12-09 19:32:16 +00:00
Tim-Philipp Müller 1390312037 gl: syncmeta: define GL_TIMEOUT_IGNORED in more portable way 2017-12-09 19:32:16 +00:00
Alessandro Decina bc8d272aad gstglshader: cache uniform locations
Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.
2017-12-09 19:32:16 +00:00
Alessandro Decina 7e1a42ce55 gstglcontext: micro optimization to gst_gl_context_thread_add
Invoke the callback right away when called on the context thread. Removes
overhead when nesting libgstgl calls (for example when working with the sync
meta).
2017-12-09 19:32:16 +00:00
Matthew Waters fb34d8a04b glsyncmeta: add compatibility definition for GL_TIMEOUT_IGNORED 2017-12-09 19:32:16 +00:00
Matthew Waters f4bd4434c4 glsyncmeta: separate out gpu/cpu waits.
CPU waits are more expensive and are only required if the CPU is ever going to
access the data. GPU waits perform inter-context synchronisation and are cheaper
as they don't require CPU intervention.
2017-12-09 19:32:16 +00:00
Matthew Waters f4bab389c5 gl: add .def file for msvc builds
Also internalize some API from being exported.
2017-12-09 19:32:16 +00:00
Luis de Bethencourt 265005a5e1 glquery: remove unnecessary pointer check
All uses of query->context in gstglquery.c assume it exists. We can assume
this as well before unrefing it. Furthermore, gst_object_unref() will just
silently return if it ever were to not exist.
2017-12-09 19:32:16 +00:00
Matthew Waters ed40eaca00 glbasefilter: enable qos by default
Improves the responsiveness of the pipeline when resources are close/above the
limitations of the hardware.

Any subclass that wishes not to enable qos can do so themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=761519
2017-12-09 19:32:16 +00:00
Matthew Waters 62588100fd Revert "gl/eagl: try getting a gles3 context"
This reverts commit 96b9666d59.
This reverts commit d11385d167.

This breaks the texture sharing with the applemedia elements as
CVOpenGLESTextureCache seems to have an arbitrary restriction on GLES2 only.
2017-12-09 19:32:16 +00:00
Matthew Waters 17f2b9b252 glcolorconvert: don't skip subset structures
We may need them to transform into a different set of formats.

Fixes YUV->YUV with two glcolorconverts, e.g:

format=I420 ! glcolorconvert ! glcolorconvert ! format=NV12
2017-12-09 19:32:16 +00:00
Matthew Waters 63f7d0a396 glbasefilter: always call gl_start when not called already
Fixes elements transitioning out of passthrough mode using GL resources that
hadn'e been allocated yet.
2017-12-09 19:32:16 +00:00
Matthew Waters e2c9f4570c glcolorconvert: fix RGB,rectangle->planar YUV conversion
Converting to GRAY is no fun.  Another case of normalized vs unnormalized
texture coordinates.
2017-12-09 19:32:16 +00:00
Matthew Waters b4704301c6 glcolorconvert: fix YUY2/UYVY,rectangle->RGB conversion
1.0 / width does not offset by one pixel in rectangular textures (which use
unnormalized coordinates).

Provide the actual pixel offset as a uniform to the shader.
2017-12-09 19:32:16 +00:00
Matthew Waters 32b71bd48d glcolorconvert: perform better negotiation
1. Correctly describe what we can caps we can transform to/from.
   i.e. no YUV->YUV or GRAY->YUV or YUV->GRAY (except for passthrough).
2. Prefer similar formats and ignore incompatible formats on fixation.
2017-12-09 19:32:16 +00:00
Julien Isorce f2cfa7fb51 gstglwindow: initialize navigation_loop to NULL
Useful when gst_gl_window.c::gst_gl_window_new is not used.
This is the case when using a custom GstGLWindow.
(ex: GstGLWindowGPUProcess from Chromium)
2017-12-09 19:32:16 +00:00
Tim-Philipp Müller a0d62ce32c gl: eagl: fix build
gstglcontext_eagl.m:238:45: error: too few arguments to function call,
expected at least 4, have 3
2017-12-09 19:32:16 +00:00
Matthew Waters de5f87e72b gl/eagl: try getting a gles3 context
Fallback to a gles2 context if that fails
2017-12-09 19:32:15 +00:00
Wang Xin-yu (王昕宇) 1e4c9c1688 glprototypes: fix parameter type of glGenBuffers
The number of buffers should be GLsizei instead of GLuint.

https://bugzilla.gnome.org/show_bug.cgi?id=761272
2017-12-09 19:32:15 +00:00
Matthew Waters d41c132dfa glcontext: back out unintended lost_context changes 2017-12-09 19:32:15 +00:00
Matthew Waters 5d2ddf7664 egl: implement selecting opengl3 contexts 2017-12-09 19:32:15 +00:00
Matthew Waters 786b2fb9f1 gl/egl: pass the error value to get_error_string() 2017-12-09 19:32:15 +00:00
Matthew Waters 2cef90184e gl: move control binding proxy implementation from glvideomixer
Other elements may need to use it's functionality
2017-12-09 19:32:15 +00:00
Holger Kaelberer 944923080b glwindow: Fix android build
https://bugzilla.gnome.org/show_bug.cgi?id=760972
2017-12-09 19:32:15 +00:00
Tim-Philipp Müller 370a151ee2 libs: g-i: fix init section to avoid compiler warnings
..GstPlayer-1.0.c: In function ‘main’:
..GstPlayer-1.0.c:587:3: warning: implicit declaration of function ‘gst_init’

https://bugzilla.gnome.org/show_bug.cgi?id=760090
2017-12-09 19:32:15 +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
Sebastian Dröge f05da0fef7 glcolorconvert: Caps passed to fixate_caps() are not owned by us and guaranteed to be fixed
So don't try to fixate them, which takes ownership and steals them from
basetransform.

https://bugzilla.gnome.org/show_bug.cgi?id=760696
2017-12-09 19:32:15 +00:00
Sebastian Dröge a208624354 Revert "glpool: fix caps refcount issue"
This reverts commit 3bdcdedfa0.

gst_caps_replace() takes a new reference already, if there is a problem then
it is elsewhere. And there are a few problems, see
https://bugzilla.gnome.org/show_bug.cgi?id=760696
2017-12-09 19:32:15 +00:00
Matthew Waters 554b23ae48 glquery: provide compat definition for GL_QUERY_RESULT
e.g. android doesn't have it

While we're here move a state specific assertion after the supported check.
Removes an assertion on GLES
2017-12-09 19:32:15 +00:00
Matthew Waters fc882653b6 gl: add compatibility definition of GLint64
e.g. anrdoid doesn't have it
2017-12-09 19:32:15 +00:00
Matthew Waters 06d8000708 glpool: fix caps refcount issue
The caps are from an allocation query which are transfer none but were being
treated as transfer full.
2017-12-09 19:32:15 +00:00
Matthew Waters 575974aeaf glmemory: log the time for glTexSubImage/glReadPixels 2017-12-09 19:32:15 +00:00
Matthew Waters 65533b807c gl: add a gstglquery object for arbitrary GL queries
Currently only GL_TIME_ELAPSED and GL_TIMESTAMP are supported
2017-12-09 19:32:15 +00:00
Matthew Waters a41f91253e gldebug: implement a delayed debug system
The messages are stored by gst_gl_async_debug_store_log_msg() and output later
by a corresponding store(), output() or an unset()/free().

Some wrapper macros are provided to avoid callers explicitly using __FILE__,
GST_FUNCTION and __LINE__
2017-12-09 19:32:15 +00:00
Matthew Waters b804aa2399 gldebug: use gst_info_vasprintf in insert_debug_marker()
Allows expansion of GST_PTR_FORMAT and GST_SEGMENT_FORMAT arguments.
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 cb9463d1a2 glbasefilter: add a class function on set_caps (from GL)
This is simply a convenience to avoid duplicating the thread marshalling on
set_caps.
2017-12-09 19:32:14 +00:00
Matthew Waters d5913f3048 gl/x11/navigation: add button press to the selected event mask
Otherwise we won't get the button press events and GstNavigation fails.
2017-12-09 19:32:14 +00:00
Alessandro Decina c2a6c97a1d glcolorconvert: try harder to passthrough
This makes a pipeline like:

... ! video/x-raw(memory:GLMemory),format=UYVY ! glcolorconvert !
video/x-raw(memory:GLMemory),format={UYVY, NV12} ! ...

passthrough instead of converting UYVY => NV12. The conversion would happen
before this change since the element (and basetransform) transform the src caps
to format={NV12, UYVY} (since NV12 comes first in the glcolorconvert:src
template) and then the default caps fixate func would fixate to NV12. Blah.

Also there's no need to intersect against the template caps in ::transform_caps
since basetransform does that right after calling the vfunc.
2017-12-09 19:32:14 +00:00