Commit graph

1140 commits

Author SHA1 Message Date
Matthew Waters
66407b9877 glcontext: fix get_current_gl_api on x11/nvidia drivers
They require to get_proc_address some functions through the
platform specific {glX,egl}GetProcAddress rather than the default
GL library symbol lookup.
2017-12-09 19:32:05 +00:00
Matthew Waters
cfa9b94045 glcontext: consolidate get_proc_address function definition
Pass the GstGLAPI directly.
2017-12-09 19:32:05 +00:00
Matthew Waters
3343e2dccd glcontext/glx: try creating a context with the highest version
nvidia drivers return the exact version in glGstString (GL_VERSION)
we request on creation so start with the highest known version and
work our way down.
2017-12-09 19:32:05 +00:00
Matthew Waters
78957c45c2 glcontext: track sharedness with a cookie
The previous approach of traversing the other_context weak ref tree was
1. Less performant
2. Incorrect for context destruction removing a link in the tree

Example of 2:
c1 = context_create (NULL)
c2 = context_create (c1)
c3 = context_create (c2)
context_can_share (c1, c3) == TRUE
context_destroy (c2)
unref (c2)
context_can_share (c1, c3) returns FALSE when it should be TRUE!

This does not remove the restriction that context sharedness can only
be tracked between GstGLContext's.
2017-12-09 19:32:05 +00:00
Matthew Waters
2df7e0f9de glcontext: use the debug object variant for completeness 2017-12-09 19:32:05 +00:00
Matthew Waters
5043800a1d glupload: memcpy on raw data upload
Anything else requires keeping track of the GstVideoFrame mapping
across possible multiple buffers to ensure correct data pointer
usage.
2017-12-09 19:32:05 +00:00
Matthew Waters
841380e022 glbasebuffer: add some debug and zero the data pointers on init 2017-12-09 19:32:05 +00:00
Sebastian Dröge
cff2d74cd4 gl/eagl: Don't call anything synchronously from the main thread
This will deadlock if the main thread is the one who creates the GstGLContext.
All things we call from the main thread should be possible from any thread.

https://bugzilla.gnome.org/show_bug.cgi?id=751101
2017-12-09 19:32:05 +00:00
Matthew Waters
b7a3b54b2a download: only start a download transfer for sysmem caps features 2017-12-09 19:32:05 +00:00
Hyunjun Ko
f67eb2571d glsyncmeta: transform func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
2017-12-09 19:32:05 +00:00
Matthew Waters
6a7bb242f9 android: add missing egl.h include 2017-12-09 19:32:05 +00:00
Matthew Waters
afcb6aa1da gl: consolidate egl header includes to egl-only headers
They may conflict with other headers.
2017-12-09 19:32:05 +00:00
Julien Isorce
9b1eb32c49 gl: 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:05 +00:00
Nicolas Dufresne
b8d3c2d2a5 gl: Don't leak pool if set_config failed 2017-12-09 19:32:05 +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
Sebastian Dröge
5df0fbfbca Revert "gl/window/x11: don't create our own X11 display"
This reverts commit 5697b6b89b.

https://bugzilla.gnome.org/show_bug.cgi?id=751003
2017-12-09 19:32:05 +00:00
Sebastian Dröge
30e13d6623 Revert "eagl: Don't dispatch_sync() to the main thread if we are on the main thread"
This reverts commit 0bff481011.

It wasn't supposed to be merged and also doesn't fix the problem.
2017-12-09 19:32:05 +00:00
Sebastian Dröge
c02891ba41 eagl: Don't dispatch_sync() to the main thread if we are on the main thread
This will otherwise deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=751101
2017-12-09 19:32:05 +00:00
John Ludwig
5e0b3b1c10 gl: Include texParameterf in the GL function table
https://bugzilla.gnome.org/show_bug.cgi?id=751228
2017-12-09 19:32:05 +00:00
Julien Isorce
1edc569069 glmemory: fix consistency about pbo availability.
https://bugzilla.gnome.org/show_bug.cgi?id=751165
2017-12-09 19:32:04 +00:00
Julien Isorce
76983d4454 gldisplay: add gst_gl_display_create_context
It also emits a create-context signal so that an application
can provide an external GstGLContext backend.

https://bugzilla.gnome.org/show_bug.cgi?id=750310
2017-12-09 19:32:04 +00:00
Julien Isorce
38a1939ea1 glcontext: move display from priv
https://bugzilla.gnome.org/show_bug.cgi?id=750310
2017-12-09 19:32:04 +00:00
Julien Isorce
cbc3f1242f Revert "glcontext: add gst_gl_context_set_display helper"
This reverts commit 71b8103cbd.
2017-12-09 19:32:04 +00:00
Julien Isorce
e29e67fa6e Revert "gl: add GstGLContextGPUProcess backend"
This reverts commit b377112ee3.
2017-12-09 19:32:04 +00:00
Nicolas Dufresne
2c1d4f4074 glviewconvert: Fix GLES2 compatibility 2017-12-09 19:32:04 +00:00
Nicolas Dufresne
7605b39eea glviewconvert: Fix broken validity check 2017-12-09 19:32:04 +00:00
Jan Schmidt
7b583526e9 gl libs: Add glviewconvert helper object
Add API for a helper object that can convert between different
stereoscopic video representations, and later do filtering
of multiple view streams.

