Commit graph

43 commits

Author SHA1 Message Date
Matthew Waters
7f95a809e9 gtkgl: Also try retrieving an EGL context from Gdk with X11
Some embedded platforms will use EGL instead of GLX within the X11
ecosystem.
2019-03-05 15:26:45 +11:00
Sebastian Dröge
db0eca886f gtk/gl: Only unbind buffers/vertex attrib arrays if we can't directly bind the vertex array to 0
Binding the vertex array to 0 will unbind everything else already.

In the previous order older versions of the Intel GL driver caused
errors to be printed for every single call when disabling the vertex
attrib arrays after binding the vertex array to 0.
2019-01-16 14:11:44 +02:00
Tim-Philipp Müller
238a37295c Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 23:44:19 +02:00
Tim-Philipp Müller
33e2fadc3a gtk: don't include uninstalled header 2017-12-19 13:03:28 +00:00
Edward Hervey
63398b8525 gtk: Fix possibility of NULL variable
It's quite unlikely since it's initialized in instance initialization.

CID #1417721
2017-11-24 08:00:21 +01:00
Matthew Waters
38b5a9bf33 gtkglsink: expose the created display and context correctly
1. Propagate the GstGLDisplay we create
2. Add the created GstGLContext to the propagated GstGLDisplay

Otherwise with multi-branch GL pipelines involving gtkglsink, things
will fall apart and errors will be genarated somewhere.
2017-09-05 21:16:33 +10:00
Julien Isorce
a4d74fda9a 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-08-22 10:00:19 +01:00
Thibault Saunier
1ee15d67b0 docs: Port all docstring to gtk-doc markdown 2017-04-12 12:57:57 -03:00
Matthew Waters
f451d9be8d gl: GL_ARRAY_BUFFER is not a part of VAO state
As a result we need to bind it on every draw in order to have the
correct state in the GL state machine.
2017-03-14 14:15:00 +11:00
Matthew Waters
3faf049250 gtk/gl: don't assert when gdk doesn't provide a GL context
Allows the application to check whether gtkglsink is supported by setting
the element to READY.

https://bugzilla.gnome.org/show_bug.cgi?id=764148
2016-03-25 17:49:14 +11:00
Matthew Waters
caafdd8ca2 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.
2016-02-09 12:30:25 +11:00
Matthew Waters
5f94356ce1 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'
2015-10-19 15:15:30 +11:00
Matthew Waters
136f375f01 glshader: port to using GstGLSLStage objects for string management
A GstGLShader is now simply a collection of stages that are
compiled and linked together into a program.  The uniform/attribute
interface has remained the same.
2015-10-15 21:27:57 +11:00
Matthew Waters
ab5f9c551f gtk: add some GL debug statements to show up in GL traces 2015-09-30 12:39:47 +10:00
Thibault Saunier
edebbb709f gtk: Factor out a function to run a function on main thread
https://bugzilla.gnome.org/show_bug.cgi?id=755251
2015-09-24 12:03:01 +02:00
Vineeth T M
35812bce51 gl: Fix GError leaks during failures
https://bugzilla.gnome.org/show_bug.cgi?id=755140
2015-09-17 11:52:55 +02:00
Matthew Waters
115691c508 gtk, qt: more specifically define the compile time requirements
Otherwise we could include headers/configurations that will
never been installed.

https://bugzilla.gnome.org/show_bug.cgi?id=754732
2015-09-10 13:11:06 +10:00
Tim-Philipp Müller
f96d22bd45 gtk, qt, gl: fix typo in debug and error messages 2015-08-31 18:06:31 +01:00
Sebastian Dröge
69c4630f1d gtk/gl: Use our GL function table instead of directly calling GL functions
Otherwise we would have to link the plugin to the GL libraries directly.
2015-08-19 13:55:00 +03:00
Nicolas Dufresne
aaf14659c1 gtkglsink: Add overlay composition support
Rendering composition overlay in GL with additional high resolution
overlay being added.
2015-08-15 15:55:08 +02:00
Nicolas Dufresne
cf44f5013a gtkglsink: Fix unsafe handling of buffer life time
We need to keep the active buffer (the one we have retreive a
texture id from) otherwise it's racy and upstream may upload
new content before we have rendered or during later redisplay.
2015-08-15 15:55:08 +02:00
Nicolas Dufresne
9afab22dd9 gtkglsink: Remove reset path
The reset path is bogus and there is no reason to get rid of these
things during resize.
2015-08-15 15:55:08 +02:00
Julien Isorce
47f3f98366 gstglwidget: use gst_gl_display_create_context
Also handle the failure case.

