Commit graph

1798 commits

Author SHA1 Message Date
Matthew Waters
d63add22d2 gl/overlaycompositor: don't force unpremultiplied alpha
Remove testing code from 2315936561
2018-10-04 23:24:15 +10:00
Matthew Waters
2315936561 gl/overlaycompositor: support both (un)premultiplied alpha
Using the correct blend modes for each case or converting to
premultipled in the very unlikely case that separate blend modes are
unavailable on ancient opengl hardware.
2018-10-04 23:04:07 +10:00
Sebastian Dröge
5a3666395e gl: GstGLAPI should be gst_gl_api_ in lower-case 2018-10-04 14:50:43 +03:00
Sebastian Dröge
ee98f056b1 glviewconvert: Add backwards compatibility gst_gl_stereo_downmix_mode_get_type()
It's proper new name is gst_gl_stereo_downmix_get_type().
2018-10-04 13:38:59 +03:00
Sebastian Dröge
62197270dd gl: Add gl-enumtypes.[ch] to CLEANFILES 2018-10-04 13:33:30 +03:00
Matthew Waters
e9c519e5f3 gl/overlaycompositor: add support for flipping the output
This is required to use gloverlaycompositor outside of glimagesink where
the output is not automatically flipped
2018-10-04 14:28:35 +10:00
Matthew Waters
1359d0995e gl/overlaycompositor: handle ANY caps features gracefully 2018-10-04 14:28:35 +10:00
Matthew Waters
0086dfcf7f glfilter: don't complete overwrite caps features from the subclass
We can get away with ensuring that the memory:GLMemory caps feature is
present in the output caps
2018-10-04 14:28:35 +10:00
Sebastian Dröge
919083d082 gl: Add gl-enumtypes.h to nodist_HEADERS 2018-10-03 23:27:32 +03:00
Sebastian Dröge
2b0298d847 glviewconvert: Create an anonymous enum for GstGLStereoDownmix
Older glib-mkenums completely fails to parse it otherwise.
2018-10-03 23:17:56 +03:00
Sebastian Dröge
2b4dfb9941 gl: Generate enum GTypes via glib-mkenums
https://bugzilla.gnome.org/show_bug.cgi?id=797240
https://bugzilla.gnome.org/show_bug.cgi?id=797144
2018-10-03 13:13:24 +03:00
Sebastian Dröge
48e1c8e12d glsl: Fix error quark string to be more consistent 2018-10-02 21:01:31 +03:00
Sebastian Dröge
fdacdf502b glbasememory: Fix error quark string and move documentation to the right place 2018-10-02 20:59:25 +03:00
Matthew Waters
2c44c5fb40 glviewconvert: wait and set the gl sync meta on buffers
This may be a cause of out-of-place frames when transforming multiview
buffers.
2018-09-26 13:44:48 +10:00
Sebastian Dröge
4d534ad8e8 glviewconvert: Copy composition meta from the primary buffer to both outputs
Without this, glviewconvert (and thus glimagesink) will drop all overlay
composition metas.
2018-09-25 17:01:15 +03:00
Sebastian Dröge
64774ece0c glcolorconvert: Don't copy overlay composition meta over to NULL outbufs 2018-09-25 17:01:15 +03:00
Tim-Philipp Müller
dc29bc4e13 libs: fix API export/import and 'inconsistent linkage' on MSVC
For each lib we build export its own API in headers when we're
building it, otherwise import the API from the headers.

This fixes linker warnings on Windows when building with MSVC.

The problem was that we had defined all GST_*_API decorators
unconditionally to GST_EXPORT. This was intentional and only
supposed to be temporary, but caused linker warnings because
we tell the linker that we want to export all symbols even
those from externall DLLs, and when the linker notices that
they were in external DLLS and not present locally it warns.

What we need to do when building each library is: export
the library's own symbols and import all other symbols. To
this end we define e.g. BUILDING_GST_FOO and then we define
the GST_FOO_API decorator either to export or to import
symbols depending on whether BUILDING_GST_FOO is set or not.
That way external users of each library API automatically
get the import.

While we're at it, add new GST_API_EXPORT in config.h and use
that for GST_*_API decorators instead of GST_EXPORT.

The right export define depends on the toolchain and whether
we're using -fvisibility=hidden or not, so it's better to set it
to the right thing directly than hard-coding a compiler whitelist
in the public header.

We put the export define into config.h instead of passing it via the
command line to the compiler because it might contain spaces and brackets
and in the autotools scenario we'd have to pass that through multiple
layers of plumbing and Makefile/shell escaping and we're just not going
to be *that* lucky.

The export define is only used if we're compiling our lib, not by external
users of the lib headers, so it's not a problem to put it into config.h

