Commit graph

1859 commits

Author SHA1 Message Date
Nicolas Dufresne
c8c7672ffb glupload: Do prepend the preferred caps
The direct dmabuf upload does color conversion, so when it transforms
the caps, it replaces the format with all formats found through the
format query. When this uploader can't be used, it makes the upstream
source pick a unsupported format.

To fix this, we only append the caps with a list of format. So the
source will only pick one of these formats if the downstream preferred
format is not supported. A negotiation failure after this would be
normal.

This fixes pipelines without a glcolorconvert element.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-11-01 06:22:28 -04:00
Philipp Zabel
3c8ac7de80 glupload: dmabuf-direct: report driver limitations to debug log
Report in the DEBUG log if the driver does not support importing a given
format with linear modifiers non-externally.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel
eb20293a02 glupload: dmabuf-direct: query formats before modifiers
The EXT_image_dma_buf_import_modifiers extension [1] states regarding
eglQueryDmaBufModifiersEXT:

    The format must be one of those returned by the
    eglQueryDmaBufFormatsEXT command.

To comply with this requirement eglQueryDmaBufFormatsEXT must be called
before eglQueryDmaBufModifiersEXT.

[1] https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_image_dma_buf_import_modifiers.txt

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel
c4edd80c8c glupload: debug output from dmabuf and dmabuf_direct upload transform_caps
https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Philipp Zabel
58399b20bd glupload: calculate DRM fourcc once for direct dmabuf upload
Calculate DRM fourcc and report to the DEBUG log about it only once
instead of three times in gst_egl_image_from_dmabuf_direct().

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-10-30 12:25:08 +01:00
Michael Olbrich
507e31dfc0 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-10-30 12:25:08 +01:00
Michael Olbrich
f349cdccf5 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-10-30 12:25:08 +01:00
Michael Olbrich
f3292dc156 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-10-30 12:25:08 +01:00
Michael Olbrich
4d9abc6bed 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-10-30 12:25:07 +01:00
Michael Olbrich
5d0e191710 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-10-30 12:25:02 +01:00
Nicolas Dufresne
0ac646f7f4 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-10-30 10:47:01 +01:00
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
Tim-Philipp Müller
ca15315565 gst-libs: include config.h in all source files
This will be needed later when we get our export define from config.h
2018-08-13 09:23:34 +01:00
Matthew Waters
91bc6f63f6 glviewconvert: fix output when a transformation matrix is used
If we have a transformation matrix, we have no idea where in the output
the video is going to endup.  It might also be different and not cover
the entire output.

We need to clear the output to remove any previous data in the backing
texture.

Found from
https://stackoverflow.com/questions/51707229/python-gstreamer-for-dynamic-control-of-element-properties
2018-08-10 22:46:34 +10:00
Matthew Waters
3d22e7d9da gl/meson: fix macos additions for non-macos platforms
"gst-libs/gst/gl/meson.build:655:20: ERROR:  Unknown variable "quartzcore_dep"."
2018-08-03 19:06:00 +10:00
Alessandro Decina
06b8792a5f gl/meson: OSX support (CGL and Cocoa)
[Matthew Waters]: minor additions such as -fobjc-arc and relying on
dependency rather than cc.find_library()
2018-08-03 12:53:10 +10:00
Norbert Wesp
574607702b Add GBM_CFLAGS and define EGL_PLATFORM_GBM_MESA
Building an image with yocto for an 'am335x' processor will fail,
because 'gbm.h' can not be found and 'EGL_PLATFORM_GBM_MESA' is not defined.

So simply adding define of 'EGL_PLATFORM_GBM_MESA' in 'gstgldisplay_egl.c'
and adding 'GBM_CFLAGS' in 'gst-gl.m4' to get rid of this errors and complete
a full build process.

ERRORs were:
-----------
gst-plugins-base-1.14.1/gst-libs/gst/gl/gbm/gstglwindow_gbm_egl.h:24:10:
fatal error: gbm.h: No such file or directory
  #include <gbm.h>
           ^~~~~~~