https://bugzilla.gnome.org/show_bug.cgi?id=750310
2015-07-21 15:06:34 +01:00
Thibault Saunier
b1d22b0515 gtk: Log GDK GL error when failling creating GdkGLContext 2015-07-20 11:09:20 +02:00
Matthew Waters
ca97f5121a 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.
2015-07-18 18:18:22 +10:00
Nicolas Dufresne
ef6bfe0eb4 gtkgstglwidget: Cleanup unused private member
new_buffer has been moved to base class. Also cleanup
the properties comment, which are also all moved into
the base class.
2015-07-17 16:00:01 -04:00
Nicolas Dufresne
067051f6fe gtkglsink: Don't leak vertex array and buffers
This is now possible since reset is always called from the
main thread.

https://bugzilla.gnome.org/show_bug.cgi?id=752441
2015-07-17 15:41:09 -04:00
Nicolas Dufresne
4c201f3aa6 gtkglsink: Port to GtkGstBaseWidget
https://bugzilla.gnome.org/show_bug.cgi?id=752441
2015-07-17 15:13:11 -04:00
Nicolas Dufresne
5243f5678d gtkgstglwidget: Remove unused gl_caps 2015-07-16 17:05:36 -04:00
Nicolas Dufresne
1a7c9b82f4 gtk: Fix race between queue_draw and destroy
In GTK dispose can be called before the last ref is reached. This
happens when you close the container window. The dispose will be
explicitly called, and destroyed notify will be fired. This patch
fixes this race by properly tracking the widget state.

In the sink, we now set the widget pointer to NULL, so the widget
will properly get created again if you set your pipeline to NULL
state after the widget was destroy, and set it back to PLAYING.

https://bugzilla.gnome.org/show_bug.cgi?id=751104
2015-07-16 17:05:36 -04:00
Matthew Waters
469ea20754 gtk: add to the generic/states test 2015-07-09 16:40:19 +10:00
Thibault Saunier
cb10f1b290 gtkglsink: Release the widget lock when trying to get the GL context
Otherwise we might be waiting for the lock on the main loop (for
example in the ->render vmethod) and thus we will deadlock.
2015-07-06 19:33:35 +02:00
Sebastian Dröge
577ca6a0e8 gtkglwidget: Const'ify another array 2015-06-15 21:32:43 +02:00
Sebastian Dröge
e410c770f5 gtkglwidget: Calculate the viewport size ourselves
Getting the current viewport and modifying it relatively will produce an
interesting feedback loop during widget resizing. Over a few frames we
will gradually move the viewport a bit until it converged again, adding
unnecessary additional borders at the top and left.
2015-06-15 21:29:46 +02:00
Sebastian Dröge
5cabeb3415 gtk: Use the display width/height for the widget's preferred width/height 2015-06-15 21:24:01 +02:00
Sebastian Dröge
05fa796c25 gtk: Implement ignore-alpha property and enable it by default 2015-06-15 20:35:38 +02:00
Matthew Waters
48db03200d gtk: implement pixel and display aspect ratio handling 2015-06-15 22:39:07 +10:00
Matthew Waters
8648d59974 gtk: silence unused variable warnings for unsupported winsys' 2015-06-15 14:41:24 +10:00
Matthew Waters
869ea6093c gtk: implement basic wayland GL support 2015-06-15 14:41:05 +10:00
Thibault Saunier
baad74b995 gtk: Do not try to activate a NULL GLContext
At that point in the code nothing guarantees it exists
2015-06-12 15:40:29 +02:00
Matthew Waters
a512a91598 gtk: implement video aspect-ratio handling
For both the software and the GL sink's.

Doesn't deal with the pixel-aspect-ratio field at all yet.
2015-06-12 15:17:30 +10:00
Thibault Saunier
4cef5787c8 gtk: Do not try to initialize display if we have not have a GLContext yet 2015-06-11 15:07:24 +02:00
Matthew Waters
a959c410d9 Implement gtk sinks
two sinks are provided.  gtksink which is a cairo/software based renderer
and gtkglsink which utilises the GL support in gtk and gstreamer.
2015-06-11 22:01:03 +10:00