Also, this means all .c files of libs need to include config.h
to get the export marker defined, so fix up a few that didn't
include config.h.

This commit depends on a common submodule commit that makes gst-glib-gen.mak
add an #include "config.h" to generated enum/marshal .c files for the
autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=797185
2018-09-24 08:45:34 +01:00
Sebastian Dröge
cde4cfe384 gl/win32: Use g_io_channel_win32_new_messages() instead of our custom GSource
Removes some unneeded code duplication between here and GLib.

https://bugzilla.gnome.org/show_bug.cgi?id=797184
2018-09-21 11:57:01 +03:00
Víctor Manuel Jáquez Leal
982b212485 gl/egl: fix annotation for gst_egl_image_new_wrapped()
https://bugzilla.gnome.org/show_bug.cgi?id=797158
2018-09-18 11:37:39 +02:00
Víctor Manuel Jáquez Leal
e12a55a4ea gl: meson: add missing headers for gir generations
There are a lot of symbols in GstGL-1.0.gir generated by automake that
are not when it is generated by meson, because a lot of headers were
not included in meson's gir generation.

https://bugzilla.gnome.org/show_bug.cgi?id=797158
2018-09-18 11:37:39 +02:00
Matthew Waters
5765641729 gl/build: don't pass OpenGL headers to GIR
g-ir-scanner does not have a good enough C parser to parse the GL system
headers
2018-09-18 11:13:27 +10:00
Matthew Waters
333566c53e glshader: macro out all the extremely similar uniform setting 2018-09-18 11:13:27 +10:00
Víctor Manuel Jáquez Leal
fae3f7cb56 glviewconvert: fix GEnumValue declaration
The purpose of value_name in GEnumValue structure is to express in
text format the name of the enum, not a description of the value, so
it can be use later for the gir file generation.

https://bugzilla.gnome.org/show_bug.cgi?id=797144
2018-09-14 17:43:04 +02:00
Nicolas Dufresne
bccc69fadb Revert "glmemory: Fix n_wrapped_pointers usage"
This reverts commit b1299c179b.
2018-09-13 20:02:43 -04:00
Nicolas Dufresne
ffcab084d5 Revert "glupload: allow system memory for dmabuf in transform_caps"
This reverts commit d7eb48cce7.
2018-09-13 20:02:41 -04:00
Nicolas Dufresne
da30327b94 Revert "glupload: handle upload methods with different caps"
This reverts commit 87336b1957.
2018-09-13 20:02:40 -04:00
Nicolas Dufresne
4a72dada3a Revert "gl/egl: Add gst_egl_image_from_dmabuf_direct() function"
This reverts commit 8f0d75d4d6.
2018-09-13 20:02:39 -04:00
Nicolas Dufresne
7b48561b8a Revert "glupload: Implement direct dmabuf uploader"
This reverts commit 3b1ae6262b.
2018-09-13 20:02:38 -04:00
Nicolas Dufresne
25df27698f Revert "glupload: try to use the last method after reconfigure"
This reverts commit c1053e17d5.
2018-09-13 20:02:37 -04:00
Michael Olbrich
c1053e17d5 glupload: try to use the last method after reconfigure
Reconfigure will trigger a set_caps which clears the upload method.
Remember the method in this case and start with it.
Wrap around once to try all methods if necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Michael Olbrich
3b1ae6262b glupload: Implement direct dmabuf uploader
The idea is that some GPUs (like the Vivante series) can actually
perform the YUV->RGB conversion internally, so no custom conversion
shaders are needed. To make use of this feature, we need an additional
uploader that can import DMABUF FDs and also directly pass the pixel
format, relying on the GPU to do the conversion.

Based on patches from Nicolas Dufresne <nicolas.dufresne@collabora.com> and
Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Nicolas Dufresne
8f0d75d4d6 gl/egl: Add gst_egl_image_from_dmabuf_direct() function
The colorspace conversion happens during the upload so the necessary hints
must be provided to ensure that the conversion works correctly.

At least the Mesa Intel driver will create a texture without error but
produces an incorrect result. Use eglQueryDmaBufModifiersEXT() to check if
non-external upload is supported for the given format.