gst-plugins-base-1.14.1/gst-libs/gst/gl/egl/gstgldisplay_egl.c:157:39:
error: 'EGL_PLATFORM_GBM_MESA' undeclared (first use in this function);
did you mean 'EGL_PLATFORM_WAYLAND'?
  ret = _gst_eglGetPlatformDisplay (EGL_PLATFORM_GBM_MESA, (gpointer) display,
                                    ^~~~~~~~~~~~~~~~~~~~~

https://bugzilla.gnome.org/show_bug.cgi?id=796885
2018-08-02 12:17:56 +10:00
freyr
810d560a2f gl/gbm: allow headless mode
Don't require an output for the GBM backend.

https://bugzilla.gnome.org/show_bug.cgi?id=794716
2018-08-01 14:50:10 +10:00
Nicolas Dufresne
63cf6b4203 glupload: Only offer DMABuf caps feature if using EGL
This was miss-leading VAAPI which was not forcing linear back buffers,
would still export DMABuf. That caused bad rendering as the buffers are
tiled and most likely compressed.

https://bugzilla.gnome.org/show_bug.cgi?id=796822
2018-07-18 09:04:35 -04:00
Iñigo Huguet
48a0178857 gl/build: fixed failed compilation due to missing EGLuint64KHR typedef
[Matthew Waters]: add meson differences

https://bugzilla.gnome.org/show_bug.cgi?id=796820
2018-07-18 14:02:01 +10:00
Nicolas Dufresne
ae5120a489 Revert "glupload: Only offer DMABuf caps feature if using EGL"
This reverts commit bc9afe7243.
2018-07-17 11:51:49 -04:00
Nicolas Dufresne
bc9afe7243 glupload: Only offer DMABuf caps feature if using EGL
This was miss-leading VAAPI which was not forcing linear back buffers,
would still export DMABuf. That caused bad rendering as the buffers are
tiled and most likely compressed.
2018-07-17 11:43:40 -04:00
Matthew Waters
16cba63d43 gl/utils: fixup matrix math again for column major
e4bf9ed8f0 was not quite right and changed
the wrong thing. Intead we needed to change the multiplication order
and should have kept the previous to/from matrices as is done in this
patch.
2018-07-10 20:13:22 +10:00
memeka
1c8bf44dea gl: check for EGL_KHR_platform_gbm for non-MESA gbm implementations
https://bugzilla.gnome.org/show_bug.cgi?id=796694
2018-06-28 23:53:56 +10:00
Tim-Philipp Müller
71734b33aa gl: fix build on iOS 2018-06-24 13:35:20 +02:00
Tim-Philipp Müller
4093e4c237 gl: fix build on Windows 2018-06-24 13:19:21 +02:00
Tim-Philipp Müller
d736bfc855 gl: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:58:44 +02:00
Matthew Waters
76f99f803b glcontextegl: only dump configs once 2018-06-22 22:43:08 +10:00
Matthew Waters
d6ae44b1d0 glcontextegl: Fix android build without ES3 tokens 2018-06-22 22:42:45 +10:00
Matthew Waters
c850faff95 glcontextegl: dump the list of EGLConfig's available 2018-06-21 17:46:57 +10:00
Matthew Waters
cfa5d64ff1 gl: use dependency fallbacks to get at a possible gl-headers subproject
We would make the subproject conditional on the wrap-mode=nodownload
however get_option('wrap-mode') or similar is not available from
meson.build files as the wrap-mode is meant to be used automatically.

Instead use the dependency fallback mechanism to get at the subproject
where possible i.e. when downloading is allows and only add the compat
includes when we have a valid internal dependency from the gl-headers
subproject.

https://bugzilla.gnome.org/show_bug.cgi?id=796534
2018-06-19 12:21:48 +10:00
Tim-Philipp Müller
5ad841e5ff Revert "gl/meson: add support for using bundled headers in a subproject"
This reverts commit 82c43ff9a3.

Reverting for the time being, since it trips up build bots
that don't have network connectivity.

We ideally shouldn't have a subproject that's used unconditionally.
2018-06-07 17:42:35 +01:00
Matthew Waters
82c43ff9a3 gl/meson: add support for using bundled headers in a subproject
This is most useful when building on windows which does not ship the
necessary OpenGL headers.
2018-06-07 14:15:30 +10:00
Matthew Waters
1ceccb5b58 gl/meson: force the gl dependency to use pkg-config
Meson has an internal override for dependency('gl') which we do not want
to use as it assumes too many things.  Force meson to only search for
gl.pc.
2018-06-06 23:36:08 +10:00
Matthew Waters
8596f5a5b4 gl/meson: don't define GST_EXPORTS
The intended use (msvc) doesn't currently like it and will fail to
resolve symbols at runtime.
2018-06-06 23:36:08 +10:00
Matthew Waters
e4bf9ed8f0 gl/utils: Fix NDC conversion matrices for column-majorness
The matrices were converting the wrong values with non-diagonal-only matrices.
e.g. a typical yflip matrix in [-1,1]^3 such as
 1  0  0  0
 0 -1  0  0
 0  0  1  0
 0  0  0  1

Would have actually required a matrix like this in [0,1]^3
 1  0  0  0
 0 -1  0  0
 0  0  1  0
 0 -2  0  1

Which is
1. not consistent with our multiplication convention and would require
   transposing matrices or changing our multiplication order (from what is
   generally used on opengl matrix guides/tutorials).
2. Produces incorrect values when input with actual vertices accounting for
   the difference in multiplication order.  e.g. some vertices multiplied by
   the yflip matrix using vertex * yflip(== transpose(yflip) * vertex):

     vertex:       -> result:           expected:
     vec4(1,0,1,1) -> vec4(1,-2,1,1)    vec4(1,1,1,1)
     vec4(1,1,1,1) -> vec4(1,-3,1,1)    vec4(1,0,1,1)

With the updated values, we now get the expected values.

Includes a test for this behaviour and the example above
2018-06-06 23:36:08 +10:00
Antoine Jacoutot
64585f88cd libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-22 07:01:42 +02:00
Christoph Reiter
103f884d99 meson: gl: remove non-headers from gl_prototype_headers
This made the meson build install those files, while they aren't
installed with the autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=796274
2018-05-20 14:41:41 +01:00
Matthew Waters
e367d3e812 glcolorconvert: fix negotiation for a non list video format in caps
For a single format in the caps, we were returning some weird answers,
like only RGB formats for a RGB input when we can also support YUV from
RGB.

Fixup of 3cfff727b1 where I thought my
previous (~6month) self had got this right.  Don't trust your previous
self people!
2018-05-06 18:54:20 +10:00
Nirbheek Chauhan
1e1a5d658e meson: Update option names to omit disable_ and with- prefixes
Also yield common options to the outer project (gst-build in our case)
so that they don't have to be set manually and use array types for some
options.
2018-05-05 20:30:52 +05:30
Matthew Waters
ef71c5a29d gl: allow for high resolution EAGLLayer's 2018-05-05 21:36:25 +10:00
Matthew Waters
3cfff727b1 glcolorconvert: add support for ARGB64 conversion 2018-05-05 21:24:25 +10:00
Matthew Waters
c4367b63d8 gl/format: add a function to retrieve if a format is supported 2018-05-05 21:24:25 +10:00
Matthew Waters
c150928756 glbasefilter: expose finding the local GL context
And use it to attempt to find the GL context sooner for upload and color
conversion caps transformations.
2018-05-05 21:24:25 +10:00
Matthew Waters
396e04cf69 gl/memory: store the internal format as the texture format
Instead of having special cases at each GL texture creation, upload,
readback or copy for all non-8-bits-per-components.
Simply store the more specific format and retrieve the generic
component/type tuple from that.

Introduce a helper function for retrieving the generic GL format (RGBA,
RGB, RG, R, L, A) and type (BYTE, SHORT, SHORT_5_6_5) from a sized
GL format enum (RGBA8, RGB565, RG8, etc).
2018-05-05 21:24:25 +10:00
Haihua Hu
e7700f20fd viv-fb: export viv-fb display api
qmlgl plugin will use this api

https://bugzilla.gnome.org/show_bug.cgi?id=795562
2018-04-26 09:29:41 +03:00
Haihua Hu
3c8368129a viv-fb: install gstgldisplay_viv_fb.h into build result
gstgldisplay_viv_fb.h is need by qmlgl plugin in gst-good package

https://bugzilla.gnome.org/show_bug.cgi?id=795499
2018-04-26 09:29:21 +03:00
Sebastian Dröge
e99affac71 gl/cocoa: Let ARC clean up our dispatch queue if ARC is used, and otherwise do it manually
Also don't use __bridge casts if ARC is not used, as is the case on 32
bit systems.
2018-04-25 01:33:43 +03:00
Sebastian Dröge
b747ae9657 gl/cocoa: Use NSRect instead of CGRect
On 64 bit systems they're typedefs of each other but on 32 bit systems
not, and we pass the rect to an API that expects a NSRect
2018-04-25 01:09:40 +03:00
Mark Nauwelaerts
710990d5cf gl: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Tim-Philipp Müller
762733c3d8 meson: gl: fix 'invalid keyword argument' meson warnings
Required is not a valid kwarg for cc.has_header()
2018-04-20 11:44:55 +01:00