https://bugzilla.gnome.org/show_bug.cgi?id=611157
2017-12-09 19:32:04 +00:00
Matthew Waters
2210ba5d46 glmemory: separate pbo transfer from texture transfers
When supported, the potentially longer pbo upload/download can be
initiated before the texture upload/download, potentially increasing
throughput.
2017-12-09 19:32:04 +00:00
Matthew Waters
900bcea9de glmemory: implement on top of glbasebuffer
Provides convenient access to PBO usage.

Currently texture updates are coupled tightly to data transfers.
2017-12-09 19:32:04 +00:00
Matthew Waters
1e87053475 gl: new glbasebuffer GstMemory object
Provides generic handling of GL buffer objects accessible using
the GL bind points (GL_ARRAY_BUFFER, GL_PIXEL_*_BUFFER).

Implementation based off the current GstGLMemory.
2017-12-09 19:32:04 +00:00
Matthew Waters
c9d99be28c gl/prototypes: add some buffer function prototypes 2017-12-09 19:32:04 +00:00
Matthew Waters
9900928403 gl/window/x11: only listen on the X Display when needed
5697b6b89b causes us to possibly listen
on a toolkit provided Display connection.  We thus could eat their
precious winsys events.  Only listen if we need to
(!foreign_display or videooverlay).
2017-12-09 19:32:04 +00:00
Jan Schmidt
8a1fc4ab4e gl: Add support for multiple views in upload, colour convert and download
Support multiple attached views on input/output buffers
by processing each one, not just the first.
2017-12-09 19:32:04 +00:00
Matthew Waters
1f7025c585 gl/window/x11: don't create our own X11 display
It's not needed anymore with most window operations occuring in the
GL thread.
2017-12-09 19:32:04 +00:00
Matthew Waters
e37cf3c55f gl/window/x11: handle_events() may be called before the window has been created
Fixes an XIO fatal error
2017-12-09 19:32:04 +00:00
Sebastian Dröge
1a995d1676 gl: OES_vertex_array_object is improperly implemented on PowerVR SGX 544MP
https://bugzilla.gnome.org/show_bug.cgi?id=750185
2017-12-09 19:32:03 +00:00
Thiago Santos
33b5cd5426 Fix a common typo: retreive -> retrieve
Seems to have been copy pasted around a few places
2017-12-09 19:32:03 +00:00
Philippe Normand
deedbd799c gl/dispmanx: Fix build 2017-12-09 19:32:03 +00:00
Matthew Waters
5404083158 gl/window/dispmanx: fix compiler warning 2017-12-09 19:32:03 +00:00
Matthew Waters
bb1de83ff2 gl/window: use the default main loop implementation for all backends
fixes glimagsink being unable to display.

https://bugzilla.gnome.org/show_bug.cgi?id=750337
2017-12-09 19:32:03 +00:00
Julien Isorce
9ac4280052 glwindow_cocoa: use parent default implementation
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=750337
2017-12-09 19:32:03 +00:00
Jan Schmidt
f6a102c3e5 glsyncmeta: Set new sync point when copying
Set a new sync point when copying instead of
transferring the (non-refcounted) GL sync object
from the source meta.

https://bugzilla.gnome.org/show_bug.cgi?id=750279
2017-12-09 19:32:03 +00:00
Jan Schmidt
7a288b0189 glsyncmeta: Add some debug output 2017-12-09 19:32:03 +00:00
Matthew Waters
fd7348d064 glmemory: provide compatibility definition for GLES2 for GL_RGBA8 2017-12-09 19:32:03 +00:00
Matthew Waters
1e9f7b6303 gl: consolidate internal_rgba_format into glmemory
Expose some useful value format conversion functions available in
GstGLMemory.
2017-12-09 19:32:03 +00:00
Julien Isorce
f8ebadabcd glcontext_gpu_process: close the window when done 2017-12-09 19:32:03 +00:00
Julien Isorce
62130b34ff glwindow_gpu_process: avoid empty struct 2017-12-09 19:32:03 +00:00
Julien Isorce
210d2c2825 glwindow: move main loop/context creation back to init/finalize
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=750199
2017-12-09 19:32:03 +00:00
Sebastian Dröge
7ae1efa8b3 gl: Fix compiler warning
gstglwindow_wayland_egl.c:246:41: error: unused variable 'surface_listener' [-Werror,-Wunused-const-variable]
static const struct wl_surface_listener surface_listener = {
                                        ^
2017-12-09 19:32:03 +00:00
Matthew Waters
fea0b65eb5 glwindow: fix compiler error
gstglwindow.c:1118:544: error: 'return' with no value, in function returning non-void [-Werror]
   g_return_if_fail (GST_GL_IS_WINDOW (window));
2017-12-09 19:32:03 +00:00