Commit graph

1869 commits

Author SHA1 Message Date
Fernando Herrrera
80547d9437 wayland: set the event queue also for the xdg_wm_base object 2019-06-05 13:27:56 +01:00
Niels De Graef
93daa1435a Use G_DEFINE_AUTOPTR_CLEANUP_FUNC unconditionally
Since we started depending on GLib 2.44, we can be sure this macro is
defined (it will be a no-op on compilers that don't support it). For
plugins we should just start using `G_DECLARE_FINAL_TYPE` which means we
no longer need the macro there, but for most types in base/gst-libs we
don't want to break ABI, which means it's better to just keep it like it
is (and use the `#ifdef` instead).
2019-06-04 20:31:09 -04:00
Matthew Waters
51f2d05ff6 gl/docs: add to new docs system 2019-05-21 01:49:48 +00:00
Guillaume Desmottes
d90ac65af1 gloverlaycompositor: fix crash if buffer doesn't have video meta
Fix #501
2019-05-14 17:12:06 +00:00
Thibault Saunier
287897e465 doc: Fix some gtk-doc comments 2019-05-13 11:34:08 -04:00
Matthew Waters
15cb86435d glshader: fix default external-oes shaders
In glsl, #extension directives need to before other non-preprocesser
directives.  We were placing the precision qualifier before that.  Fix
by moving the #extension to the first line in the shader.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/601
2019-05-07 18:43:49 +10:00
Niels De Graef
e8450397c0 gl/wayland: Don't prefix wl_shell struct field
As part of commit 808e7127, we prefixed the `GstWlWindow`'s `shell`
field with wl_, to differentiate it from the other types of shells a
Wayland compositor might support. However, this is apparently a struct
that we expose to our users, so changing it means we have an API break.

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/592
2019-04-24 09:03:44 +00:00
Sebastian Dröge
5f19e83f14 eglimage: Add compatibility define for DRM_FORMAT_NV24 2019-04-23 14:12:17 +00:00
Sebastian Dröge
1837fc46af gl: Add various missing Since: 1.16 markers
And add some missing function documentation.
2019-04-23 12:28:26 +00:00
Michael Tretter
9c2379e00a glupload: prevent segfault when updating caps
When the glupload element renegotiates the caps, set_caps will reset the
method_impl to NULL, but the method will be kept. transform_caps tries
to use the method_impl to transform the caps, because a method is set,
but will segfault.
2019-04-12 12:05:22 +02:00
Tim-Philipp Müller
2f9db671cb gl: suppress some g-i warnings
gst_gl_memory_setup_buffer() was marked as introspectable=0
anyway, so might just as well mark it as '(skip)' and suppress
the warning. Reason is the (element-type gpointer) on wrapped_data.

gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation
gstglmemory.c:1426: Warning: GstGL: gst_gl_memory_setup_buffer: argument wrapped_data: Missing (element-type) annotation

egl/gstegl.h:40: Warning: GstGL: symbol='EGL_EGLEXT_PROTOTYPES': Unknown namespace for symbol 'EGL_EGLEXT_PROTOTYPES'
2019-03-24 16:05:09 +00:00
Tim-Philipp Müller
bb48e326ac meson: gl: don't pass generated xdg shell header and source file to g-i
They're private, g-i doesn't need to know about them.
Avoids lots of spammy g-i warnings.
2019-03-23 21:51:37 +00:00
Haihao Xiang
f0cbb78770 glimagesink: add support for VUYA format 2019-03-21 23:05:09 +00:00
Roman Shpuntov
31cb8500ee macOS gst-plugins-base/gl/cocoa: UI API called on a background thread: -[NSView removeFromSuperview]
The problem inside gstglwindow_cocoa.m, all UI operations must be called from main UI thread.

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/568
Fixes #568
2019-03-20 18:44:12 +07:00
Nirbheek Chauhan
045137d340 glwindow/win32: Don't use condition variables for message synchronization
Using a single condition variable for synchronization across all GL
messages is very slow on Windows and uses up to 20% CPU usage in some
workloads due to lock contention and false broadcasts.

Using per-message event handles reduces the CPU usage to negligible
amounts despite having to allocate a new event handle for each
message.
2019-03-12 03:21:57 +00:00
Nirbheek Chauhan
36ec18c230 glmemory: Disable GL timing queries when debugging
This can be very expensive in some workloads, taking up to 11% of the
total execution time.
2019-03-12 03:21:57 +00:00
Nirbheek Chauhan
21bc1040d4 glframebuffer: Don't do expensive checks with low gst debug levels
Framebuffer checks can be very expensive, taking up to 3-5% of the
total CPU consumed by the application.
2019-03-12 03:21:57 +00:00
Lucas Stach
c71dd72b21 gl/wayland: fix glib mainloop integration
Implement the prepare and check functions according to the
documentation by returning TRUE when events should be dispatched
via the dispatch function.

As wl_display_read_events never blocks we can call it unconditionally
without looking at the poll status.

This simplifies the implementation and gets rid of a race where the
mainloop could get blocked due to nobody actually reading the events
from the wayland connection.
2019-03-11 13:54:16 +01:00
Matthew Waters
6a37bf9bb9 gl: Don't restore the viewport on function exit
Doing so involves retrieving the current viewport from OpenGL which as
with any glGet operation, is expensive.

This means that the various sinks need to reset the viewport on draw.

In the process, fix resizing on cocoa.
2019-03-08 17:49:05 +11:00
Matthew Waters
4e13980e10 gl: fix a few other leaks when not getting to PAUSED 2019-03-07 02:01:09 +11:00
Matthew Waters
86aa568383 glcolorconvert: Ensure we free the internal convert object
If we only ever make it to READY, transform_caps can create an
internal convert object that will never be freed by basetransform's
stop vmethod (PAUSED->READY).
2019-03-06 23:32:18 +11:00
Tim-Philipp Müller
d58b7cf75c gl: .gitignore generated wayland xdg shell files 2019-03-06 10:49:48 +00:00
Matthew Waters
13fc711eca gloverlaycompositor: Also free the texcoord GL buffer
Fix a typo that was attempting to free the position GL buffer twice
(without any consequences as there was a if (buffer) check)

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/561
2019-03-06 01:08:04 +00:00
Matthew Waters
55bcdcf01a gl: actually use the highp specifier
675415bf2e contained a typo that incorrectly
used the mediump specifier instead of highp.
2019-02-28 23:39:21 +11:00
Matthew Waters
675415bf2e gl: try to use highp precision where supported
The use of mediump as a specifier in GLSL shaders will have limited
resolution and when used as texture coordinates may become inaccurate
over texture sizes of 1024.
2019-02-28 17:26:32 +11:00
Tim-Philipp Müller
0cdb3aa9b3 gl: eglimage: fix build on RPi by adding more fallback defines for EGL_*_EXT 2019-02-18 13:52:43 +00:00
Edward Hervey
dc2bc38b1e wayland: Also dist the private header 2019-02-13 11:59:10 +01:00
Nicolas Dufresne
77d7cfea10 eglimage: Add some more defines
This allow building on advertised version of libdrm drm_fourcc.h files.

Fixes #549
2019-02-11 10:01:55 -05:00
Nicolas Dufresne
837173c0f0 Revert "fix issue"
This reverts commit 5e0c458e0e.
2019-02-11 10:01:50 -05:00
yanle.zhang
5e0c458e0e fix issue
549."https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/549".
2019-02-11 16:13:15 +08:00
Seungha Yang
3152cbb46e glupload: Don't leak caps features
Create caps features when it is required.
2019-02-08 21:43:43 +09:00
Niels De Graef
17899dc9b6 gl/wayland: add support for XDG-shell
[wl_shell] is officially [deprecated], so provide support for the
XDG-shell protocol should be provided by all desktop-like compositors.
(In case they don't, we can of course fall back to wl_shell).

Note that the [XML spec] is provided by the `wayland-protocols`
git repository, which is provided by the Wayland project.

[wl_shell]: https://people.freedesktop.org/~whot/wayland-doxygen/wayland/Client/group__iface__wl__shell.html
[deprecated]: 698dde1958
[XML spec]: https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml
2019-02-06 22:45:28 +00:00
Niels De Graef
b52cf2f7d1 gl/wayland: extract code to create wl_shell_surface
This is just a cosmetic change that will make it easier to differentiate
between wl_shell and xdg_wm_base later.
2019-02-06 22:45:28 +00:00
Niels De Graef
808e712767 gl/wayland: prefix shell(_surface) with wl_
This will help us make the distinction later with xdg-shell and other
possible protocols that need to be supported.
2019-02-06 22:45:28 +00:00
Tim-Philipp Müller
6330eb0cb3 meson: opengl: fix enabled_gl_apis in pkg-config file
Make consistent with what autotools puts into enabled_gl_apis
variable. Autotools puts 'gl' in there instead of 'opengl'.

This would cause problems when building -bad glmixers plugin
in meson against a -base that was built with autotools.

See https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/871
2019-01-22 13:35:38 +00:00
Haihao Xiang
7874c74cfb gstglwindow_x11: require a resize event at once after XResizeWindow
Otherwise surface_width/surface_height stored in GstGLWindowPrivate
isn't changed, sometimes an unnecessary reconfigure event is sent on
sinkpad, then result in upstream reconfiguring.

Example pipeline:

gst-launch-1.0 videotestsrc ! msdkvpp ! glimagesink
2019-01-21 01:27:15 +00:00
Sebastian Dröge
acc098a736 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:09:18 +02:00
Seungha Yang
e48b8033e3 gl: Fix some type conversion warnings with MSVC
MSVC complained about implicit conversion between GstGLFormat* and guint*
2019-01-14 01:48:34 +00:00
Niels De Graef
3ce6bf65c7 gl/wayland: destroy wl_shell instance at finalize 2018-12-14 14:15:59 +01:00
Justin Kim
c961dc9f8f gl/meson: Add OpenGL dependency by OSX way
Otherwise, it fails to link with the message below:

```
ld: can't map file, errno=22 file '...'
```
https://gitlab.freedesktop.org/gstreamer/gst-build/issues/13
2018-12-14 12:02:36 +09:00
Philipp Zabel
18c9babef9 glupload: dmabuf: use out_info to create allocation params for non-direct dmabuf uploads as well
Non-direct dmabuf uploads, just as direct dmabuf uploads, create EGL
images and thus GL textures of the same width as the imported image.
The input dmabuf line stride is not relevant to the resulting texture
in both cases.

This fixes the case where non-direct uploads of input dmabufs with line
stride larger than the width will for example cause glcolorconvert to
sample only the left part (width * bytes per pixel / stride) of the
image, causing a horizontally stretched and cropped output image.
2018-12-13 15:52:13 +01:00
Matthew Waters
cfae8bd6c1 glmemory: normalize the internal format we pass into glTex* functions
Passing unsized formats sometimes breaks on embedded platforms

Take 2 at 694e30f858,
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/49
2018-12-13 00:10:10 +11:00
Matthew Waters
56ff61eac4 Revert "glformat: return sized formats in from_video_info"
This broke videotestsrc ! video/x-raw,format=NV12 ! glimagesink on
the desktop

Reverts: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/merge_requests/49
This reverts commit 694e30f858.
2018-12-13 00:09:59 +11:00
Nicolas Dufresne
f7d5dff921 gl: window-gbm: Restore CRTC on close
This simply try and restore the state of the CRTC when the window
is closed. This is a bit cosmetic, but it allow resuming fbcon
when we exit.
2018-12-05 13:41:11 +00:00
Nicolas Dufresne
46b503d674 gl: window-gbm: Remove unused private class member
The display class member is not used, not set and rather
confusing.
2018-12-05 13:41:11 +00:00
Nicolas Dufresne
6f7fbbfa71 gl: window-gbm: Remove unneeded extra function
The cleanup function was only called in _close() which was only
calling that function. This indirection didn't make much sense.
2018-12-05 13:41:11 +00:00
Carlos Rafael Giani
08ea7d676e gl/gbm: Add GST_GL_GBM_DRM_CONNECTOR environment variable
If multiple DRM connectors are connected, currently the first one is
picked. Improve this by adding an environment variable that allows for
choosing a connector by name. The connector name has been made so they
are compatible with modetest/modeprint DRM utilities.

Related to #490
2018-12-01 13:44:26 -05:00
Carlos Rafael Giani
3663ad787d gl/gbm: Improve logging output
* List all connectors, modes, and encoders, even after picking one
* Add missing DRM_MODE_CONNECTOR_DPI string for logging and improve
  existing strings
* Make sure the names matches modetest/modeprint from DRM utilities

Related to #490
2018-12-01 13:36:17 -05:00
Matthew Waters
694e30f858 glformat: return sized formats in from_video_info
Fixes green output on e.g. Android when converting between YUV->RGBA
2018-11-30 18:05:58 +11:00
Matthew Waters
9bd8da6ed4 gl/meson: Allow for the use of libGL as well as OpenGL
OpenGL.framework and libGL are two different providers of a GL
implementation that can be linked into an application together.
2018-11-29 04:53:50 +00:00