Based on a patch from Carlos Rafael Giani <dv@pseudoterminal.org>.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:29:10 -04:00
Michael Olbrich
87336b1957 glupload: handle upload methods with different caps
If a upload method is selected then use it exclusively in transform_caps().
Also, reconfigure if the current caps don't match the current upload
method.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:03:03 -04:00
Michael Olbrich
d7eb48cce7 glupload: allow system memory for dmabuf in transform_caps
This should not be necessary, but currently not all plugins that provide
dmabuf memory announce this with caps features, e.g. v4l2.
The static caps already contain the system memory. It didn't break before
because other upload methods provide the necessary transformation.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:03:03 -04:00
Nicolas Dufresne
b1299c179b glmemory: Fix n_wrapped_pointers usage
gst_gl_memory_setup_buffer() was not properly using the number
of pointers to wrapped. This also fixes the validation, as we
only support 1 wrapper per view, or num_planes * views wrapper.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-09-10 23:02:46 -04:00
Matthew Waters
22f6ff094a gl/meson: check for EGL headers before allowing use of EGL
For distros that provide headers in seperate dev/devel packages this
won't build egl support without the necessary EGL headers.
2018-09-05 18:34:06 +10:00
Nirbheek Chauhan
a9cab426d0 meson: Maintain macOS ABI through dylib versioning
Requires Meson 0.48, but the feature will be ignored on older versions
so it's safe to add it without bumping the requirement.

Documentation:
https://github.com/mesonbuild/meson/blob/master/docs/markdown/Reference-manual.md#shared_library
2018-08-31 14:40:43 +05:30
Matthew Waters
0c85af51d8 gl/meson: fix gbm option to enable rather than disable
This change matches what the other winsys/platforms are doing
2018-08-31 18:14:13 +10:00
Matthew Waters
dddd2e4a07 gl/meson: add Android build definitions 2018-08-31 18:09:53 +10:00
Matthew Waters
43f0b75e55 gl/meson: add build for iOS 2018-08-31 12:23:40 +10:00
Nicolas Dufresne
63e602c63e doc: glbasefilter: Add missing Since for gst_gl_base_filter_find_gl_context() 2018-08-29 10:38:32 -04:00
Nirbheek Chauhan
12236671c7 meson: Always define gstgl_dep to a valid dependency object
Fixes configure error when gl support was auto-detected as not being
available:

ext/gl/meson.build:50:20: ERROR:  Unknown variable "gstgl_dep".
2018-08-28 13:43:36 +05:30
Yuji Kuwabara
c537b2e2bb gl/dispmanx: fix removing foreign window handle
gst_gl_window_dispmanx_egl_set_window_handle() removes native window handle
(dispmanx element), regardless it was foreign window handle
(set via gst_video_overlay_set_window_handle()) or not.

This problem prevents glimagesink reusable.
(PAUSED -> READY -> PAUSED does not work)

This patch corrects it comparing the native window handle with foreign window
handle. This behavior is same as gst_gl_window_dispmanx_egl_close().

https://bugzilla.gnome.org/show_bug.cgi?id=785199
2018-08-28 14:54:40 +10:00
Matthew Waters
090bbd0721 gl/wayland: correctly use the set_render_rectangle size first
https://bugzilla.gnome.org/show_bug.cgi?id=789384
2018-08-28 14:31:43 +10:00
memeka
08ebb8264d gl/wayland: add preferred window size, and set it according to video size
The glimagesink wayland backend lacks the implementation of
gst_gl_window_wayland_egl_set_preferred_size. Because of this, glimagesink windows on
wayland are created with a fixed window size of 320x240.

[Matthew Waters]: gst-indent sources

https://bugzilla.gnome.org/show_bug.cgi?id=789384
2018-08-28 14:30:19 +10:00
Tim-Philipp Müller
4fe65c1633 gl: use right export decorator 2018-08-26 11:16:18 +02:00
Tim-Philipp Müller
f1272e547d meson: gl: return not-found dependency instead of disabler if opengl is disabled
This allows consumers of the gstgl dependency where gstgl is optional
to do things like:

  config_data.set('HAVE_GST_GL', gstgl_dep.found())
  deps = [gstvideo_dep, gstgl_dep]

meaning they can still use the dep unconditionally. With the
disabler we would just disable the whole target even if the
gstgl part was an optional extra. We can add an option to
dependency() later to let users/consumers of the dep decide
if they want a not-found dependency or a disabler instead.
2018-08-18 12:37:48 +01:00
Nirbheek Chauhan
b5aa5fa308 meson: host_system is 'ios' when building for iOS
The cross file sets this value, and we use 'ios' in Cerbero.
2018-08-17 04:14:15 +05:30
Tim-Philipp Müller
73828a1a5c meson: move gmodule check to top-level
It's also needed by the generic/states test and the variable
is currently checked as part of the opengl lib tests so wouldn't
be available if opengl was disabled.
2018-08-16 10:58:47 +01:00
Tim-Philipp Müller
4ec1ba433d meson: add option for opengl and the misc optional gl plugin deps
Finer control over the opengl integration library dependencies
is already implemented via the gl_api, gl_platform, and gl_winsys
options.

https://bugzilla.gnome.org/show_bug.cgi?id=796947
2018-08-16 10:56:58 +01:00