Commit graph

191 commits

Author SHA1 Message Date
Matthew Waters 894035f0d7 gl: Add EGLDisplay display subclass 2017-12-09 19:31:34 +00:00
Matthew Waters 303b77eeff [890/906] x11: add display subclass
GstGLDisplayX11 holds the display connection and name.  Each thread requires
it's own X11 Display connection (initialised from name) due to the fact that
we do not want to call XInitThreads().  Doing so would result in segfaults
when integrating with GUI toolkits Gtk, Qt, etc.

The Display connection is for OpenGL platforms where a constant display is
required in order to share contexts (egl).  In the case of a wrapped context
(added later), we do not have GstGLWindow to retreive the display from so a
'master' connection is used instead.
2017-12-09 19:31:33 +00:00
Matthew Waters adfbafe36c [889/906] display: add display type enum 2017-12-09 19:31:33 +00:00
Matthew Waters 54923d1909 [857/906] display: document the new GstContext api 2017-12-09 19:31:32 +00:00
Matthew Waters 84425ad43d [853/906] display: remove _{set,get}_context
A GstGLDisplay doesn't need a GstGLContext and its use
was cause a reference cycle
2017-12-09 19:31:32 +00:00
Matthew Waters 64fad7a6d2 [852/906] use GstContext for GstGLDisplay propogation
implements the hooks required in GstElement::set_context and the context query
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 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
Sebastian Dröge b3eef9dd15 [753/906] gldisplay: Sending a message is synchronous, we can allocate the memory on the stack 2017-12-09 19:31:29 +00:00
Sebastian Dröge ef68e5ade2 [751/906] gldisplay: Don't hold lock while sending a message to the GL thread
https://bugzilla.gnome.org/show_bug.cgi?id=704247
2017-12-09 19:31:29 +00:00
Julien Isorce d17a4381b1 [732/906] build: fix repeated typedefs
Write forward declarations in another way to avoid
repeated typedefs "error: redefinition of typedef".
Raised when using i686-apple-darwin11-llvm-gcc-4.2
It seems that C apple compiler does not support
C11 feature.

https://bugzilla.gnome.org/show_bug.cgi?id=703885
2017-12-09 19:31:29 +00:00
Matthew Waters 2ae5b50fa4 [709/906] display: some more cleanups 2017-12-09 19:31:28 +00:00
Matthew Waters 6e86d0e920 [708/906] display: a cleanup and removal of old code 2017-12-09 19:31:28 +00:00
Matthew Waters bdf5b5be0f [707/906] display: move error_message to utils 2017-12-09 19:31:28 +00:00
Matthew Waters 5bc069a5d5 [706/906] display: move activate_context into utils 2017-12-09 19:31:28 +00:00
Matthew Waters c6988cb064 [701/906] display: move context creation into window 2017-12-09 19:31:28 +00:00
Matthew Waters 9c633e658a [700/906] display: move most of the code into utils for sorting later
This contains a hack that essentially requires one GstGLDisplay
per process.
2017-12-09 19:31:28 +00:00
Matthew Waters 38e0434d95 [699/906] display: remove list of upload and download objects
and only create an up/download object when needed.
2017-12-09 19:31:28 +00:00
Matthew Waters 81334a1af0 [698/906] move sink-specific stuff from GstGLDisplay into glimagesink 2017-12-09 19:31:28 +00:00
Matthew Waters ad31c9f8e2 [697/906] display: allow the user to try and choose the GL api we use via env variable
GST_GL_API=opengl,opengl3,gles2,gles3
2017-12-09 19:31:28 +00:00
Matthew Waters d71ab51c9f [688/906] display: properly shutdown if we error after context creation
The _finalize() code checks to see if the context was created before
attempting to destroy it.  We never did say that we had created the context.
2017-12-09 19:31:27 +00:00
Matthew Waters a9b5bfe9d7 [684/906] display: lack of format-string causing a compiler warning 2017-12-09 19:31:27 +00:00
Matthew Waters 792f055db4 [672/906] display: constify GstGLFuncs *gl 2017-12-09 19:31:27 +00:00
Matthew Waters dba83ebbd3 [670/906] display: replace glib deprecated api 2017-12-09 19:31:27 +00:00
Matthew Waters 7d4d1f50d4 [669/906] window: seperate object creation and context creation 2017-12-09 19:31:27 +00:00
Matthew Waters 6bee9b9c93 [647/906] remove dependecy on glew 2017-12-09 19:31:27 +00:00
Matthew Waters 2f2916dd50 [645/906] fix gles2 compilation 2017-12-09 19:31:27 +00:00
Matthew Waters c692a610de [643/906] display: privatise most of the struct 2017-12-09 19:31:26 +00:00
Matthew Waters e983f02e87 [642/906] add gstglconfig.h for apps to find out what our capabilites are
ie libgstgl can be compiled with any combination of opengl/gles2
2017-12-09 19:31:26 +00:00
Matthew Waters 8375116c4b [641/906] display: feature check for GL extension functions 2017-12-09 19:31:26 +00:00
Matthew Waters db236c510f [633/906] display: fail properly in context creation in order to minimize a race condition
previously, on context creation, when we failed to get a valid context
we would still atempt to run the window mainloop as well as setting an error
on the display. This would cause the calling element to finalize the display
and therefore attempt to quit the window mainloop.  However the mainloop
may not have started running.  Thus when the window mainloop ran it would
never a get a quit message and never end.
2017-12-09 19:31:26 +00:00
Matthew Waters 1ec4ffc824 [630/906] display: add gl api checking
i.e. check for cases where the window wants a different API than
what the library was compiled with
2017-12-09 19:31:26 +00:00
Matthew Waters 344253e860 [624/906] OPENGL_ES2 => HAVE_GLES2 and add HAVE_OPENGL
use GstGLAPI to determine which code paths to execute.
perform some cleanups
2017-12-09 19:31:26 +00:00
Matthew Waters 4d88e9977e [608/906] add GST_GL_PLATFORM_ANY for choosing any platform 2017-12-09 19:31:25 +00:00
Matthew Waters 538643e3c0 [606/906] determine the GL platform to use at runtime
- Make GstGLWindow subclassablerather than specified at compile time.
- Add GstGLWindowX11 for x11 windows and two subclasses, GstGLWindowX11GLX
  and GstGLWindwX11EGL for GLX and EGL repectively. (win32 and cocoa
  ports to come)
