Commit graph

47 commits

Author SHA1 Message Date
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
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
e9864e2e3e glwindow: remove unused draw_unlocked function
The functionality is provided by draw anyway and is leftover from
X11's specific threading requirements that no longer apply.
2017-12-09 19:32:08 +00:00
Matthew Waters
63bbe9406a glwindow: add API to request a resize event on the next draw
- glimagesink needs to be able to resize the viewport on aspect ratio
  changes resulting from either caps changes or 3d output mode changes.
- Performing a glViewport outside the GstGLWindow::resize callback
  will not have the winsys' stack of viewports required to correctly
  place the output frame.

Provide a function to request a resize on the next draw event from the
winsys.

Also track size changes inside the base GstGLWindow class rather
than in each subclass.

https://bugzilla.gnome.org/show_bug.cgi?id=755111
2017-12-09 19:32:08 +00:00
Matthew Waters
70184c52f0 wayland: fail window open if the display is the correct type
Errors out cleanly if a wayland compositor is not running
2017-12-09 19:32:07 +00:00
Matthew Waters
6ccaafc0f3 glwindow: pass display to implementation's _new()
So they have to opportunity to fail if they cannot handle the
display connection.

https://bugzilla.gnome.org/show_bug.cgi?id=752743
2017-12-09 19:32:07 +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
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
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
33d8bbaea4 gl/wayland: implement setting the render rectangle
Places our subsurface at the rectangle provided position
2017-12-09 19:32:03 +00:00
Matthew Waters
8332b1abe8 gl/wayland: don't block the event loop after poll
Use the dispatch_pending set of functions which just run the currently
queued up events instead of potentially waiting for an event to occur.
2017-12-09 19:32:03 +00:00
Matthew Waters
54199ea203 gl/wayland: implement basic video overlay support via subsurfaces
Currently does not position the subsurface relative to the parent surface at all
2017-12-09 19:32:03 +00:00
Matthew Waters
8404981dfb gl/wayland: allow a NULL wl_event_queue
perform operations on the default wl_display event queue in that case
2017-12-09 19:32:03 +00:00
Matthew Waters
00cff1f9e4 gl/wayland: run each window on a separate queue
Based on patch by Julien Isorce <julien.isorce@collabora.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=709747
2017-12-09 19:32:03 +00:00
Matthew Waters
4e58ec83e0 gl/wayland: remove dead event source code 2017-12-09 19:32:02 +00:00
Matthew Waters
9f704d7c2d gl/wayland: add GstGLDisplayWayland
Simple implementation split from GstGLWindowWayland

Can now have multiple glimagesink elements all displaying output
linked via GL or otherwise (barring GL platform limitations).

The intel driver is racy and can crash setting up the two glimagesink contexts.

e.g.
videotestsrc ! tee name=t ! queue ! glupload ! glimagesinkelement
  t. ! queue ! gleffects_blur ! glimagesinkelement

videotestsrc ! glupload ! glfiltercube ! tee name=t ! queue ! glimagesinkelement
  t. ! queue ! gleffects_blur ! glimagesinkelement
2017-12-09 19:32:02 +00:00
Matthew Waters
5b8f3e7870 gl/window: create the main loop/context on init/finalize
Avoids races setting the window handle from the main thread.

