Commit graph

7016 commits

Author SHA1 Message Date
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
Seungha Yang 3499d9ea64 meson: Replace empty configuration_data() with copy keyword
Use 'copy' keyword to avoid meson warning message.
Note that 'copy' keyword in configure_file() is available
since meson 0.47.0

https://bugzilla.gnome.org/show_bug.cgi?id=797298
2018-10-17 13:48:47 +01:00
Nirbheek Chauhan 76ba8d8759 videometa: Log map errors with GST_ERROR, not DEBUG
Otherwise it's very easy to miss them when gst_video_frame_map() fails
2018-10-15 19:46:48 +05:30
Mathieu Duponchelle aa6daaafc6 rtspconnection: do not duplicate authentication headers
rtsp_connection_send takes care of adding those already,
and some reverse proxies such as nginx will reject the request
altogether if the Authorization header is present twice,
even with the same value.

https://bugzilla.gnome.org/show_bug.cgi?id=797272
2018-10-11 15:35:56 +02:00
Stian Selnes f766b85b96 rtpbasepayload: rtpbasedepayload: Add source-info property
Add a source-info property that will read/write meta to the buffers
about RTP source information. The GstRTPSourceMeta can be used to
transport information about the origin of a buffer, e.g. the sources
that is included in a mixed audio buffer.

A new function gst_rtp_base_payload_allocate_output_buffer() is added
for payloaders to use to allocate the output RTP buffer with the correct
number of CSRCs according to the meta and fill it.

RTPSourceMeta does not make sense on RTP buffers since the information
is in the RTP header. So the payloader will strip the meta from the
output buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=761947
2018-10-10 14:38:01 -04: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
Sebastian Dröge d09eccc06b video-overlay-composition: Correctly mark GstVideoOverlayFormatFlags as flags
And register a GType for it.
2018-10-04 11:36:36 +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
Thiago Santos 6be312a759 encoding-profile: set_restriction should accept null as valid
It was checking for GST_IS_CAPS only and that would fail if the new
restriction caps was NULL and its documentation says it accepts NULL as
valid input.
2018-10-01 18:05:39 -07:00
Sebastian Dröge bb0d58a905 video-overlay-composition: Handle miniobject writability correctly
By tracking parents and using the proper GstMiniObject API for detecting
writability instead of just the reference count.

https://bugzilla.gnome.org/show_bug.cgi?id=797230
2018-10-01 12:19:22 +03:00
Sebastian Dröge 4e125c20ac video: Fix annotations for gst_buffer_add_video_meta_full() 2018-09-29 11:26:54 +03:00
Edward Hervey 8707914d23 tagdemux: Use upstream GST_EVENT_STREAM_START if present
If we have an upstream GST_EVENT_STREAM_START, use that one instead
of creating a new one which could be completely different from the
upstream one and drop information (like the stream flags and stream
object).

Only create a new event if we don't already have one from upstream

https://bugzilla.gnome.org/show_bug.cgi?id=797215
2018-09-27 15:09:06 +02: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
Nirbheek Chauhan d002cd33d3 gstaudioutilsprivate: Fix warnings while setting thread priority
Also use G_OS_WIN32 instead of _WIN32 for clarity.
2018-09-24 19:44:28 +05:30
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
Nicolas Dufresne 8ffd15ab28 videodecoder: Delete the link before pushing
The gst_video_decoder_clip_and_push_buf() now drops the internal stream
lock while pushing. This means, the output_queued list could be modififed
during that time. To make the code safe again, we delete the link before
pushing the data. The walk pointer will later be updated with the list
head, which makes it safe in case the list was modififed.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-09-10 17:08:25 -04:00
Nirbheek Chauhan 1733233060 gstaudiosrc/sink: Set audio ringbuffer thread priority
On Windows, the ringbuffer thread function must have the "Pro Audio"
priority set, otherwise it sometimes doesn't get scheduled for
200-300ms, which will immediately cause an underrun unless you set
a very high latency-time and buffer-time.

This has no compile-time deps since it tries to load avrt.dll at
runtime to set the thread priority.
2018-09-11 00:41:59 +05:30
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