- Also cleanup GL library detection in configure.ac
2017-12-09 19:31:25 +00:00
Matthew Waters 4c35d682c9 [603/906] update FSF address 2017-12-09 19:31:25 +00:00
Matthew Waters 39866ea830 [590/906] up/download: fix scaling on transfer
i.e. uploading from a 10x10 video frame to a 20x20 texture into another 30x30 videoframe
2017-12-09 19:31:25 +00:00
Matthew Waters 3ee54d3135 [573/906] add upload and download library objects
allows multiple upload pipelines that previously wasn't possible
 (i.e. upload RGB and I420 and ... on the same GstGLDisplay)
2017-12-09 19:31:25 +00:00
Matthew 4a424d6d2c [567/906] fix OpenGL|ES2 ifdef'ed code 2017-12-09 19:31:25 +00:00
Matthew Waters a1a653c8ed [562/906] gldisplay: fix download of YUV formats 2017-12-09 19:31:24 +00:00
Matthew Waters c0235ddafa [561/906] gldisplay: fix endianess issues on RGB download 2017-12-09 19:31:24 +00:00
Matthew Waters 7a79d684e2 [543/906] GstGLDisplay: fix segfault from GST_PTR_FORMAT trying to expand the object 2017-12-09 19:31:24 +00:00
Matthew Waters 38b6bdfa8b [527/906] GstGLDisplay: add some trace debugging 2017-12-09 19:31:24 +00:00
Matthew Waters 0d5b8bbc38 [524/906] GstGLDisplay: rework the download code
data paramaters now take GstVideoFrame
remove redundant parameters
2017-12-09 19:31:24 +00:00
Matthew Waters be177b01b7 [522/906] GstGLDisplay: add forgotten function definition 2017-12-09 19:31:24 +00:00
Matthew Waters 6528aba8c9 [515/906] GstGLDisplay: rework gen_texture and upload
rename functions so that other code can create textures in the GL thread
change upload functions to take a GstVideoFrame
default to GLSL for upload conversion
2017-12-09 19:31:24 +00:00
Matthew Waters 3e18471e8e [509/906] GstGLDisplay: update for 1.0 2017-12-09 19:31:24 +00:00
Matthew Waters f7bc5dcf83 [503/906] Rename GST_BOILERPLATE_* to G_DEFINE_TYPE_* and move _base_init into _class_init 2017-12-09 19:31:24 +00:00
Julien Isorce 20c429684e [500/906] gldisplay: do not call glCheckFramebufferStatus if 0 is bound
Indeed it may return GL_FRAMEBUFFER_UNDEFINED if there is no
default framebuffer.
It seems to be the case on MacOSX
2017-12-09 19:31:24 +00:00
Julien Isorce 83b2f12c12 [495/906] glES2.0: properly use glDeleteShader 2017-12-09 19:31:23 +00:00