https://bugzilla.gnome.org/show_bug.cgi?id=745633
2017-12-09 19:31:56 +00:00
Matthew Waters
019367c128 glwindow: remove width/height from _draw()
Depending on the platform, it was only ever implemented to 1) set a
default surface size, 2) resize based on the video frame or 3) nothing.
Instead, provide a set_preferred_size () that elements/applications
can use to request a certain size which may be ignored for
videooverlay/other cases.
2017-12-09 19:31:53 +00:00
Matthew Waters
e32c4a62c2 gl/wayland: implement resizing the window using the right mouse button 2017-12-09 19:31:50 +00:00
Gwenole Beauchesne
14521a89cb gl: fix out-of-source builds.
Always use the locally generated <gst/gl/gstglconfig.h> file.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2017-12-09 19:31:35 +00:00
Matthew Waters
0fa966bb3d gl: remove explicit reference to X_CFLAGS
They are in GL_CFLAGS if required
2017-12-09 19:31:35 +00:00
Julien Isorce
b30d15d4b8 gl: keep only one occurence of '#include <EGL/egl.h>'
To simply maintainance if we need to put specific includes around it.
2017-12-09 19:31:34 +00:00
Matthew Waters
2026f60879 [862/906] window: remove set_need_lock
No-one is using it.  The only code that did was the x11 one which
doesn't need it anymore.
2017-12-09 19:31:33 +00:00
Julien Isorce
ab5a3e310d [823/906] wayland_egl: make the wayland backend actually work on Raspberry Pi
Fix resizing and can now move the window
2017-12-09 19:31:31 +00:00
Matthew Waters
3b1ec77cf8 [818/906] window: add send_message_async vmethod
- provide a default synchronous send_message
- make context creation threadsafe again
2017-12-09 19:31:31 +00:00
Matthew Waters
b8b9fced19 [796/906] move egl into its own directory 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
Matthew Waters
175f28848c [792/906] build: use our own in tree headers before system ones
allows us to develop against the tree rather than what may be installed
2017-12-09 19:31:30 +00:00
Matthew Waters
d492036322 [765/906] wayland: remove fullscreen 2017-12-09 19:31:30 +00:00
Sebastian Dröge
b2934152ce [752/906] glwindow: Add destroy notifies for the data of the callbacks
And actually call the close callback when the window is closed.
2017-12-09 19:31:29 +00:00
Sebastian Dröge
d937a7e899 [741/906] wayland: Don't leak main context and loop 2017-12-09 19:31:29 +00:00
Sebastian Dröge
f7998a2e98 [733/906] gl: Major header and include cleanup 2017-12-09 19:31:29 +00:00
Sebastian Dröge
92c66f55bc [727/906] egl: Refactor EGL logic into a helper object 2017-12-09 19:31:29 +00:00
Matthew Waters
17e4fe41d3 [724/906] wayland: make reentrant
https://bugzilla.gnome.org/show_bug.cgi?id=703445
2017-12-09 19:31:29 +00:00
Matthew Waters
bc5d65928f [716/906] wayland: properly choose EGL_RENDERABLE_TYPE
based on the gl api we chose
2017-12-09 19:31:28 +00:00
Matthew Waters
ef6b1ca760 [712/906] wayland: shutdown properly
We cannot use _finalize as this will be called before GstGLWindow's
_finalize.  This causes us to try and perform operations with the
wayland server when the connection has been severed.
2017-12-09 19:31:28 +00:00
Matthew Waters
380f918802 [711/906] wayland: support choosing Desktop GL as the api 2017-12-09 19:31:28 +00:00
Matthew Waters
06eb6f4965 [695/906] build: remove libtool warning about -version-info not used in convenience libraries 2017-12-09 19:31:28 +00:00
Matthew Waters
7d4d1f50d4 [669/906] window: seperate object creation and context creation 2017-12-09 19:31:27 +00:00
Matthew Waters
4a886e91e4 [639/906] add get_proc_address implementations for egl and glx 2017-12-09 19:31:26 +00:00
Matthew Waters
68b4ddff12 [634/906] wayland egl: deactivate context before we destroy it
avoids a segfault with dri drivers
2017-12-09 19:31:26 +00:00
Matthew Waters
c3526080aa [629/906] window: add GError for error handling of context creation 2017-12-09 19:31:26 +00:00
Matthew Waters
ee992ec531 [623/906] move GL includes into a single file 2017-12-09 19:31:26 +00:00
Matthew Waters
0be301af24 [621/906] GstGLRendererAPI => GstGLAPI and get GstGLAPI from a window 2017-12-09 19:31:26 +00:00
Matthew Waters
e1ec48b6cf [620/906] wayland_egl: attempt at resizing the video 2017-12-09 19:31:26 +00:00
Matthew Waters
ccabf4545a [618/906] add wayland-egl window backend 2017-12-09 19:31:26 +00:00