Commit graph

42 commits

Author SHA1 Message Date
Tim-Philipp Müller
c5b5ef16d3 gl: GST_EXPORT -> GST_GL_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:10:29 +00:00
Philippe Normand
c8b99139b1 glcontext: remove deprecated type alias
Now for real without un-needed comments...
2018-02-06 16:13:07 +00:00
Philippe Normand
32a17f3134 glcontext: remove deprecated type alias 2018-02-06 16:08:47 +00: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
Tim-Philipp Müller
1ddde50048 gl: make some debug categories private
They weren't supposed to be public.

https://bugzilla.gnome.org/show_bug.cgi?id=786170
2017-12-09 19:32:29 +00:00
Matthew Waters
82cf1b9c71 gl/docs: some documentation updates
Add some missing/incomplete docs
2017-12-09 19:32:29 +00:00
Matthew Waters
4c75bab70d glcontext: add public swap_buffers function
That simply calls the implementation
2017-12-09 19:32:28 +00:00
Arun Raghavan
ee49afed97 gl: Missed one backwards compat define in GST_GL_TYPE_CONTEXT
Continued from 296b4251e3
2017-12-09 19:32:27 +00:00
Sebastian Dröge
de16dc2555 gl: Fix backwards compat GST_GL_TYPE_* functions/macros
These have to be macros instead of inline function as they must behave
more or less like an integer literal, i.e. include the function call.
2017-12-09 19:32:26 +00:00
Matthew Waters
39e75767fb glcontext: add vfunc to retrieve the OpenGL platform version
i.e. the version of EGL, GLX, etc implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:25 +00:00
Matthew Waters
18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
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
Nirbheek Chauhan
6106816f50 gstgl: Add GST_EXPORT to all symbols used on Windows
This is a requirement for those symbols to be exported in gstgl-1.0.dll
when building with the MSVC compiler
2017-12-09 19:32:23 +00:00
Matthew Waters
1e8c7e0f31 gl: add necessary padding bytes to all public structs 2017-12-09 19:32:22 +00:00
Matthew Waters
31b1094744 gl: misc docs fixes/additions 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
472970324c glcontext: implement checking whether a context has been shared
Some operations are unnecessary when running with only a single GL
context.
e.g. glFlush when setting a fence object as the flush happens on wait.

API: gst_gl_context_is_shared
2017-12-09 19:32:14 +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
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
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
5849a9f657 glcontext: add gst_gl_context_set_display helper 2017-12-09 19:32:02 +00:00
Julien Isorce
bad3e16601 glcontext: add missing _CAST after G_TYPE_CHECK_CLASS 2017-12-09 19:32:02 +00:00
Matthew Waters
d44594c622 glcontext: store the thread current context 2017-12-09 19:31:57 +00:00
Edward Hervey
6d6c7f1f19 gl: Make glcontext debug category used in more places
As a bonus it makes the egl context debug messages visible now :)
2017-12-09 19:31:54 +00:00
Matthew Waters
bef3f020a6 glcontext: allow wrapped contexts to be utilised like non-wrapped contexts
Fill in the missing pieces like get_proc_address, the gl function vtable
2017-12-09 19:31:52 +00:00
Matthew Waters
be5d0d81e4 glcontext: add api for retreiving the current context and api
that is current in the calling thread.
2017-12-09 19:31:48 +00:00
Matthew Waters
14630fac38 glcontext: add gst_gl_context_can_share
Which determines whether two GstGLContext's can share sharable
OpenGL resources.
2017-12-09 19:31:46 +00:00
Matthew Waters
4e75ceba46 glcontext: add API to retreive the thread that context is active in 2017-12-09 19:31:46 +00:00
Matthew Waters
4277d2742a glcontext: add a destroy function
that just calls the subclass
2017-12-09 19:31:45 +00:00
Matthew Waters
babef3069b gl/context: add check_gl_version 2017-12-09 19:31:42 +00:00
Julien Isorce
67c18fee19 gl: add missing cgl and eagl context type
https://bugzilla.gnome.org/show_bug.cgi?id=729245
2017-12-09 19:31:41 +00:00
Matthew Waters
166d7b505c gl/context: add generic feature checking
At the moment it simply delegates to the subclass.
2017-12-09 19:31:40 +00:00
Matthew Waters
857200ff40 gl: make all GObjects inherit from GstObject
Aids memory leak debugging with GST_TRACE=mem-live
2017-12-09 19:31:39 +00:00
Matthew Waters
1460d22e92 gl/context: provide get_gl_version 2017-12-09 19:31:36 +00:00
Matthew Waters
97f6bc0bfc [891/906] context: add support for wrapping external contexts 2017-12-09 19:31:33 +00:00
Matthew Waters
d6bdcbe751 [856/906] context: document it 2017-12-09 19:31:32 +00:00
Matthew Waters
711ad485b2 [812/906] move the GL vtable from GstGLDisplay to GstGLContext
Conflicts:
	tests/check/libs/gstglcontext.c
2017-12-09 19:31:31 +00:00
Matthew Waters
48cd6ac353 [801/906] context: Reimplement GL context sharing
https://bugzilla.gnome.org/show_bug.cgi?id=704806
2017-12-09 19:31:31 +00:00
Matthew Waters
9cbb652b66 [794/906] context: add subclasses for the different platforms (egl, glx, wgl, etc)
- most code taken from the Window subclasses
- tested combinations: xEGL, GLX, Wayland+EGL, Cocoa (under GNUStep), WGL (Wine)
2017-12-09 19:31:30 +00:00
Matthew Waters
e80533dcee [793/906] add a GstGLContext object that will be the basis of OpenGL contexts
At the moment it just sits in between GstGLDisplay and GstGLWindow
performing some of the stuff that GstGLWindow used to do.
2017-12-09 19:31:30 +00:00