Commit graph

7829 commits

Author SHA1 Message Date
Sjoerd Simons
989f53383b glupload: dmabuf: be explicit about gl formats used
Rather then letting gst_gl_memory_setup_buffer guess the GL format used
for an eglimage after importing a dmabuf be explicit about it. This
fixes issues where dmabuf import may have used another format then
gst_gl_format_from_video_info would guess on the basis of the available
GL extensions.

In particular on etnaviv the gst_gl_format_from_video_info would
assuming a luminance + alpha GL format is used for YUY2, but the dmabuf
import will always use RG88. Which causes images to end up somewhat pink when
displayed on the screen.
2018-11-11 16:15:59 -05:00
Sjoerd Simons
99ac4e6600 gl/egl: Determine correct format on dmabuf import
When importing an egl image from dmabuf gst_gl_format_from_video_info
was used to work what the result GL format will be. Unfortunately that
will only work if the conventional format and the choosen DRM fourcc for
the format match up.

On etnaviv platforms there is no support for GL_EXT_texture_rg, so the
GL format chosen for YUY2 ends up being GST_GL_LUMINANCE_ALPHA. However
DRM does not do luminance + alpha as it's a legacy GL thing, so the
dmabuf import ends up using DRM_FORMAT_GR88.

To fix this, tie the DRM_FORMAT and the GL format together so they
always match up.
2018-11-11 16:15:54 -05:00
Sebastian Dröge
d3a35870a2 audio: const gpointer is not the same as gconstpointer/const void *
See https://bugzilla.gnome.org/show_bug.cgi?id=664491
2018-11-05 08:16:16 +00:00
Sebastian Dröge
4666444955 video-anc: Fix bounds checks when parsing VBI data
We were reading more bytes than we allocated.

https://bugzilla.gnome.org/show_bug.cgi?id=797363
2018-11-01 19:30:41 +02:00
Nicolas Dufresne
e074eff5ef glupload: Only renegotiate if the caps are incompatible
There is new code that ensures that we renegotiate after an
uploader transition if the negotiated caps have changed.

The problem is that the raw uploader will not really try and
fixate the input caps, but instead of return a subset with the
only the supported target texture.

This had two effect, raw uploads was always done renegotiated
once and the raw upload unit test was now failing as it didn't
expect a renegotiation.

As it's a valid check, simply relax the gst_caps_is_equal() check
and use a gst_caps_is_subset() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=783521
2018-11-01 06:22:28 -04:00
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
Wangfei
cc0bcd5856 video: add Y210 pixel format.
This pixel format is packed format with 4:2:2 sample and 10
available bits of each channel.

https://bugzilla.gnome.org/show_bug.cgi?id=797267
2018-10-31 15:01:34 +00: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
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
Sebastian Dröge
14031f1c63 discoverer: Consider closedcaption/ as subtitles and improve subtitle caps detection
Generally all subtitle/, subpicture/, text/, closedcaption/ and
application/x-subtitle caps instead of hardcoding a small set of caps.

https://bugzilla.gnome.org/show_bug.cgi?id=797072
2018-09-04 11:59:46 +03:00
Alexey Chernov
595dd27ede videoencoder: Release STREAM_LOCK during gst_pad_push()
Release STREAM_LOCK before calling gst_pad_push() and take it
back afterward so that upstream isn't blocked while output
buffer is being pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-08-31 16:11:04 -04:00
Alexey Chernov
fb49674a39 videodecoder: Release STREAM_LOCK during gst_pad_push()
Release STREAM_LOCK before calling gst_pad_push() and take it
back afterward so that upstream isn't blocked while output
buffer is being pushed downstream.

https://bugzilla.gnome.org/show_bug.cgi?id=715192
2018-08-31 16:10:57 -04: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
Zeeshan Ali
3880eb819a video: Add GST_VIDEO_INFO_FIELD_RATE_N() macro
Add a new macro that gives you the rate of the fields, which is the
numerator of the field-rate for ALTERNATE interlacing video and FPS for
progressive and other interlacing formats.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
be6c8400b0 video: Add gst_video_decoder_set_interlaced_output_state()
Add a variant of gst_video_decoder_set_output_state() that allows the user
to pass an interlacing mode as well. This is needed to ensure that
gst_video_info_set_interlaced_format() is used instead so that
GstVideoInfo.size is correctly initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
4879983253 video: Add GST_VIDEO_INFO_FIELD_HEIGHT() macro
Add a new macro that gives you the height of a field. It returns the
height of the full frame unless split-field (alternate) interlacing is
in use. Also GST_VIDEO_INFO_COMP_HEIGHT macro now uses this new macro to
get the height for its calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
0fbe4634a6 video: Add gst_video_info_set_interlaced_format()
Add a helper to set the interlacing mode while creating the GstVideoInfo
in addition to format and resolution. Using this helper will ensure that
size is correctly calculated for split-field interlacing mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
bd9c7b36d8 video: Add GST_VIDEO_INTERLACE_MODE_ALTERNATE
Add a new interlace mode enum to represent buffers containing a single
field of an interlaced video in a buffer. The name is based on the
equivalent video format in the V4L2 API, V4L2_FIELD_ALTERNATE:

https://01.org/linuxgraphics/gfx-docs/drm/media/uapi/v4l/field-order.html

Since caps fields are optional, we also introduce a new caps feature,
"format:Interlaced" that always goes with "alternate" interlace mode to ensure
that caps for this incompatible format are incompatible with other interlaced
and progressive video caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04:00
Zeeshan Ali
8fa9fda226 video: Add format for single fields of interlaced video in a buffer
https://bugzilla.gnome.org/show_bug.cgi?id=796106
2018-08-29 12:14:38 -04: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
4906ec8c13 audio: use right export decorator 2018-08-26 11:16:10 +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
Sebastian Dröge
0bf207aa53 audioaggregator: Also run the audio-specific caps fixation for audio aggregator subclasses that can't convert 2018-08-16 18:03:37 +03:00
Sebastian Dröge
320243050b audioaggregator: Fixate to some meaningful values if no sinkpad is configured yet
The default caps fixation code would select a rate of 1 for example,
which is not really ideal.
2018-08-16 18:00:24 +03:00
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
Sebastian Dröge
8430e47006 videoaggregator: Make sure to hold object lock while iterating sink pads
They might otherwise just change while we iterate.
2018-08-16 10:03:19 +03:00
Sebastian Dröge
1b6eed694c audioaggregator: Properly propagate caps negotiation failures
Otherwise we'll end up doing a division by zero when clipping buffers,
and might even accept buffers for which we don't know the caps.

https://bugzilla.gnome.org/show_bug.cgi?id=796951
2018-08-14 10:24:33 +03: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
Tim-Philipp Müller
f548546d41 pbutils, rtsp: fix deprecation guards
Function body must only be removed if compiling with
GST_REMOVE_DEPRECATED. Function declaration must not
be skipped if GST_DISABLE_DEPRECATED is defined, since
it contains our export decorator and we wouldn't export
the symbol as public API any more then since we compile
with GST_DISABLE_DEPRECATED.
2018-08-13 00:24:50 +01:00
Tim-Philipp Müller
4b68e3e658 tag: add license to generated backup language name table and update
It's LGPL same as iso-codes
2018-08-12 13:24:39 +01:00
Tim-Philipp Müller
6eb6140969 meson: use iso-codes in gsttag if available 2018-08-12 12:55:00 +01:00
Tim-Philipp Müller
553de4906f meson: tag: check for zlib and support compressed id3v2 tag if found
https://bugzilla.gnome.org/show_bug.cgi?id=793995
2018-08-11 18:51:33 +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
Bastian Köcher
efa9bdccf9 meson: fix install dir for generated header files
Nixos installs into a non-standard includedir, so need
to take account of the 'includedir' option instead of
just hard-coding 'include' here.

https://bugzilla.gnome.org/show_bug.cgi?id=794856
2018-08-10 12:43:38 +01:00
Sebastian Dröge
0340c7e1f8 tagdemux: Propagate flow returns from gst_type_find_helper_get_range() properly
Instead of considering every failed typefinding as an error, even in
case of e.g. GST_FLOW_FLUSHING.
2018-08-08 12:46:43 +02:00
Thibault Saunier
7757e07f68 rtsp: Include gstreamer-base gir dir in autotools 2018-08-06 14:18:12 -04: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
Sebastian Dröge
2f497ed217 tagdemux: Properly propagate gst_pad_pull_range() errors
And don't consider FLUSHING an actual error, just stop in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=796883
2018-07-27 16:23:09 +03:00
Nirbheek Chauhan
eadedc68f8 meson: Add feature options for all plugins
GL dependency detection is still automagic.

https://bugzilla.gnome.org/show_bug.cgi?id=795107
2018-07-27 18:42:11 +05:30
George Kiagiadakis
ab2548d78d audio-buffer: fix typo in assignment that causes buggy behavior 2018-07-24 15:09:25 +03:00
George Kiagiadakis
0ce20cef4f gstaudiodecoder: take into account GstAudioMeta::samples on the output buffers
This is useful if the output buffers are planar and have extra padding
on each plane, in which case size/bpf does not represent the number of
valid samples.

https://bugzilla.gnome.org/show_bug.cgi?id=705977
2018-07-23 15:27:08 +03:00
George Kiagiadakis
2d38d2f1d3 gstaudiodecoder: do not aggregate output if buffers are planar
Aggregation will break the layout, as it concatenates buffers,
and fixing it here would be much more inefficient than configuring
the actual decoder implementation to output larger buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=705977
2018-07-23 15:27:08 +03: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
Nicolas Dufresne
62cb08404b videodecoder: Don't always drain on gaps/discont
V4L2 and OMX decoder don't support draining and keeping reference
frames. As a side effect, these decoder just stops working on
gaps/discont. When this drain was introduced, the commit stated that
this was for TRICKMODE_KEY_UNITS, so only drain if running in this mode.

https://bugzilla.gnome.org/show_bug.cgi?id=796771
2018-07-12 15:25:51 -04:00
George Kiagiadakis
e1bc49923f libs: audio: implement planar buffer support in gst_audio_buffer_reorder_channels()
https://bugzilla.gnome.org/show_bug.cgi?id=796743
2018-07-12 13:38:27 +03:00
George Kiagiadakis
b33d70e97f libs: audio: add a new gst_audio_buffer_truncate() function
Essentially this moves the truncation logic out of gst_audio_buffer_clip()
so that it can be used in other places, like in audiorate.

https://bugzilla.gnome.org/show_bug.cgi?id=796740
2018-07-12 12:08:10 +03:00
George Kiagiadakis
9cb09e7269 libs: audio: implement support for non-interleaved audio in gst_audio_buffer_clip()
https://bugzilla.gnome.org/show_bug.cgi?id=796740
2018-07-12 11:59:06 +03:00
George Kiagiadakis
060ecd16cd libs: audio-converter: complete code to support non-interleaved audio buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03:00
George Kiagiadakis
eefdf32d96 libs: audio-resampler: add support for consuming non-interleaved input buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03:00
George Kiagiadakis
108a911610 libs: audio-channel-mixer: add support for non-interleaved audio buffers
https://bugzilla.gnome.org/show_bug.cgi?id=705986
2018-07-11 16:26:13 +03: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
Guillaume Desmottes
173e2d8db3 videopool: display expected size in warning message
Display the size computed from the caps when rejecting a pool
configuration because the buffer size is too small.

https://bugzilla.gnome.org/show_bug.cgi?id=796768
2018-07-09 11:21:50 +02:00
Olivier Crête
28e5f81021 videosink: Set processing deadline to 15ms
This roughly corresponds to one frame at 60fps, and leave 5ms
of max_lateness to not change the existing behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=640610
2018-07-07 08:59:30 -04:00
George Kiagiadakis
c946e323f6 libs: audio: Implement GstAudioBuffer & GstAudioMeta
Library bits to support non-interleaved audio

https://bugzilla.gnome.org/show_bug.cgi?id=751605
2018-07-03 14:06:43 +03:00
Tim-Philipp Müller
a3a9bcd468 meson: rtsp now also depends on libgstbase 2018-06-29 10:54:36 +01:00
Edward Hervey
017dd37f86 rtsp: Also use libgstbase for introspection module 2018-06-29 08:53:48 +02:00
Sebastian Dröge
a9e72b3b7f rtsp: Link to libgstbase for GstDataQueue 2018-06-29 08:08:46 +02:00
wangzq
9f51607723 audiobasesrc: Round down segsize to an integer number of samples
https://bugzilla.gnome.org/show_bug.cgi?id=796704
2018-06-29 07:38:20 +02:00
Sebastian Dröge
d4f607ef40 rtspconnection: Use GstQueueArray instead of GQueue for the queued messages 2018-06-29 07:38:20 +02: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
b342955a64 videoaggregator: Update for g_type_class_add_private() deprecation in recent GLib 2018-06-24 01:47:29 +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
Tim-Philipp Müller
7f9730ecf4 rtp: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:22:22 +02:00
Tim-Philipp Müller
511a8d7ddd pbutils: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:08:16 +02:00
Tim-Philipp Müller
92579cb845 tag: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 22:03:27 +02:00
Tim-Philipp Müller
18c457dfb4 video: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 21:59:13 +02:00
Tim-Philipp Müller
fae8c24590 audio: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 21:49:48 +02:00
Tim-Philipp Müller
7b98593280 app: Update for g_type_class_add_private() deprecation in recent GLib
https://gitlab.gnome.org/GNOME/glib/merge_requests/7
2018-06-23 21:33:16 +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
Mathieu Duponchelle
0304c63f00 rtspdefs: Add gst_rtsp_generate_digest_auth_response_from_md5
Passwords are usually not stored in clear text, usually
the A1 section of the response is stored as is in .htdigest
files.

https://bugzilla.gnome.org/show_bug.cgi?id=796636
2018-06-21 15:32:12 +02: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
Seungha Yang
5934fb1bb6 videoaggregator: Fix string leak
gst_video_colorimetry_to_string() returns allocated memory which
must be freed.

https://bugzilla.gnome.org/show_bug.cgi?id=796596
2018-06-15 10:17:14 -04:00
Edward Hervey
1208ef637a videoencoder: Keep the segment position in sync
If the start of the segment is modified, the position should be
modified accordingly

https://bugzilla.gnome.org/show_bug.cgi?id=796576
2018-06-13 13:20:44 +02:00
Mathieu Duponchelle
a4a27fdca8 sdp: Add new constructor, sdp_message_from_text
Helper function for bindings, in python for example
users can now replace:

res, msg = GstSdp.SDPMessage.new()
GstSdp.sdp_message_parse_buffer(bytes(text.encode()), msg)

with:

res, msg = GstSdp.SDPMessage.new_from_text(text)

https://bugzilla.gnome.org/show_bug.cgi?id=796563
2018-06-11 20:21:08 +02:00
Nicolas Dufresne
4683182381 videopool: Removed unused private caps member 2018-06-11 13:52:42 -04:00
Tim-Philipp Müller
ecd58f2775 videoaggregator: log an ERROR if we're going to return a flow error 2018-06-11 13:48:09 +01: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
Thomas Bluemel
7d3c098a7c audiobasesink: Improve clock skew corrections.
The external time should be moved only as much as needed
to get back to the ideal center point, so that the clock
is still allowed to drift both directions after the correction.
This reduces excessive back and forth corrections that were
caused by the assumption of a linear drift.

https://bugzilla.gnome.org/show_bug.cgi?id=788006
2018-06-06 16:11:45 -04: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
Edward Hervey
924eb8d8a7 rtpbasedepayload: Properly propagate segment seqnum
This wasn't done previously and the outgoing SEGMENT events had
seqnums which weren't consistent with the upstream ones
2018-06-05 17:24:55 +02:00
Tim-Philipp Müller
9158f9f7eb docs: Fix typos 2018-05-22 14:10:03 +01: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
Mark Nauwelaerts
9c92ae89c7 video: fix some GIR array annotations 2018-05-21 09:18:35 +02:00
Mark Nauwelaerts
751e9640f9 audio: fix some GIR array annotations 2018-05-21 09:18:35 +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
Christoph Reiter
eef72d0d85 meson: install license-translations.dict and set LICENSE_TRANSLATIONS_PATH
The autotools build installs the file and sets the LICENSE_TRANSLATIONS_PATH
macro which licences.c uses as a fallback path. Do the same with meson.

https://bugzilla.gnome.org/show_bug.cgi?id=796274
2018-05-20 14:27:39 +01:00
ayaka
388b48511e video: Add NV12_10LE40 pixel format
This pixel format is a fully packed variant of NV12_10LE32,
a luma pixel would take 10bits in memory, without any
filled bits between pixels in a stride. The color range
follows the BT.2020 standard.

In order to get a better performance in hardware memory
operation, it may expend the stride, append zero data at the
end of echo lines.

Pack function by Nicolas Dufresne.

https://bugzilla.gnome.org/show_bug.cgi?id=795462

Signed-off-by: Nicolas Dufresne <nicolas@ndufresne.ca>
Signed-off-by: ayaka <ayaka@soulik.info>
2018-05-19 13:09:08 -04:00
Antoine Jacoutot
c765649505 libs: g-ir-scanner: do not hardcode libtool path
https://bugzilla.gnome.org/show_bug.cgi?id=726571
2018-05-18 13:41:25 +02:00
Olivier Crête
91692122d3 videoaggregator: Remove custom get_next_time implementation
GstAggregator now has the same thing in the simple implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 22:24:18 +02:00
Olivier Crête
8583f17e62 audioaggregator: Remove custom get_next_time implementation
GstAggregator now offers  same thing in a common implementation.

https://bugzilla.gnome.org/show_bug.cgi?id=795486
2018-05-16 22:22:29 +02:00
Georg Lippitsch
1a8c6197c7 videotimecode: Allow 24000/1001 frame rate
https://bugzilla.gnome.org/show_bug.cgi?id=796107
2018-05-14 20:32:48 +03:00
Sebastian Dröge
c43bae0a42 videoaggregator: Set video-meta option on buffer pool configuration correctly
CID 1435451
2018-05-07 17:53:32 +03:00
Sebastian Dröge
4291ee94c4 videoaggregator: First override set/get_property vfuncs, then install properties
Gives assertions otherwise.
2018-05-07 09:17:16 +02:00
Kyrylo Polezhaiev
b4df0bf07a tagdemux: avoid timestamp field initialisation for tag event
This field is not used and will be removed in 2.0 API.

https://bugzilla.gnome.org/show_bug.cgi?id=761462
2018-05-07 01:16:27 +10:00
Sebastian Dröge
73f843539d videoaggregator: Some more documentation fixes 2018-05-06 16:49:57 +02:00
Mathieu Duponchelle
1492fb4ef9 videoaggregator: expose converter-config on convert pads
This in order to allow users control over the conversion
process, for example the scaling method.
2018-05-06 16:45:43 +02:00
Sebastian Dröge
049877e5d0 videoaggregator: Fix up documentation some more 2018-05-06 16:43:32 +02:00
Sebastian Dröge
9d6d46f4cb videoaggregator: Clean up header and update docs a bit 2018-05-06 16:22:01 +02:00
Sebastian Dröge
dbb21615c4 videoaggregator: Rename get_output_buffer() to create_output_buffer()
For consistency with GstAudioAggregator.
2018-05-06 16:05:28 +02:00
Sebastian Dröge
429e6c8532 videoaggregator: Validate pool configuration and create a new pool if it just does not work
Also pass the given allocator to the pool if one is set.
2018-05-06 15:49:36 +02:00
Sebastian Dröge
33a8e28207 videoaggregator: Switch to a GstVideoAggregatorConvertPad subclass
This moves all the conversion related code to a single place, allows
less code-duplication inside compositor and makes the glmixer code less
awkward. It's also the same pattern as used by GstAudioAggregator.
2018-05-06 15:22:51 +02: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
Sebastian Dröge
5b736d2c7a audioaggregator: Update converters after updating with the new audioinfo/caps
Otherwise subclasses might accidentially use the old audioinfo/caps.
None of the subclasses currently uses the audioinfo/caps, but future
subclasses might.

https://bugzilla.gnome.org/show_bug.cgi?id=795827
2018-05-05 16:40:32 +02:00
Sebastian Dröge
b73b7230d2 videoaggregator: Remove sink_non_alpha_caps class field
This is only used for caching reasons and should never actually be in
the public API. If this is ever a bottleneck later, caching around a
class private struct could be implemented.
2018-05-05 16:32:19 +02:00
Sebastian Dröge
233ee9f077 videoaggregator: Move needs_alpha pad field to the private struct
And also trigger renegotiation if the value has changed.

https://bugzilla.gnome.org/show_bug.cgi?id=795836
2018-05-05 16:32:19 +02:00
Sebastian Dröge
1c8110ab17 videoaggregator: Move aggregated_frame and the pad buffer into the private struct
The aggregated_frame is now called prepared_frame and passed to the
prepare_frame and cleanup_frame virtual methods directly. For the
currently queued buffer there is a method on the video aggregator pad
now.
2018-05-05 16:32:19 +02:00
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
Edward Hervey
1a1570bb1e video: Silence "restrict" issues with ORC code
The problem is that even though the functions we are calling are
in-place transformation, orc automatically puts the restrict keyword
on all arguments. To silence that warning just create yet-another
variable containing the same value.

https://bugzilla.gnome.org/show_bug.cgi?id=795765
2018-05-05 10:27:12 +02:00
Sebastian Dröge
8b231d502c videoaggregator: Move property storage to private pad struct 2018-05-04 17:18:12 +02:00
Sebastian Dröge
51c359dda6 videoaggregator: Rename ignore-eos pad property to repeat-after-eos
What it does is to repeat the last frame forever after EOS, it does not
literally ignore EOS.
2018-05-04 16:46:00 +02:00
Sebastian Dröge
a240fb7997 videoaggregator: Move GstChildProxy implementations into leaf classes
Not every subclass will want to expose the pads via the interface.

https://bugzilla.gnome.org/show_bug.cgi?id=739011
2018-05-04 16:13:16 +02:00
Sebastian Dröge
c13357f22b videoaggregator: Get rid of separate header for the aggregator pad 2018-05-04 15:35:52 +02:00
Sebastian Dröge
dbd9ff1cf5 appsink: Handle unlock in drain query handling too
And also handle flushing, we might otherwise wait here forever when
flushing too.
2018-05-02 19:14:16 +03:00
Sebastian Dröge
9f9000e693 appsink: Make sure to also handle unlock when waiting for EOS to be handled
Otherwise shutting down during EOS waiting will cause a deadlock.

https://bugzilla.gnome.org/show_bug.cgi?id=795551
2018-05-02 19:14:16 +03:00
Sebastian Dröge
a19497ab67 appsrc/sink: Fix optimization for only signalling waiters if someone is actually waiting
It is possible that both application and the stream are waiting
currently, if for example the following happens:
  1) app is waiting because no buffer in appsink
  2) appsink providing a buffer and waking up app
  3) appsink getting another buffer and waiting because it's full now
  4) app thread getting back control

Previously step 4 would overwrite that the appsink is currently waiting,
so it would never be signalled again.

https://bugzilla.gnome.org/show_bug.cgi?id=795551
2018-05-02 18:11:58 +03:00
Thibault Saunier
8600fc3148 pbutils: Avoid assertion describing raw audio caps without format
We used to get:

    gst_audio_format_from_string: assertion 'format != NULL' failed
2018-05-01 21:15:25 +02:00
Thibault Saunier
77b23ea0ac encoding-profile: Fix deserialization of a single profile
Instead of trying to guess what profile to build, just get the possible
elements to use with the specified caps and determine the
EncodingProfile from it.

https://bugzilla.gnome.org/show_bug.cgi?id=795490
2018-05-01 21:15:25 +02:00
Seungha Yang
46c024ea3d tagmux: Reset final tags for reusing element
If the output tag had been exposed, it never ever updated
even if we reset the tagmux using state change.

https://bugzilla.gnome.org/show_bug.cgi?id=795691
2018-05-01 09:51:53 +01:00
Matthias Fend
41c6efb9ff videodecoder: keep event order
Since events are pushed out in reverse order, newer events need to
be added at the front of event lists

https://bugzilla.gnome.org/show_bug.cgi?id=794192
2018-04-26 17:05:04 -04:00
Hyunjun Ko
56ab7e0e1d dmabufallocator: adds gst_dmabuf_allocator_alloc_with_flags
If we can guarantee the lifetime of the fd is longer than
the memory, we can use DONT_CLOSE flag not to close when release.
But it's not provided in gstdmabuf yet while gstfdmemory does.

For example, in case of using VA-API or MSDK, we would need this api.
Otherwise we should call dup to duplicate the fd.

https://bugzilla.gnome.org/show_bug.cgi?id=794829
2018-04-26 16:40:54 -04: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
Nicolas Dufresne
9a3ee4838f Revert "video: Add NV12_10LE40 pixel format"
This reverts commit 35d0783fca.
2018-04-24 17:05:17 -04:00
ayaka
35d0783fca video: Add NV12_10LE40 pixel format
This pixel format is a fully packed variant of NV12, a luma
pixel would take 10bits in memory, without any filled bits
between pixels in a stride. The color range follows
the BT.2020 standard.

In order to get a performance in hardware memory
operation, it may expend the stride, append zero data at the
end of echo lines.

Signed-off-by: ayaka <ayaka@soulik.info>

https://bugzilla.gnome.org/show_bug.cgi?id=795462
2018-04-24 16:51:27 -04:00
Mark Nauwelaerts
710990d5cf gl: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Mark Nauwelaerts
1beff3bde5 pbutils: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Mark Nauwelaerts
c93eda31d9 video: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Mark Nauwelaerts
9a360a47bf audio: fix some GIR annotations
Mostly related to out and array parameters
2018-04-23 19:33:19 +02:00
Mark Nauwelaerts
31061ada4e rtsp: fix some GIR annotations
Mostly related to out and array parameters.
2018-04-23 19:33:17 +02:00
Mark Nauwelaerts
fe6f65b1c2 rtp: fix some GIR annotations
Mostly related to out and array parameters.
2018-04-23 19:33:12 +02:00
Mathieu Duponchelle
83939c81e7 audioaggregator: fix filtered getcaps
In the situation described in
https://bugzilla.gnome.org/show_bug.cgi?id=795397,

downstream_caps consists of two structures, the first with
the preferred rate, if at all possible (44100), the second
containing the full range of allowed rates, as audioresample
correctly tries to negotiate passthrough caps.

As audioaggregator cannot perform rate conversion, it wants
to return a fixated rate in its getcaps implementation,
however it previously directly used the first structure in
the caps allowed downstream, without taking the filter into
consideration, to determine the rate to fixate to.

With this, we first intersect our downstream caps with the
filter, in order not to fixate to an unsupported rate.
2018-04-23 17:13:22 +02:00
Thibault Saunier
b63fc21d22 video: Safe guard info->finfo when mapping a frame
Not sure how that slept through but that case is possible and leads
to segfaults in any code path of the function right now.

https://bugzilla.gnome.org/show_bug.cgi?id=795436
2018-04-21 20:47:31 -03:00
Thibault Saunier
59eacaa966 encoding-profile: Handle escaped '\:' in caps describing profiles
Otherwise it won't be possible to specify some profiles such as

    video/x-h264,profile=(string)high-4:4:4

With this patch, we can do

    video/x-h264,profile=(string)high-4\:4\:4
2018-04-20 11:22:41 -03: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
Mathieu Duponchelle
8467939538 rtpbasedepayload: condition the sending of gap events
The default implementation for packet loss handling previously
always sent a gap event.

While this is correct as long as we know the packet that was
lost was actually a media packet, with ULPFEC this becomes
a bit more complicated, as we do not know whether the packet
that was lost was a FEC packet, in which case it is better
to not actually send any gap events in the default implementation.

Some payloaders can be more clever about, for example VP8 can
use the picture-id, and the M and S bits to determine whether
the missing packet was inside an encoded frame or outside,
and thus whether if it was a media packet or a FEC packet,
which is why ulpfecdec still lets these lost events go through,
though stripping them of their seqnum, and appending a new
"might-have-been-fec" field to them.

This is all a bit terrible, but necessary to have ULPFEC
integrate properly with the rest of our RTP stack.

https://bugzilla.gnome.org/show_bug.cgi?id=794909
2018-04-19 16:39:06 +02:00
Mathieu Duponchelle
d00e0b612d appsink: Reuse sample object in pull_sample if possible
Simple optimization to reduce memory allocations.

https://bugzilla.gnome.org/show_bug.cgi?id=795145
2018-04-19 16:14:12 +02:00
Omar Akkila
2f3ff84f40 egl: fix build when using RPi EGL
https://bugzilla.gnome.org/show_bug.cgi?id=795336
2018-04-18 14:37:16 -04:00
Edward Hervey
4d40ac3fc5 video: Don't corrupt caption GstMeta
the meta initialization function is provided *after* the base implementation
fields have been set so do *NOT* reset them otherwise it would result
in corrupted GstMeta.

Instead explicitely set our fields to the default values we actually want.
2018-04-16 17:04:06 +02:00
Víctor Manuel Jáquez Leal
57ede858f0 gl: Define default value for GST_GL_HAVE_WINDOW_GBM
Thus, silent compiler's warning:
"GST_GL_HAVE_WINDOW_GBM" is not defined, evaluates to 0 [-Wundef]
2018-04-16 11:15:52 +02:00
Mark Nauwelaerts
8197c2c1be tag: fix some GIR annotations
Mostly related to out and array parameters.
2018-04-13 20:19:08 +02:00
Mathieu Duponchelle
a59fbba141 audioaggregator: unref converted buffer after gst_buffer_replace 2018-04-13 01:07:21 +02:00
Sebastian Dröge
5e441e2197 audiovisualizer: Only fixate pixel-aspect-ratio if the field exists
It's optional.
2018-04-11 21:40:58 +02:00
Vivia Nikolaidou
06aa4e5b68 appsrc: Documentation fix in gst_app_src_push_sample_internal
Make it clear that it doesn't take ownership of the sample.

https://bugzilla.gnome.org/show_bug.cgi?id=795150
2018-04-11 12:28:26 +03:00
Sebastian Dröge
cfb1a7f6e7 audiovisualizer: Fixate pixel-aspect-ratio to the closest value to 1/1 2018-04-10 21:18:37 +02:00
Edward Hervey
9dceb6ca52 video: Add support for VANC and Closed Caption
This commits add common elements for Ancillary Data and Closed
Caption support in GStreamer:

* A VBI (Video Blanking Interval) parser that supports detection
  and extraction of Ancillary data according to the SMPTE S291M
  specification. Currently supports the v210 and UYVY video
  formats.

* A new GstMeta for Closed Caption : GstVideoCaptionMeta. This
  supports the two types of CC : CEA-608 and CEA-708, along with
  the 4 different ways they can be transported (other systems
  are super-set of those).

https://bugzilla.gnome.org/show_bug.cgi?id=794901
2018-04-09 15:15:24 +02:00
Edward Hervey
43254a2196 pbutils: Add Closed Caption caps description
https://bugzilla.gnome.org/show_bug.cgi?id=794901
2018-04-09 15:15:24 +02:00
Nirbheek Chauhan
b5698995f1 audiobasesrc: posting errors should be always be safe
Don't try to signal an error in the ringbuffer if it hasn't been
allocated yet.

https://bugzilla.gnome.org/show_bug.cgi?id=794611
2018-04-09 17:25:32 +05:30
Nirbheek Chauhan
baadc3b302 audioringbuffer: Don't spam INFO for every buffer
This makes GST_DEBUG=4 outputs too spammy, and such frequent messages
are meant to go into DEBUG or TRACE anyway.
2018-04-07 11:09:58 +05:30
Edward Hervey
c64d2cf396 video: Fix/Add section documentation 2018-04-02 16:49:19 +02:00
Edward Hervey
22c9e5f7c1 libs: Documentation cleanup
* Fix wrong naming, wrong types and typos
* Add missing sections
* Add missing documentation for entries
* Explicitely mark private structure entries
* Remove items that never existed
2018-04-02 08:53:28 +02:00
Edward Hervey
d69fa0c78e libs: Add deprecation guard
Those functions have been marked as deprecated
2018-04-02 08:53:28 +02:00
Tim-Philipp Müller
df66d00876 gl: pick up GstVideo-1.0.gir from local build dir
https://bugzilla.gnome.org/show_bug.cgi?id=794708
2018-03-27 11:18:35 +01:00
Thiago Santos
dc527cac62 encoding-profile: fix gi annotation for gst_encoding_profile_find 2018-03-25 14:05:31 -07:00
Edward Hervey
a034018a75 audio-aggregator: Check return values
And copy over already-parsed information

CID #1427140
2018-03-23 14:25:21 +01:00
Alessandro Decina
345aa2cd9e meson: libs: use gnome.mkenums_simple() to generate enumtypes files
This way we no longer need custom wrapper scripts or template files.
2018-03-22 13:15:35 +00:00
Carlos Rafael Giani
9324ada729 gl/gbm: Initialize window handle (= gbm surface) like other window systems
https://bugzilla.gnome.org/show_bug.cgi?id=793997
2018-03-22 10:15:10 +02:00
Carlos Rafael Giani
9ce1e4e712 viv-fb: Include gstglfuncs.h to fix cross compilation errors
https://bugzilla.gnome.org/show_bug.cgi?id=794589
2018-03-22 09:51:58 +02:00
Nicolas Dufresne
681f41978a dmabufallocator: Fix build if LINUX_DMA_BUF_H is missing 2018-03-21 18:15:49 -04:00
Nicolas Dufresne
8ee306eb3f allocators: Add DMABuf synchronization
When doing CPU Access, some architecture may require caches to be
synchronize before use. Otherwise, some visual artifact may be
visible, as the CPU modification may still resides in cache.

https://bugzilla.gnome.org/show_bug.cgi?id=794216
2018-03-21 15:58:06 -04:00
Sebastian Dröge
4696ecab15 video: Set correct value in g-i annotations for tile related mask constants 2018-03-21 10:28:05 +02:00
Sebastian Dröge
a4c6fbc43b video: Include gstvideoaffinetransformationmeta.h in video.h 2018-03-21 10:25:43 +02:00
Sebastian Dröge
9da36d224d pbutils: Include gstaudiovisualizer.h in pbutils.h 2018-03-21 10:21:41 +02:00
Sebastian Dröge
b058de9d90 audiostreamalign: Mark the whole type as new in 1.14 2018-03-15 09:58:11 +02:00
Tim-Philipp Müller
98a8d7eaf5 meson: install new audio-prelude.h 2018-03-13 13:49:57 +00:00
Tim-Philipp Müller
b69e7eef8b video: GST_EXPORT -> GST_URI_VIDEO_BAD_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 13:36:33 +00:00
Tim-Philipp Müller
ae429de8f6 video: GST_EXPORT -> GST_VIDEO_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
b618c5776d tag: GST_EXPORT -> GST_TAG_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
12be5a1ab2 sdp: GST_EXPORT -> GST_SDP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
12b24fbba0 rtsp: GST_EXPORT -> GST_RTSP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
363b790d38 rtp: GST_EXPORT -> GST_RTP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
3b9768ebaa riff: GST_EXPORT -> GST_RIFF_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
cad9759e7b pbutils: GST_EXPORT -> GST_PBUTILS_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:16:42 +00:00
Tim-Philipp Müller
c5b5ef16d3 gl: GST_EXPORT -> GST_GL_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:10:29 +00:00
Tim-Philipp Müller
882151502d fft: GST_EXPORT -> GST_FFT_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 12:10:29 +00:00
Tim-Philipp Müller
371e3e460a audio: GST_EXPORT -> GST_AUDIO_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 10:36:56 +00:00
Tim-Philipp Müller
be0ca93a90 app: GST_EXPORT -> GST_APP_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 10:29:55 +00:00
Tim-Philipp Müller
75c32b8afc allocators: GST_EXPORT -> GST_ALLOCATORS_API
We need different export decorators for the different libs.
For now no actual change though, just rename before the release,
and add prelude headers to define the new decorator to GST_EXPORT.
2018-03-13 10:20:23 +00:00
Mathieu Duponchelle
e9be107e4a audioaggregator: fix channel-mask negotiation
When outputting more than two channels, a channel-mask has to be
specified in the output caps.

We follow the same heuristic as other cases, when downstream
does not specify a channel-mask, we use that of the first
configured pad, and if there was none we generate a fallback
mask.

https://bugzilla.gnome.org/show_bug.cgi?id=794257
2018-03-12 17:35:53 +01:00
Tim-Philipp Müller
886326bfa0 docs: video: fix typo and add since marker 2018-03-11 22:57:02 +00:00
Thibault Saunier
e916ef08fd audio: Add audioaggregator.h in audio.h 2018-03-11 12:13:32 -03:00
Tim-Philipp Müller
98fc23062f docs: add GstPhysMemoryAllocator to docs 2018-03-08 01:01:53 +00:00
Nicolas Dufresne
604c1bfb4e videodecoder: Reset QoS time after pushing segment
This fixes playbin gapless playback. An ancient QoS time was used and
would lead to all frames being dropped.

https://bugzilla.gnome.org/show_bug.cgi?id=668995
2018-03-01 11:19:31 -05:00
Mathieu Duponchelle
b59da8eced Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793946
2018-03-01 15:37:06 +01:00
Mathieu Duponchelle
22981e8a42 Port to latest GstAggregator segment API
The aggregator segment is now exposed on the src pad

https://bugzilla.gnome.org/show_bug.cgi?id=793944
2018-03-01 15:33:25 +01:00
Mathieu Duponchelle
318eb61e23 audioaggregator: remove GstAudioAggregator->info
As we now require subclasses to use a subclass of
GstAudioAggregatorPad, we can reuse its info field

https://bugzilla.gnome.org/show_bug.cgi?id=793943
2018-03-01 15:33:25 +01:00
Edward Hervey
6f5c9db1cc id3v2: re-fix handling of v2.4 extended headers
The various id3v2 specs handle the extended header sizes differently
(because hey, it wouldn't be fun otherwise).

http://id3.org/id3v2.3.0 states:
"Where the 'Extended header size', currently 6 or 10 bytes, excludes
 itself."

http://id3.org/id3v2.4.0-structure states:
  Extended header size   4 * %0xxxxxxx
     Number of flag bytes       $01
     Extended Flags             $xx

   Where the 'Extended header size' is the size of the whole extended
   header, stored as a 32 bit synchsafe integer. An extended header can
   thus never have a size of fewer than six bytes.

So in id3v2.4.0 it's the *whole* extended header size (a-la ISOBMFF
atom), whereas in id3v2.3.0 it's the extended header size *excluding*
those 4 initial bytes.

And for other versions, god knows..

Fixes regression introduced in commit da607005.

https://bugzilla.gnome.org/show_bug.cgi?id=792983
2018-03-01 12:42:10 +00:00
Mathieu Duponchelle
10835e9919 audioaggregator: refactor conversion API
For the rationale, see:

https://bugzilla.gnome.org/show_bug.cgi?id=793917

Also test audiomixer conversion of current output buffer
2018-03-01 00:40:24 +01:00
Jan Schmidt
c920d994ab glcolorconvert: Fix a typo in a debug message 2018-03-01 02:14:07 +11:00
Jan Schmidt
f15f60a062 glfilter: Support non-2D texture targets
Allow for sub-classes to change pad templates to
support other texture targets, and bind input textures
accordingly.

When setting the caps, also store the texture target.

By default, glfilter only reports 2D texture targets
in the default caps, but sub-classes can change that
and it would be nice if they could easily find out
which texture targets were negotiated.

This adds 2 fields to the public struct, but since
it's unreleased -base API, it's not an ABI break.
2018-03-01 02:14:07 +11:00
Sebastian Dröge
fae7f790be audioaggregator: Document that the pad's audio info is read-only and needs the object lock
Also fix indentation in the header a bit.
2018-02-28 15:23:25 +02:00
Víctor Manuel Jáquez Leal
f3d98fa1a3 roi-meta: duplicate params when copying meta
When copying the meta the params list should be copy too into the
new meta.

https://bugzilla.gnome.org/show_bug.cgi?id=793883
2018-02-27 14:27:42 -05:00
Nicolas Dufresne
d796188cf1 meson: Don't install GL GBM headers 2018-02-27 13:16:01 -05:00
Nicolas Dufresne
fbc2375d57 gl: Move DRM_CFLAGS into gst-gl.m4 2018-02-27 13:12:59 -05:00
Nicolas Dufresne
b8bc2b87d0 gl: Add missing gbm directory to dist dir
This fixes make distcheck
2018-02-26 07:46:26 -05:00
Carlos Rafael Giani
ee59537657 gl: Add DRM cflags
This prevents cross compilation errors like:

usr/include/xf86drm.h:40:10: fatal error: drm.h: No such file or directory

These are caused because gstgldisplay_gbm.h includes xf86drm.h .

https://bugzilla.gnome.org/show_bug.cgi?id=793837
2018-02-26 07:27:20 -05:00
Sebastian Dröge
783e450a60 pbutils: Fix compilation of last commit 2018-02-26 11:55:46 +02:00
Thiago Santos
006c7181ed pbutils: Move locale dir initialization to a separate function and do lazy initialization
It is the only thing gst_pb_utils_init()  does and it could be
automatically called from the places in pbutils it is needed.

After 1.14 we should deprecate gst_pb_utils_init().

https://bugzilla.gnome.org/show_bug.cgi?id=793611
2018-02-26 11:49:04 +02:00
Nicolas Dufresne
1a97338dc7 gl: Add meson support for GBM backend
https://bugzilla.gnome.org/show_bug.cgi?id=782923
2018-02-23 21:09:45 -05:00
Carlos Rafael Giani
4df219f336 gl: Add Mesa3D GBM backend
This makes it possible to use the GStreamer OpenGL elements without a
windowing system if a libdrm- and Mesa3D-supported GPU is present

https://bugzilla.gnome.org/show_bug.cgi?id=782923
2018-02-23 21:09:45 -05:00
Nicolas Dufresne
977a2d04fd roi-meta: Fix bad doc comment syntax 2018-02-22 16:11:20 -05:00
Guillaume Desmottes
f5855d50ad videometa: add support for downstream parameters to ROI meta
The current GstVideoRegionOfInterestMeta API allows elements to detect
and name ROI but doesn't tell anything about how this information is
meant to be consumed by downstream elements.
Typically, encoders may want to tweak their encoding settings for a
given ROI to increase or decrease their quality.
Each encoder has its own set of settings so that's not something that
can be standardized.

This patch adds encoder-specific parameters to the meta which can be
used to configure the encoding of a specific ROI.

A typical use case would be: source ! roi-detector ! encoder
with a buffer probe on the encoder sink pad set by the application.
Thanks to the probe the application will be able to tell to the encoder
how this specific region should be encoded.

Users could also develop their specific roi detectors meant to be used with a
specific encoder and directly putting the encoder parameters when
detecting the ROI.

https://bugzilla.gnome.org/show_bug.cgi?id=793338
2018-02-21 12:30:10 -05:00
Mikhail Fludkov
d7397f0235 rtpbuffer.h: Add new RTPBuffer flags
These flags will be used for Forward Error Correction purposes

https://bugzilla.gnome.org/show_bug.cgi?id=792695
2018-02-21 12:45:41 +01:00
Tim-Philipp Müller
41d7356fa1 meson: fix multi-line string
https://bugzilla.gnome.org/show_bug.cgi?id=793629
2018-02-20 11:52:43 +00:00
Thiago Santos
400ea72b06 pbutils: add some missing gi annotations
For allow-none parameters
2018-02-19 11:23:40 -08:00
Tim-Philipp Müller
4fe5178957 appsrc: don't signal the GCond if no one is waiting on it
Performance optimisation: Keep track whenever the streaming
thread or the application thread are waiting on the GCond for
more space or new data, and only signal on the GCond if someone
is actually waiting. Avoids unnecessary syscalls and thus
context switches.
2018-02-19 16:04:22 +00:00
Tim-Philipp Müller
5a5a1f0dc6 appsrc: use GstQueueArray instead of GQueue for internal item queue
Performance optimisation.

Avoids alloc/free churn for the queue's list nodes.

Depends on new API in GstQueueArray in core.
2018-02-19 16:04:15 +00:00
Tim-Philipp Müller
0846ceef59 appsink: don't signal the GCond if no one is waiting on it
Performance optimisation: Keep track whenever the streaming
thread or the application thread are waiting on the GCond
for more space or new data, and only signal on the GCond if
someone is actually waiting. Avoids unnecessary syscalls and
thus context switches.
2018-02-19 16:03:39 +00:00
Tim-Philipp Müller
8b22d47057 appsink: use GstQueueArray instead of GQueue for internal item queue
Performance optimisation.

Avoids alloc/free churn for the queue's list nodes.
2018-02-19 16:03:06 +00:00
Víctor Manuel Jáquez Leal
1784f62895 gl/wayland: Memory leak when display couldn't connect
When trying to create a wayland display, it may fail because there
is not actually display to connect. It this case NULL is returned
but the created instance is not freed.

This patch unrefs the failed display.

https://bugzilla.gnome.org/show_bug.cgi?id=793483
2018-02-16 13:56:50 +01:00
Mathieu Duponchelle
06ae49f525 audio-converter: fix declaration-after-statement 2018-02-15 21:08:08 +01:00
Mathieu Duponchelle
9cf4293bde audio-converter: add a convenience conversion method
This is useful from python bindings

https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Mathieu Duponchelle
6a4a82f355 gst_audio_converter_new: update annotations
https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Mathieu Duponchelle
9046e6001b AudioConverter: register as boxed type
https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Mathieu Duponchelle
3d50d0e8b0 audio-info: annotate gst_audio_info_set_format
https://bugzilla.gnome.org/show_bug.cgi?id=793492
2018-02-15 20:51:30 +01:00
Edward Hervey
2c4dfa101a Update disted backup ORC files 2018-02-15 07:14:20 +01:00
Mathieu Duponchelle
73d2031ffc gstaudiopack.orc: pack_u32be_swap: actually swap
Fixes:

gst-launch-1.0 audiotestsrc ! audio/x-raw, format=U32BE ! \
audioconvert ! autoaudiosink
2018-02-15 01:32:54 +01:00
Nicolas Dufresne
f2726a2b4a doc: Fix since marker in dmabuf to match a stable release 2018-02-14 14:16:14 -05:00
Nicolas Dufresne
7d8208912a doc: Remove extra . after Since marker 2018-02-14 14:14:58 -05:00
Nicolas Dufresne
f0cbe02541 doc: Fix Since 1.X marker on new video formats 2018-02-14 14:10:22 -05:00
Tim-Philipp Müller
54655196e7 audioaggregator: remove declaration for function that doesn't exist 2018-02-13 17:16:53 +00:00
Tim-Philipp Müller
4984c84505 docs: add GstAudioAggregator to docs 2018-02-13 17:10:42 +00:00
Tim-Philipp Müller
4647d6684f GstAudioAggregator: hook up to build
https://bugzilla.gnome.org/show_bug.cgi?id=791218
2018-02-13 16:09:09 +00:00
Tim-Philipp Müller
ab758a9a39 audioaggregator, audiomixer, audiointerleave: move from -bad to -base
https://bugzilla.gnome.org/show_bug.cgi?id=791218
2018-02-13 15:56:49 +00:00
Tim-Philipp Müller
992fb96843 gl: g-i: expose platform-specific display API in bindings
https://bugzilla.gnome.org/show_bug.cgi?id=786391
2018-02-08 17:00:31 +00:00
Sebastian Cote
9e77d9cacf rtspconnection: also add Content-Type to HTTP POST request when tunnelling
When the GstRTSPConnection class sends a RTSP over HTTP tunnelling
request, the HTTP Content-Type header is missing from the HTTP POST
request.

This isn't a problem with most servers, but there are servers that
rejects the request without there also being a Content-Type header.

RFC 1945:
Any HTTP/1.0 message containing an entity body should include a
Content-Type header field defining the media type of that body.

Apple Dispatch 28:
QuickTime Streaming uses the "application/x-rtsp-tunnelled" MIME
type in both the Content-Type and Accept headers. This reflects
the data type that is expected and delivered by the client and server.

https://bugzilla.gnome.org/show_bug.cgi?id=793110
2018-02-08 16:08:03 +00:00
Matthew Waters
bc604f3597 gl: remove more deprecated type aliases
Additions on top of

https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=32a17f313494cbadaf8ec4e337d742e8d7e1b67b
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=c8b99139b1ef3f8891548b0f2607a135917c338e
2018-02-08 21:14:56 +11:00
Matthew Waters
54701ceb40 gl/display/egl: Fix precondition in display_egl_get_from_native
We don't really want type=NONE as input and it was already impossible
for that to occur with the other condtions.

CID #1427144
2018-02-08 16:16:59 +11:00
Nicolas Dufresne
bc3f9b53fa video: Fix GRAY10_LE32 depth information 2018-02-07 14:48:00 -05:00
Sebastian Dröge
30833f6242 video: Change struct padding from void* to gpointer
gobject-introspection causes inconsistent type information for the
former and we use gpointer everywhere else.
2018-02-07 18:40:49 +02:00
Nicolas Dufresne
eb7565b60e video-format: Fix 10LE32 formats packing function
The source offset (soff) was not incremented for each component and then
each group of 3 components were inverted. This was causing a staircase
effect combined with some noise.

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-02-06 16:18:40 -05:00
Philippe Normand
c8b99139b1 glcontext: remove deprecated type alias
Now for real without un-needed comments...
2018-02-06 16:13:07 +00:00
Philippe Normand
32a17f3134 glcontext: remove deprecated type alias 2018-02-06 16:08:47 +00:00
Matthew Waters
90198daed1 gl: some annotation fixes 2018-02-05 14:58:06 +11:00
Matthew Waters
576f4e0c64 gl/build/meson: fix gl_api variable names 2018-02-05 14:56:07 +11:00
Matthew Waters
e620cf32cf glmemory: fixup GL_RGB565 usage when performing texsubimage
An additional change for the texsubimage use case on top of
https://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=c2b2c68beaddbea0ec4fe7b099507cc492f6dd7c
https://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=ea6bed111bab9b394d787f7760c6a3b953630d3a

https://bugzilla.gnome.org/show_bug.cgi?id=783066
https://bugzilla.gnome.org/show_bug.cgi?id=792584
2018-02-01 23:30:51 +11:00
Tim-Philipp Müller
c443e33a3a meson: use built-in pic kwarg when building static helper libs
instead of passing -fPIC manually.
2018-01-30 20:33:17 +00:00
Nicolas Dufresne
17b118c120 glimagesink: Allow resetting render rectangle
As documented, passing -1 to x and/or y should reset the render
rectangle to the window/display size.

https://bugzilla.gnome.org/show_bug.cgi?id=792798
2018-01-30 09:58:14 +00:00
Nicolas Dufresne
c70dd75f12 video-overlay: Add helpers for render-rectangle property
This is a set of helper that makes it easy to enable the render
rectangle to be controllable through a property.

https://bugzilla.gnome.org/show_bug.cgi?id=792798
2018-01-29 16:26:09 +00:00
Nicolas Dufresne
c256e96047 video: Add NV16_10LE32 support
This adds a 10 bit variant for NV16 packed into 32 bits little endian
words. The MSB 2 bits are padding. This format is used on Xilinx SoC and
identified with the FOURCC XV20.

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Nicolas Dufresne
f7a27d7403 video: Add GRAY10_LE32 support
This add a 10bit variant of gray scale packed into 32bits little endian
words. The MSB 2 bits are padding and should be ignored. This format is
used on Xilinx SoC and is identified with the FOURCC XV10.

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Nicolas Dufresne
2b9725d0df video: Add NV12_10LE32 support
This adds a 10bit variant for NV12 which packs 3 10bit components
into little endian 32bit words. The MSB 2 bits are padding and should be
ignored. This format is used on Xilinx SoC and is identified with there
with the FOURCC XV15

https://bugzilla.gnome.org/show_bug.cgi?id=789876
2018-01-29 16:01:34 +00:00
Mathieu Duponchelle
a4f609f847 videoaggregatorpad: implement skip_buffer
Skip buffers from sources with a framerate higher than the output
framerate.

https://bugzilla.gnome.org/show_bug.cgi?id=781928
2018-01-23 20:19:38 +01:00
Tim-Philipp Müller
29534c3829 Update for renamed aggregator pad API
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:01:00 +00:00
Tim-Philipp Müller
944f74b834 Update for renamed aggregator pad API
https://bugzilla.gnome.org/show_bug.cgi?id=791204
2018-01-23 09:01:00 +00:00
Tim-Philipp Müller
a1af74feda tag: id3v2: don't leak stack pointer outside of block where it's valid
https://bugzilla.gnome.org/show_bug.cgi?id=788548
2018-01-19 20:43:57 +00:00
Roland Peffer
0ffc2015aa meson: gl: fix build on windows
https://bugzilla.gnome.org/show_bug.cgi?id=791772
2018-01-16 13:59:08 +00:00
Tim-Philipp Müller
df0831ce57 meson: fix check whether both gles2 and opengl headers can be included
cc.compiles() doesn't support the prefix: kwarg currently, so it
never had any effect.

https://github.com/mesonbuild/meson/issues/2364
https://bugzilla.gnome.org/show_bug.cgi?id=787964
2018-01-16 11:27:18 +00:00
Matthew Waters
b25413fb1c gl/wayland: move roundtrip on show to window thread
This makes it thread safe and fixes a possible deadlock.

Keeping the roundtrip off the window thread will result in two different
threads call wl_display_dispatch_queue() for the same queue which
violates the assumption for _dispatch_queue()'s thread-safety
guarantees.

https://bugzilla.gnome.org/show_bug.cgi?id=788754
https://bugzilla.gnome.org/show_bug.cgi?id=792156
https://bugzilla.gnome.org/show_bug.cgi?id=758984
2018-01-04 15:39:36 +11:00
Tim-Philipp Müller
c117460420 glcolorconvert: re-enable -Wformat-nonliteral warning
We can pass string constants here to g_strdup_printf(),
so do so and re-enable the -Wformat-nonliteral warning
we had to disable when merging the opengl libs.
2018-01-03 09:21:49 +00:00
Tim-Philipp Müller
ae4f9aebcc glcolorconvert: fix missing printf arg for apple rectangular texture case
Found by -Wformat-nonliteral (to be re-enabled in a separate commit).
2018-01-03 09:21:38 +00:00
Philippe Normand
81f8257354 gl: cocoa: fix formatting for function definition
This is a follow-up of 5d35e1fa15
2017-12-30 12:29:13 +00:00
Philippe Normand
5d35e1fa15 gl: cocoa: Implement set_render_rectangle
Resize the internal NSView according to the provided render rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=791445
2017-12-30 12:24:12 +00:00
Tim-Philipp Müller
d679f752f1 gl: don't link to system gstallocators
We already link to the in-tree gstallocators, no need
to link to it again here, which also ends up being the
system gstallocators lib.

https://bugzilla.gnome.org/show_bug.cgi?id=791956
2017-12-26 15:36:44 +01:00
Miguel Paris
bae3636197 rtp: fix gst_rtp_buffer_ext_timestamp taking into account backwards
If timestamp goes forwards more than allowed, we consider that the
timestamp belongs to the previous counting, so the extended timestamp
is unwrapped.

https://bugzilla.gnome.org/show_bug.cgi?id=783443
2017-12-21 17:27:42 -05:00
Edward Hervey
558b37d889 audioaggregator: Don't leak pads
all audioaggregator subclasses were leaking the first sink pad :)
2017-12-20 15:03:44 +01:00
Mathieu Duponchelle
164b5a7f94 audioaggregator: implement input conversion
https://bugzilla.gnome.org/show_bug.cgi?id=786344
2017-12-19 23:39:37 +01:00
Tim-Philipp Müller
0dd66648c3 gl: fix up a few more #if HAVE_FOO
error: "HAVE_PNG" is not defined, evaluates to 0 [-Werror=undef]
2017-12-19 16:51:24 +00:00
Tim-Philipp Müller
6559bd75ac allocators: fix meson build after physmem move from -bad 2017-12-19 12:44:35 +00:00
Josep Torra
70f93db181 gl: cocoa: fix a warning when building in MacOS 10.12
gstglwindow_cocoa.m:186:60: error: incompatible pointer types sending 'GstGLContextCocoa *'
(aka 'struct _GstGLContextCocoa *') to parameter of type 'GstGLContext *' (aka 'struct _GstGLContext *')
2017-12-19 12:42:29 +00:00
Víctor Manuel Jáquez Leal
7b8108a4ca gl: display: demote error level at display creation error
https://bugzilla.gnome.org/show_bug.cgi?id=791391
2017-12-19 12:41:00 +00:00
Tim-Philipp Müller
8227135f3b gl: hook up to build system
Tests and documentation will follow separately.

The mixer elements in the opengl plugin need to stay
in -bad for now since they use GstVideoAggregator.

https://bugzilla.gnome.org/show_bug.cgi?id=754094
2017-12-19 12:01:48 +00:00
Tim-Philipp Müller
59fe9c9122 gl: remove GST_USE_UNSTABLE_API bits 2017-12-19 12:01:37 +00:00
Sebastian Dröge
1aec533d21 allocators: move GstPhysMemoryAllocator abstraction from -bad to -base
This can be used in a generic way as common interface by all platforms
that, in one way or another, pass around physical memory addresses.

This is used by the gl lib and seems useful enough, so might just as
well move it next to the other allocators.

https://bugzilla.gnome.org/show_bug.cgi?id=779067
2017-12-19 12:01:26 +00:00
Tim-Philipp Müller
cdbb261d9c Move OpenGL library and plugin from -bad
Merge branch 'opengl-move'

https://bugzilla.gnome.org/show_bug.cgi?id=754094
2017-12-19 12:00:43 +00:00
Nicolas Dufresne
b769f02261 gldisplay: Prefer wayland over X11
As most Wayland compositors supports XWayland, X11 backend get
selected. This also realign better GStreamer decision to what
happens with GTK and other stack out there.
2017-12-09 19:32:31 +00:00
Nicolas Dufresne
4cb1a1ca97 gldisplay: Add missing GL API to the doc 2017-12-09 19:32:31 +00:00
Matt Fischer
c98f92ee03 gldownload: Add dmabuf exporting
This patch adds code to gldownload to export the image as a
dmabuf if requested.  The element now exposes memory:DMABuf as
a cap feature, and if it is selected, the element exports the
texture to an EGL image and then a dmabuf. It also implements a
fallback to system memory download in case the exportation failed.

https://bugzilla.gnome.org/show_bug.cgi?id=776927
2017-12-09 19:32:31 +00:00
Matthew Waters
1abd0804f4 gl/caopengllayer: use public GstGLContext instead of Cocoa-specific one
Allows keeping the GstGLCAOpenGLLayer public but not the winsys-specific
context/display/window.
2017-12-09 19:32:31 +00:00
Matthew Waters
6533e25e9c Revert "gl: cocoa: sprinkle some GST_EXPORT"
This reverts commit 94d798c333.

cocoac headers don't need to be public as all the functionality can be
provided by the base class
2017-12-09 19:32:31 +00:00
Tim-Philipp Müller
84249c6f55 gl: cocoa: sprinkle some GST_EXPORT
Undefined symbols for architecture x86_64:
  "_gst_gl_context_cocoa_get_type", referenced from:
      __create_layer in libgstopengl_la-caopengllayersink.o

Might need some more in other headers, but first need to
clarify what exactly should be exported, there are some
inconsistencies (installed header files vs. funcs in docs).
2017-12-09 19:32:31 +00:00
Jan Schmidt
a4834c4352 viv-fb: Don't destroy the native FB display
It causes crashes in applications because the result of
fbGetDisplay() might be in use elsewhere in the application
and Vivante doesn't seem to do any refcounting
2017-12-09 19:32:31 +00:00
Jan Schmidt
7d1f3db884 Revert "gl: Use GstGLDisplayEGL directly instead of creating a GstGLDisplayVIVFb subclass"
This reverts commit 47fd4d391e.

This patch is incorrect. It doesn't actually compile, and causes a crash
because the viv-fb window implementation needs a native EGL handle
to pass to fbCreateWindow, but the GstGLDisplayEGL handleis actually
an EGLDisplay now (and gets cast to the wrong type)
2017-12-09 19:32:31 +00:00
Tim-Philipp Müller
4e2ede5e6d meson: remove outdated comment in build file 2017-12-09 19:32:31 +00:00
Edward Hervey
5915f45e27 all: Fix left-shift undefined behaviour
Cast to the target type before shifting (or use macro if available)
2017-12-09 19:32:31 +00:00
Matthew Waters
5345acac54 glbasefilter: actually indicate start internally
Otherwise when we stop, the necessary stop functions will not be called
and things may be leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=788280
2017-12-09 19:32:30 +00:00
Matthew Waters
a534d8d74c gl/shader: allow setting non-square matrices as uniforms on gles platforms
It is possible with GLES3
2017-12-09 19:32:30 +00:00
Matthew Waters
fab729c61f gl/query: split tests and fix some corresponding issues in usage 2017-12-09 19:32:30 +00:00
Jérôme Laheurte
247e232ec4 Use value instead of version macro when testing for mac OS version
https://bugzilla.gnome.org/show_bug.cgi?id=788404
2017-12-09 19:32:30 +00:00
Cassandra Rommel
2ed379c732 gl: Use GstGLDisplayEGL directly instead of creating a GstGLDisplayVIVFb subclass
This simplifies the code a lot without any functional changes apart from
not closing the display connection. Closing the display connection is
not safe to do as it is shared between all other code in the same
process and no reference counting or anything happens at the platform
layer.
2017-12-09 19:32:30 +00:00
Justin Kim
5b35e2339a glcontext_egl: Add gstglwindow header
Otherwise, compiler complains implicit function declaration warning.

https://bugzilla.gnome.org/show_bug.cgi?id=788413
2017-12-09 19:32:30 +00:00
Ponnam Srinivas
e686f1b628 glfilter: Unmap video frame in error case
https://bugzilla.gnome.org/show_bug.cgi?id=788194
2017-12-09 19:32:30 +00:00
Haihua Hu
c33fc416b2 gl/viv-fb: transform screen coordinate to viewport coordinate
In y direction, screen coordinate are opposite to viewport coordinate.

https://bugzilla.gnome.org/show_bug.cgi?id=787394
2017-12-09 19:32:30 +00:00
Haihua Hu
8ef4a7ddaf gl/viv-fb: fix wrong pos (x,y) calculate in queue_resize
queue_resize viewport coordinate calculate is wrong and
force queue_resize when do _set_render_rectangle in case
user input pos changed

https://bugzilla.gnome.org/show_bug.cgi?id=787394
2017-12-09 19:32:30 +00:00
Nicolas Dufresne
707385690d Request minimum buffer even if need_pool is FALSE
When tee is used, it will not request a pool, but still it wants to
know how many buffers are required.

https://bugzilla.gnome.org/show_bug.cgi?id=730758
2017-12-09 19:32:30 +00:00
Matthew Waters
a5aff145a2 gl/wayland: call eglTerminate() before wl_display_disconnect()
Calling these two functions in the wrong order will result in
use-after-free inside wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=787293
2017-12-09 19:32:30 +00:00
Matthew Waters
143f9abf49 gtkglsink: expose the created display and context correctly
1. Propagate the GstGLDisplay we create
2. Add the created GstGLContext to the propagated GstGLDisplay

Otherwise with multi-branch GL pipelines involving gtkglsink, things
will fall apart and errors will be genarated somewhere.
2017-12-09 19:32:30 +00:00
Matthew Waters
ed7d0c48f6 gl: fix build for ios/win32/android after 2fd84a6c
Some missing GL includes.
2017-12-09 19:32:30 +00:00
Tim-Philipp Müller
ccb27e7317 gl: install new glfuncs.h header 2017-12-09 19:32:30 +00:00
Matthew Waters
66bdef894a gl/meson: add build for the vivante fb backend 2017-12-09 19:32:30 +00:00
Matthew Waters
e15f116de2 gl/meson: detect valid configuration from enabled apis/platform/winsys 2017-12-09 19:32:30 +00:00
Matthew Waters
00498d2b30 gl/build: also check for the GL/gl.h header
In order to successfully build against a detected libGL library we also need headers
2017-12-09 19:32:30 +00:00
Matthew Waters
21252d450c glutils: fix matrix operations everywhere
- correct the matrix multiplication
- Use column-major matrices
  - reverse order of matrix multiplications

https://bugzilla.gnome.org/show_bug.cgi?id=785980
2017-12-09 19:32:30 +00:00
Philippe Normand
0214f4fb55 gl/cocoa: fix build after commit 2fd84a6c 2017-12-09 19:32:30 +00:00
Julien Isorce
4952fdd956 gl: do not include GL headers in public gstgl headers
Except for gst/gl/gstglfuncs.h

It is up to the client app to include these headers.
It is coherent with the fact that gstreamer-gl.pc does not
require any egl.pc/gles.pc. I.e. it is the responsability
of the app to search these headers within its build setup.

For example gstreamer-vaapi includes explicitly EGL/egl.h
and search for it in its configure.ac.

For example with this patch, if an app includes the headers
  gst/gl/egl/gstglcontext_egl.h
  gst/gl/egl/gstgldisplay_egl.h
  gst/gl/egl/gstglmemoryegl.h
it will *no longer* automatically include EGL/egl.h and GLES2/gl2.h.
Which is good because the app might want to use the gstgl api only
without the need to bother about gl headers.

Also added a test: cd tests/check && make libs/gstglheaders.check

https://bugzilla.gnome.org/show_bug.cgi?id=784779
2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
b6e65172fe gl: fix build
Include private headers for parent class debug categories.
2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
62069a9dc6 gl: add missing new header files
https://bugzilla.gnome.org/show_bug.cgi?id=786170
2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
1ddde50048 gl: make some debug categories private
They weren't supposed to be public.

https://bugzilla.gnome.org/show_bug.cgi?id=786170
2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
4be04f8315 gl: don't export symbols that are not supposed to be public
Make a bunch of symbols private that are currently leaked
accidentally because they have a gst_* prefix and are used
internally. We mark those we can't make static with
G_GNUC_INTERNAL so that they get hidden with the autotools
build as well (although we could just pass -fvisibility=hidden
there too).
2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
150511d931 gl: sprinkle more GST_EXPORT 2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
fbb62097e7 gl, wayland: mark more declared functions with GST_EXPORT 2017-12-09 19:32:29 +00:00
Julien Isorce
a50c09ac26 gl: return NULL mem if eglCreateImage failed
Found on rpi when gpu_mem is too low so there is not enough memory to
create the eglimage. But still gst_buffer_pool_acquire_buffer succeeded.
And it leads to a CRITICAL assert:
  gst_egl_image_get_image: assertion 'GST_IS_EGL_IMAGE (image)' failed

https://bugzilla.gnome.org/show_bug.cgi?id=785518
2017-12-09 19:32:29 +00:00
Matthew Waters
5c4b47e615 gl: document missing GstGLShader functions 2017-12-09 19:32:29 +00:00
Matthew Waters
82cf1b9c71 gl/docs: some documentation updates
Add some missing/incomplete docs
2017-12-09 19:32:29 +00:00
Matthew Waters
3200e2f00d gl/docs: correctly name our objects in the documentation GstGl -> GstGL 2017-12-09 19:32:29 +00:00
Matthew Waters
99f9bb5612 gl/docs: document GstGLFormat enum 2017-12-09 19:32:29 +00:00
Tim-Philipp Müller
d6766ec881 gl: fix g-i annotations for glframebuffer
gstglframebuffer.c:176: Error: GstGL: annotations not supported for tag "Since:".
2017-12-09 19:32:29 +00:00
Alessandro Decina
b299f70dcf meson: specify fallback for libgmodule_dep
Fixes build with glib built as a subproject.
2017-12-09 19:32:29 +00:00
Edward Hervey
79d5b5151b meson: Fix GLES2 check
On systems without pkg-config, we have the the library present but
not the headers

https://bugzilla.gnome.org/show_bug.cgi?id=785010
2017-12-09 19:32:29 +00:00
Philippe Normand
28a2734184 glwindow_cocoa: fix video overlay support
Make sure the window handle is configured after the NSWindow was created.

https://bugzilla.gnome.org/show_bug.cgi?id=767462
2017-12-09 19:32:29 +00:00
Matthew Waters
d75eb628d6 gl/cocoa: keep refs over async operations
Avoids dereferencing dead objects

What happens in the autovideosink case is that context 1 is created and
destroyed before all the async operations hae executed on the associated
window.  When the delayed operations execute, they then reference dead
objects and crash.

We fix this by keeping refs over all async operations so the object
cannot be deleted while async operations are in flight.

https://bugzilla.gnome.org/show_bug.cgi?id=782379
2017-12-09 19:32:29 +00:00
Matthew Waters
b7698b1613 gl/window/x11: implement set_render_rectangle support
https://bugzilla.gnome.org/show_bug.cgi?id=782959
2017-12-09 19:32:29 +00:00
Jan Schmidt
76bf415a96 glfilter: Remove hard-coded pad templates
Add a function to install the default RGBA pad templates,
but don't make them required so that there can be
GstGLFilter sub-classes with different input/output
caps if they want. Remove the hard-coded RGBA restriction in
the set_caps_features call, as it will be taken care
of by intersecting with the pad templates.

Update all the sub-classes to match
2017-12-09 19:32:29 +00:00
Jan Schmidt
79f52a4943 glupload: Don't throw assertions on invalid allocation query
basesrc can send an allocation query with no caps, in which
case we should just fail it without throwing assertions.
2017-12-09 19:32:29 +00:00
Julien Isorce
575c7bca40 glupload: add GST_CAPS_FEATURE_MEMORY_DMABUF
Insert before SystemMemory to advice upstream elements that it is
preferable for them to push dmabuf with the caps feature.

Examples:

/* Discard memory:DMABuf caps feature */
GST_GL_PLATFORM=egl GST_GL_API=gles2 GST_GL_WINDOW=x11 gst-launch-1.0 \
    filesrc location=test.mp4 ! qtdemux ! h264parse ! vaapih264dec ! \
    capsfilter caps="video/x-raw(memory:SystemMemory)" ! glimagesink

/* Force memory:DMABuf caps feature. */
GST_GL_PLATFORM=egl GST_GL_API=gles2 GST_GL_WINDOW=x11 gst-launch-1.0 \
    filesrc location=test.mp4 ! qtdemux ! h264parse ! vaapih264dec ! \
    capsfilter caps="video/x-raw(memory:DMABuf)" ! glimagesink

/* Auto select memory:DMABuf caps feature.  */
GST_GL_PLATFORM=egl GST_GL_API=gles2 GST_GL_WINDOW=x11 gst-launch-1.0 \
    filesrc location=test.mp4 ! qtdemux ! h264parse ! vaapih264dec ! \
    glimagesink

https://bugzilla.gnome.org/show_bug.cgi?id=774649
2017-12-09 19:32:29 +00:00
Matthew Waters
715639f78c gl: reset gl->DrawBuffer to the necessary values
GL_COLOR_ATTACHMENT0 when a framebuffer is bound
GL_BACK if no framebuffer is bound

https://bugzilla.gnome.org/show_bug.cgi?id=784210
2017-12-09 19:32:29 +00:00
Hyunjun Ko
402d805c90 glmemory: reset the draw buffer to GL_BACK
The draw buffer should be reset to GL_BACK since the framebuffer is already
unbound.

https://bugzilla.gnome.org/show_bug.cgi?id=784210
2017-12-09 19:32:29 +00:00
Nicolas Dufresne
92537b1364 meson: Re-add pkg-config support for bcm_host
Now we just fallback to find_library for Rasbian jessy and older.

https://bugzilla.gnome.org/show_bug.cgi?id=784026
2017-12-09 19:32:29 +00:00
Guillaume Desmottes
581161ecd7 gl: meson: use cc.find_library() to detect 'bcm_host'
On the raspberry pi no pkg-config file is provided for the bcm_host
library. We are using AC_CHECK_LIB to detect this lib with autotools,
cc.find_library() library is a closer meson equivalent.

https://bugzilla.gnome.org/show_bug.cgi?id=784026
2017-12-09 19:32:28 +00:00
Sebastian Dröge
70715b5181 gl/cocoa: Put gstglwindow_cocoa.h into noinst_HEADERS again
And remove gstgldisplay_cocoa.h instead, which got moved to the
installed headers earlier.
2017-12-09 19:32:28 +00:00
Sebastian Dröge
59db0ee4e1 glupload: Fix DirectVIV uploader for formats with a single plane
We have to pass the "height" as height = vmeta->offset[1] / width to the
API, which of course does not work well for formats with only a single
plane. Use the whole memory size instead of the offset in that case.
2017-12-09 19:32:28 +00:00
Jeremy Hiatt
4511b34e00 glutils: Fix GValue leak in gst_gl_value_set_texture_target_from_mask() 2017-12-09 19:32:28 +00:00
Sebastian Dröge
0572c41c28 gl: Fix indentation 2017-12-09 19:32:28 +00:00
Sebastian Dröge
4cac59d222 glframebuffer: #define GL_READ_FRAMEBUFFER / GL_DRAW_FRAMEBUFFER if not defined yet
Just like we do elsewhere already.
2017-12-09 19:32:28 +00:00
Haihua Hu
ea6bed111b glformat: fix the usage of GST_GL_RGB565
GL_RGB565 is sized internal glformat, the corresponding glformat
should be GL_RGB and type is GL_UNSIGNED_SHORT_565. Otherwise will
return GL_INVALID_ENUM when creating texture.

https://bugzilla.gnome.org/show_bug.cgi?id=783066
2017-12-09 19:32:28 +00:00
Haihua Hu
2fc05e90d8 glframebuffer: check frame buffer status need use specific fbo target
https://bugzilla.gnome.org/show_bug.cgi?id=783065
2017-12-09 19:32:28 +00:00
Carlos Rafael Giani
cdd4f4532c gl/viv-fb: Fix user-choice string comparisons
https://bugzilla.gnome.org/show_bug.cgi?id=782921
2017-12-09 19:32:28 +00:00
Tim-Philipp Müller
70e2b4b416 gl: x11: fix compiler warning 2017-12-09 19:32:28 +00:00
Matthew Waters
4c75bab70d glcontext: add public swap_buffers function
That simply calls the implementation
2017-12-09 19:32:28 +00:00
fvanzile
178bbc253d glcontext: keep a ref to the active thread
With the macOS/iOS implementations, the active thread can change
multiple times over the life of a pipeline which would expose a race in
the thread tracking.

Fix by taking a ref on the active thread while the context is active.

https://bugzilla.gnome.org/show_bug.cgi?id=779202
2017-12-09 19:32:28 +00:00
Josep Torra
ffb9559849 cocoa: fix a recently introduced typo
Fixes gstgldisplay_cocoa.m:175:26: error: use of undeclared identifier 'singletone'.
2017-12-09 19:32:28 +00:00
Josep Torra
88a4d06735 cocoa: fix macOS 10.12 deprecation warnings
Add #defines to allow older versions of macOS to use the new constant names.
2017-12-09 19:32:28 +00:00
Haihua Hu
479b95205f glformat: Add missing GST_GL_RGB565 in some switch statement
https://bugzilla.gnome.org/show_bug.cgi?id=782736
2017-12-09 19:32:28 +00:00
Sebastian Dröge
f32e8bc4b2 cocoa: Install gstgldisplay_cocoa.h
It's needed by e.g. qmlglsink.
2017-12-09 19:32:28 +00:00
Sebastian Dröge
a9a05c01a9 gst: Clear floating flag in constructor of all GstObject subclasses that are not owned by any parent
https://bugzilla.gnome.org/show_bug.cgi?id=743062
2017-12-09 19:32:28 +00:00
Nicolas Dufresne
e004cfd6fe Remove plugin specific static build option
Static and dynamic plugins now have the same interface. The standard
--enable-static/--enable-shared toggle are sufficient.
2017-12-09 19:32:27 +00:00
Sebastian Dröge
6b1fa09077 glshader: Make reference counting of attach() consistent
https://bugzilla.gnome.org/show_bug.cgi?id=747990
https://bugzilla.gnome.org/show_bug.cgi?id=702960
2017-12-09 19:32:27 +00:00
Matthew Waters
d47a515315 build/gl/meson: check for GLES3/gl3ext.h existence
791e7522eb for meson

https://bugzilla.gnome.org/show_bug.cgi?id=781885
2017-12-09 19:32:27 +00:00
Jens Georg
73af514e1a build: Check for GLES3/gl3ext.h existence
Some OpenGL drivers do not ship this but use GLES2/gl2ext.h instead.
This is also in line with Khronos's recommendations

https://bugzilla.gnome.org/show_bug.cgi?id=781885
2017-12-09 19:32:27 +00:00
Sebastian Dröge
aef461d4a0 glmemory: Only use glDrawBuffer if available
Otherwise fall back to glDrawBuffers. Also check if glReadBuffer exists
before using it.

glDrawBuffer does not exist for GLES, only glDrawBuffers does.

https://bugzilla.gnome.org/show_bug.cgi?id=782376
2017-12-09 19:32:27 +00:00
Haihua Hu
e2ff120d97 glupload: passthrough composition caps features in directviv upload
https://bugzilla.gnome.org/show_bug.cgi?id=782046
2017-12-09 19:32:27 +00:00
Thibault Saunier
95ac4d5175 docs: Port all docstring to gtk-doc markdown 2017-12-09 19:32:27 +00:00
Thibault Saunier
b11df33ee2 docs: Stop linking to inexistant symbols 2017-12-09 19:32:27 +00:00
Claudio Saavedra
7566c43130 meson: add missing gstglrenderbuffer.h header
https://bugzilla.gnome.org/show_bug.cgi?id=781179
2017-12-09 19:32:27 +00:00
Scott D Phillips
995d110fe6 meson: gl: set default value of 0 for glconf vars
meson's configure_file emits only a comment like /* #undef ... */
for values which are unset in the configuration_data. For
gstglconfig.h, this differs from the autotools build where the
preprocessor definitions are always either 0 or 1. So loop over a
list of variables to set to zero as default.

Also sync up the gstglconfig.h.meson file with the additional
macros defined by the autotools build.

https://bugzilla.gnome.org/show_bug.cgi?id=781043
2017-12-09 19:32:27 +00:00
Vincent Penquerc'h
326b8763de glcontext: fix display leak
https://bugzilla.gnome.org/show_bug.cgi?id=781019
2017-12-09 19:32:27 +00:00
Vincent Penquerc'h
697cd40ee4 gldisplay: fix list leak
Windows aren't always removed in time, and it turns out to be
very, very hard to remove a window in a way that's not racy and
not deadlocky. Since the window itself doesn't leak, freeing
the list on object destruction is enough.

https://bugzilla.gnome.org/show_bug.cgi?id=781018
2017-12-09 19:32:27 +00:00
Jan Schmidt
920d295c97 gl: Remove duplicate typedef of GstGLFramebufferClass
The GstGLFramebufferClass struct is typedeffed in
gstgl_fwd.h, and having a duplicate elsewhere is
breaking the cerbero build on my OSX machine,
even though it seems to be working in CI.
2017-12-09 19:32:27 +00:00
Josep Torra
2cdce1d75f glwindow/cocoa: fix warnings reported by XCode 8.1.0
gstglwindow_cocoa.m:345:16: error: unused variable 'window' [-Werror,-Wunused-variable]
  GstGLWindow *window = GST_GL_WINDOW (window_cocoa);
               ^
gstglwindow_cocoa.m:445:11: error: unused variable 'external_view' [-Werror,-Wunused-variable]
  NSView *external_view = (__bridge NSView *)priv->external_view;
          ^
2017-12-09 19:32:27 +00:00
Nicolas Dufresne
ae30818f7b gldisplay: Fix assert caused by missing debug category 2017-12-09 19:32:27 +00:00
Scott D Phillips
8d3d6d3595 gl/format: correct return enums in gst_gl_format_from_video_info
In commit

> 956c4d0 gl/format: use our own GL format enum's instead of gstvideo's

the name and return type of gst_gl_format_from_video_info changed,
but some returns of the old type were missed. Here they are
updated to the correct type.

https://bugzilla.gnome.org/show_bug.cgi?id=780064
2017-12-09 19:32:27 +00:00
George Kiagiadakis
6b6a8a46b5 glupload: adjust memory offset calculation for dmabuf buffers
The data in the dmabuf fd may not start from byte 0, therefore
we need to inform EGL about this additional offset.

https://bugzilla.gnome.org/show_bug.cgi?id=779790
2017-12-09 19:32:27 +00:00
Matthew Waters
61ee2685c0 gl: GL_ARRAY_BUFFER is not a part of VAO state
As a result we need to bind it on every draw in order to have the
correct state in the GL state machine.
2017-12-09 19:32:27 +00:00
Matthew Waters
66468b4245 gl/format: use our own GL format enum's instead of gstvideo's
They can describe in more detail (such as component sizes) the requested format.
2017-12-09 19:32:27 +00:00
Vincent Penquerc'h
b71e104d00 glupload: fix GValue leak
https://bugzilla.gnome.org/show_bug.cgi?id=779869
2017-12-09 19:32:27 +00:00
Sebastian Dröge
e976c200b0 gl/eagl: It's -fobjc-arc not -fobj-arc 2017-12-09 19:32:27 +00:00
Nick Kallen
7b42f26b80 applemedia/gl: Update code to use ARC
All code interacting with Objective-C objects should now use Automated
Reference Counting rather than manual memory management or Garbage
Collection. Because ARC prohibits C-structs from containing
references to Objective-C objects, all such fields are now typed
'gpointer'. Setting and gettings Objective-C fields on such a
struct now uses explicit __bridge_* calls to tell ARC about
object lifetimes.

https://bugzilla.gnome.org/show_bug.cgi?id=777847
2017-12-09 19:32:27 +00:00
Arun Raghavan
ee49afed97 gl: Missed one backwards compat define in GST_GL_TYPE_CONTEXT
Continued from 296b4251e3
2017-12-09 19:32:27 +00:00
Sebastian Dröge
a4a8ef5507 gl: Fixup for last commit 2017-12-09 19:32:27 +00:00
Sebastian Dröge
de16dc2555 gl: Fix backwards compat GST_GL_TYPE_* functions/macros
These have to be macros instead of inline function as they must behave
more or less like an integer literal, i.e. include the function call.
2017-12-09 19:32:26 +00:00
Sebastian Dröge
dde95e8270 gl/viv-fb: Don't use deprecated symbols and make macros more consistent
https://bugzilla.gnome.org/show_bug.cgi?id=778825
2017-12-09 19:32:26 +00:00
Sebastian Dröge
f5ea12a471 glcolorconvert: Check return value of gst_gl_context_check_framebuffer_status()
CID 1401588
2017-12-09 19:32:26 +00:00
Sebastian Dröge
6a32795949 gl: Add viv-fb to DIST_SUBDIRS to fix "make distcheck" 2017-12-09 19:32:26 +00:00
Sebastian Dröge
108eef7ac7 glutils: Mark private functions as G_GNUC_INTERNAL 2017-12-09 19:32:26 +00:00
Sebastian Dröge
1c1094e4e7 glupload: Add support for Vivante DirectTexture uploads
Together with the upcoming gstreamer-imx patch, this allows zerocopy
between imxvpudec and other elements and glimagesink.

This is losely based on a patch by Haihua Hu <b55597@freescale.com>
from https://github.com/Freescale/meta-freescale/blob/master/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/

https://bugzilla.gnome.org/show_bug.cgi?id=779067
2017-12-09 19:32:26 +00:00
Sebastian Dröge
ed7c9f70d9 gl: Add support for Vivante EGL FB windowing system
This is very similar to how dispmanx on the Raspberry Pi works.

Based on a patch by Haihua Hu <b55597@freescale.com> from
https://github.com/Freescale/meta-freescale/tree/master/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad

https://bugzilla.gnome.org/show_bug.cgi?id=778825
2017-12-09 19:32:26 +00:00
Sebastian Dröge
a6cbe2a2cb glmemory: Use glBlitFramebuffer() instead of glCopyTexImage2D() if available
glBlitFramebuffer() is new GLES3/GL3 API. They are probably often
implemented in terms of each other, and glBlitFramebuffer() can
potentially be implemented more flexible. Let's use it if available.

Also it actually works on imx6 with DirectVIV textures.

Based on a patch by Haihua Hu <jared.hu@nxp.com> from
https://github.com/Freescale/meta-freescale/blob/master/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/

https://bugzilla.gnome.org/show_bug.cgi?id=779070
2017-12-09 19:32:26 +00:00
Sebastian Dröge
48f79e9f60 configure: Remove unused Mali EGL/fbdev_window support
This existed a long time ago but there's no actual code for this
anymore.
2017-12-09 19:32:26 +00:00
Thibault Saunier
cdec2d0181 meson: Build GIR files 2017-12-09 19:32:26 +00:00
Matthew Waters
ad20a945de gl: update sys dependants for function removals
4315a4b54d forgot to change the androidmedia/videotoolbox/caopengllayer
sources as required.
2017-12-09 19:32:26 +00:00
Juan Pablo Ugarte
c469827ddb glslstage: define GL constants if needed instead of using #ifdef
https://bugzilla.gnome.org/show_bug.cgi?id=777144
2017-12-09 19:32:26 +00:00
Matthew Waters
69da104456 glutils: document functions 2017-12-09 19:32:26 +00:00
Matthew Waters
de6c39189f glutils: privatise matrix multiplication/videoaffinetransformation retrieval 2017-12-09 19:32:26 +00:00
Matthew Waters
ceda9dc1aa gl/utils: also take care of the local GL context in query functions
Simplifies a deduplicates a lot of code in elements retrieving/setting
the local OpenGL context.
2017-12-09 19:32:26 +00:00
Matthew Waters
d00a13f01d glutils: remove trivial helper function
gst_gl_caps_replace_all_caps_features() is only used in two places and can
be trivially reproduced.
2017-12-09 19:32:26 +00:00
Matthew Waters
0348225001 gl/docs: add symbols from -unused.txt 2017-12-09 19:32:26 +00:00
Matthew Waters
0a0a45fefd gl/docs: some type fixes of type names 2017-12-09 19:32:26 +00:00
Matthew Waters
cbc7efdcb6 glwindow: use the same parameter names between vfuncs and functions of the same name
Silences GI warnings about symbol's not being used from source code
comment block
2017-12-09 19:32:26 +00:00
Matthew Waters
e4c7f28bf7 glbasememory: type fix for GstGLBaseMemoryAllocatorAllocFunction 2017-12-09 19:32:26 +00:00
Matthew Waters
738cd580c9 gldisplay: add missing transfer annotations 2017-12-09 19:32:26 +00:00
Matthew Waters
87a4eafaf9 gl: add skip annotations to non-GI possible struct constructors 2017-12-09 19:32:26 +00:00
Matthew Waters
f7d300b28e glbasememory: remove unused and #if 0'ed function definitions 2017-12-09 19:32:26 +00:00
Matthew Waters
31b38a5f54 gl: add necessary get_type() functions for allocation params structures
All using the existing GstGLAllocationParams infrastructure
2017-12-09 19:32:26 +00:00
Matthew Waters
53cc73b5f4 gldisplay: some annotation updates/typo fixes 2017-12-09 19:32:25 +00:00
Matthew Waters
2fa355c761 gl: remove reference to non-existant header
../../../../gst-libs/gst/gl/gl.h:57:45: fatal error: gst/gl/gstglcontrolbindingproxy.h: No such file or directory
 #include <gst/gl/gstglcontrolbindingproxy.h>
                                             ^
2017-12-09 19:32:25 +00:00
Matthew Waters
cfc16f6dae gl: remove custom control binding proxy
Use the existing GstProxyControlBinding instead.
2017-12-09 19:32:25 +00:00
Matthew Waters
a3e593d2a9 gl: remove unneeded gst_gl_buffer_alloc from header file
There's no implementation anymore!
2017-12-09 19:32:25 +00:00
Matthew Waters
e80337e374 gl/egl: remove use of texture orientation 2017-12-09 19:32:25 +00:00
Matthew Waters
cec46fc75e glcontext/egl: don't overwrite set GError
Doing so is an error and will cause a glib warning to be printed.

https://bugzilla.gnome.org/show_bug.cgi?id=776722
2017-12-09 19:32:25 +00:00
Matthew Waters
054b26411a gl/format: use the unsized format for RGB on GLES2
In GLES2 GL_RGB8 doesn't exist so we cannot use it, use GL_RGB
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=776141
2017-12-09 19:32:25 +00:00
Matthew Waters
fe3298993b gl/window: remove unused priv variable
https://ci.gstreamer.net/job/GStreamer-master/7989/console
2017-12-09 19:32:25 +00:00
Matthew Waters
f532e699df gl/window: remove use of main_context_push/pop_thread_default()
No-one's using/depending on it (it would have criticalled and not worked)
and it's causing more problems than it's solving.  Store the GMainContext
in the public struct instead for subclasses to optionally use instead of
relying on the push/pop state to be correct.

https://bugzilla.gnome.org/show_bug.cgi?id=775970
2017-12-09 19:32:25 +00:00
Sebastian Dröge
aeb5d4edaf gst: Don't declare variables inside the for loop header
This is a C99 feature.
2017-12-09 19:32:25 +00:00
Julien Isorce
7da132c327 gstglupload: relax EGL context check
Check for GST_GL_PLATFORM_EGL enum instead of type GstGLContextEGL.

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:25 +00:00
Julien Isorce
22e78529dd gstglcontext: is_shared should return FALSE if no group
If a sub class of GstGLContext does not create a group
then it currently crashes:

0 g_atomic_int_get (&share->refcount)
1 _context_share_group_is_shared (context->priv->sharegroup)
2 gst_gl_context_is_shared
3 _default_set_sync_gl

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:25 +00:00
Matthew Waters
bf7b608728 glmemoryegl: remove spurious #if GST_GL_HAVE_DMABUF conditions
8c2118823b had some incorrect preprocessor
conditions that aren't actually needed.  Remove them.

https://bugzilla.gnome.org/show_bug.cgi?id=775248
2017-12-09 19:32:25 +00:00
Matthew Waters
7306f2de2c glwindow: move g_main_context_push/pop_thread_default() to run()
Calling g_main_context_push_thread and then g_main_context_invoke()
(used by gst_gl_window_send_message_async()) in the same thread will
cause the invoked function to run immediately instead of being delayed.

This had implications for the creation of the OpenGL context not waiting
until the main loop had completely started up and as a result would
sometimes deadlock in short create/destroy scenarios.

https://bugzilla.gnome.org/show_bug.cgi?id=775171
2017-12-09 19:32:25 +00:00
Matthew Waters
f22390e46e glcontext: fix race between creation/shutdown
626bcccff9 removed some locks that
allowed the main loop quit to occur before the context was fully
created.

2776cef25d attempted to readd them but
missed the scop of the quit() call.

Also remove the use of g_thread_join() as that's not safe to use when
it's possible to lose the last reference from the GL thread.

https://bugzilla.gnome.org/show_bug.cgi?id=775171
2017-12-09 19:32:25 +00:00
Sebastian Dröge
46e71e095f gl/x11: Remove unused static function 2017-12-09 19:32:25 +00:00
Matthew Waters
86a9499d5e gl/contextglx: error out on more invalid display/window combinations
https://bugzilla.gnome.org/show_bug.cgi?id=774851
2017-12-09 19:32:25 +00:00
Matthew Waters
afbca8576e gl: add necessary context_egl.h #includes to the source files 2017-12-09 19:32:25 +00:00
Matthew Waters
6992e16d4d gl/memoryegl: remove access to private header gstglcontext_egl.h
It's been removed and thus compiling anything against GstGLMemoryEGL
would error with:

In file included from gstomxvideodec.c:41:0:
usr/include/gstreamer-1.0/gst/gl/egl/gstglmemoryegl.h:32:41: fatal error: gst/gl/egl/gstglcontext_egl.h: No such file or directory
 #include <gst/gl/egl/gstglcontext_egl.h>
                                         ^

https://bugzilla.gnome.org/show_bug.cgi?id=774886
2017-12-09 19:32:25 +00:00
David Evans
7d034ba2d9 gl: add gstreamer-video to pkg-config path
https://bugzilla.gnome.org/show_bug.cgi?id=774624
2017-12-09 19:32:25 +00:00
Matthew Waters
dd31f7934c meson: gl/egl: add missing source file
d42145e8c1 didn't add the necessary
meson build changes.
2017-12-09 19:32:25 +00:00
Matthew Waters
59b65373b0 gl/egl: remove EGLImage functions from egl context
By adding the necessary GstEGLImage entry points to create a GstEGLImage
from a GstGLMemory.

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:25 +00:00
Matthew Waters
39e75767fb glcontext: add vfunc to retrieve the OpenGL platform version
i.e. the version of EGL, GLX, etc implemented.

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:25 +00:00
Matthew Waters
6703641734 gl/egl: move get_error_string() into gstegl
So others can use it without #include-ing a private header

https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:24 +00:00
Matthew Waters
415ce6c96a display/egl: implement getting the EGLDisplay of a specific platform
https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:24 +00:00
Víctor Manuel Jáquez Leal
ddf7fe0e80 gl/egl: check the feature in the extensions list
https://bugzilla.gnome.org/show_bug.cgi?id=774518
2017-12-09 19:32:24 +00:00
Matthew Waters
6e409db6e0 glcontext/cocoa: implement empty swap_buffers
Fixes some GL tests on OS X.
2017-12-09 19:32:24 +00:00
Matthew Waters
569fa380e5 glwindow/cocoa: remove unneeded window code in NSWindow
This is all taken care of by GstGLWindowCocoa/GstGLNSView now.
2017-12-09 19:32:24 +00:00
Matthew Waters
66619ed690 glwindow/cocoa: remove our view from the parent when closing
Otherwise, when the application reuses the same UIView, we were getting
draw notifications on the previous view/layer's which weren't valid anymore
and were referencing pointers that had been freed.

https://bugzilla.gnome.org/show_bug.cgi?id=753003
2017-12-09 19:32:24 +00:00
Matthew Waters
b19e74e02d gl/caopengllayer: add a debug category 2017-12-09 19:32:24 +00:00
Matthew Waters
28d3ab2922 glbufferpool: introduce check for GLMemory allocators
The last missing piece of EGLImage support has been pushed.
2017-12-09 19:32:24 +00:00
Tim-Philipp Müller
0aae67d261 gl: x11-xcb is not a required dependency
Don't fail if it's not found..
2017-12-09 19:32:24 +00:00
Matthew Waters
8a1d31f6ab gl/utils: move gen_shader() to the plugin and remove del_shader()
gst_gl_context_del_shader() can be replaced by a g_object_unref().
gst_gl_context_gen_shader() should be replaced by using GstGLSLStage.
2017-12-09 19:32:24 +00:00
Matthew Waters
e483b092f1 glwindow: remove unused field in public struct 2017-12-09 19:32:24 +00:00
Matthew Waters
2b89a2c348 glwindow: remove is_running() function
It isn't necessary in correctly written programs.
2017-12-09 19:32:24 +00:00
Nirbheek Chauhan
204e68a5b1 meson/gl: XCB changes also need x11-xcb as a dependency
https://ci.gstreamer.net/job/GStreamer-master-meson/380/console

[...]
gst-libs/gst/gl/x11/xcb_event_source.c:98: undefined reference to `xcb_get_file_descriptor'
2017-12-09 19:32:24 +00:00
Philippe Normand
3aee8b8b23 gl/x11: fix meson build
The x11_event_source.[ch] files were renamed in
4f6c226bd2.
2017-12-09 19:32:24 +00:00
Matthew Waters
4abca9f5d0 glwindow: remove the navigation thread
This functionality can now effectively be implemented with the display event
thread.
2017-12-09 19:32:24 +00:00
Matthew Waters
0e56bead42 gl/x11: use xcb instead of libX11
- xcb is supposedly thread-safe!

videotestsrc ! glimagesink now doesn't spuriously result in a
'call XInitThreads()' error however if anybody else is using X11,
then XInitThreads() still needs to be called and multiple glimagesink's
still need XInitThreads().

Everything still takes libX11 handles as they are compatible with the xcb
variants.  Unfortunately we cannot move fully over to xcb due to GLX being
entirely based on Xlib.  It's also impossible to transform a xcb_connection
to a Display which means we require X11 handles.
2017-12-09 19:32:24 +00:00
Matthew Waters
af493eb6b2 gldisplay: add a list of glwindow's
With the event thread on the display, for a particular winsys event
we need to be able to retreive the window that the event matches.
2017-12-09 19:32:24 +00:00
Matthew Waters
3870012f18 gldisplay: add a dedicated event thread
Will take the place of the navigation event thread for dealing with
winsys events.
2017-12-09 19:32:24 +00:00
Matthew Waters
ef70a7beae gl: don't expose OpenGL prototypes
We roll our own to avoid depending a certain OpenGL header version
2017-12-09 19:32:24 +00:00
Matthew Waters
4a1d23ea85 gl/cocoa: don't install the gstglcontext_cocoa.h header
It's not needed to be exposed
2017-12-09 19:32:24 +00:00
Matthew Waters
50f60c9ae9 gl/android: don't install the android window header
It's not needed
2017-12-09 19:32:24 +00:00
Matthew Waters
d0b8f7c002 gl: add padding to all exposed winsys/platform-specific structs 2017-12-09 19:32:24 +00:00
Matthew Waters
d7d42971ab gl/wayland: install the gstgldisplay_wayland.h header
As it is used by other OpenGL sinks (gtkglsink, qmlglsink)
2017-12-09 19:32:24 +00:00
Matthew Waters
9d295ed19b gl/egl: don't install the gstglcontext_egl.h header
It's not needed to be exposed and there are no users of the API.
2017-12-09 19:32:24 +00:00
Matthew Waters
181dacc77e glfilter: remove display_init/reset
They are mirrors of GstGLBaseFilter's gl_start() and gl_stop() virtual methods
so use them instead.
2017-12-09 19:32:23 +00:00
Matthew Waters
873466a1f1 gldisplay: Fix inverted precondition
A GError argument must either be null or point to a NULL GError.

https://developer.gnome.org/glib/stable/glib-Error-Reporting.html
2017-12-09 19:32:23 +00:00
Matthew Waters
62d0bac993 gl/gi: some annotation updates for called functions
With scope, closure, destroy annotations
2017-12-09 19:32:23 +00:00
Matthew Waters
3ef6af7b0f gl/gi: also include GstVideo
Removes all the unknown type GstVideo* warnings while building the GIR
file.
2017-12-09 19:32:23 +00:00
Matthew Waters
c6c7f421e3 glfeature: move internal functions into a private header
Don't expose them to the outside world
2017-12-09 19:32:23 +00:00
Matthew Waters
18ac98c58b gl: GST_GL_TYPE -> GST_TYPE_GL
Some deprecated symbols are kept for backwards compatibility
2017-12-09 19:32:23 +00:00
Matthew Waters
9bafa08a5d gl/docs: massive update
- add Since: markers where necessary.
- document structs
- add documentation headers for each module (short_description,
  see_also, etc)
- reduce the number of warnings gtk-doc outputs
- fix spelling mistakes
2017-12-09 19:32:23 +00:00
Matthew Waters
51a6f47bf8 gl/docs: document new API added in 1.10
GstGLRenderbuffer
GstGLFramebuffer
GstGLQuery
GstEGLImage
GstGLMemoryEGL
2017-12-09 19:32:23 +00:00
Matthew Waters
8faebcf915 glsl: fix #version 150 not working with profiles
The spec allows the core/compatibility profiles to be used
with #version 150.

Also tighten up the tests to check for default profiles being chosen
correctly.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
a3968fa896 build: Also need to define GST_EXPORTS for Autotools
The change to use GST_EXPORT for symbols under Windows requires
GST_EXPORTS for internal use, and that is also needed under Autotools.
The same thing is done for gstreamer-1.0.dll in -core.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
d57808385c gstgl: Re-enable WINAPI on _MSC_VER
The calling convention may be deprecated, but we still need it for
OpenGL. The build issue was caused by an incorrect syntax being used for
the WINAPI (__stdcall) prototype in function pointers which was accepted
by GCC but is rejected by MSVC.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
503822eb20 Explicitly define float constants as float
With MSVC, this gives the following warning:

warning C4305: 'function': truncation from 'double' to 'gfloat'

Apparently, MSVC does not figure out what type to use for constants
based on the assignment. This warning is very spammy, so let's try to
fix it.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
6106816f50 gstgl: Add GST_EXPORT to all symbols used on Windows
This is a requirement for those symbols to be exported in gstgl-1.0.dll
when building with the MSVC compiler
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
c7c2a68de2 meson: Add support for building WGL on Windows
Currently only tested with MSVC.
2017-12-09 19:32:23 +00:00
Nirbheek Chauhan
45ad33c94c gstgl: Porting fixes for MSVC with Meson
GL/gl.h needs windows.h on MSVC

WINAPI should not be used with MSVC. It also causes a build error.
2017-12-09 19:32:23 +00:00
Matthew Waters
08e20ff131 glsyncmeta: don't glFinish() everytime a sync point is set
At minimum, we only need to glFlush() if we are in a shared GL context
environment.  Move the glFinish() to when the actual wait is requested
which may be never.  Improves the throughput on older GL systems without
GL3/GLES3 and/or fence sync objects.
2017-12-09 19:32:23 +00:00
Matthew Waters
99f5ac40db meson: gl: add support for building with dispmanx on the rpi 2017-12-09 19:32:23 +00:00
Matthew Waters
36b8ed8712 gl/eglimage: Fix passing the destroy function to gst_egl_image_new_wrapped
The function pointer and the user data arguments were swapped in both
uses.

https://bugzilla.gnome.org/show_bug.cgi?id=769382
2017-12-09 19:32:23 +00:00
Munez
e49f723a07 Implemented gst_video_overlay_set_window_handle()
https://bugzilla.gnome.org/show_bug.cgi?id=772608
2017-12-09 19:32:23 +00:00
Matthew Waters
78d8e895df meson: gl: fix detection of glx without gl
We need to check for libGL if we may use desktop OpenGL *or* GLX.
2017-12-09 19:32:23 +00:00
Matthew Waters
f70d4ec22d meson: gl: fix incorrect error string
Use the winsys variable for an incorrect winsys provided
2017-12-09 19:32:23 +00:00
Munez
0207ce9818 gl/dispmanx: egl_show should resize the window only if there is no render rectangle set
https://bugzilla.gnome.org/show_bug.cgi?id=772699
2017-12-09 19:32:23 +00:00
Munez
7a41cbd599 gl/dispmanx: Fix set_render_rectangle typo
https://bugzilla.gnome.org/show_bug.cgi?id=772698
2017-12-09 19:32:23 +00:00
Matthew Waters
126ee924c0 glwindow: don't use g_thread_join() to join the navigation thread
Using g_thread_join() in _finalize() handlers may result in a deadlock
joining the current thread when the last reference is held by a signal
handler.

e.g.:

error 'Resource deadlock avoided' during 'pthread_join (pt->system_thread, NULL)'

The backtrace looks like this:
[...]
g_thread_join ()
gst_gl_window_finalize ()
gst_gl_window_x11_finalize ()
g_object_unref ()
g_value_unset ()
g_signal_emit_valist ()
g_signal_emit ()
gst_gl_window_send_mouse_event ()
gst_gl_window_mouse_event_cb ()
g_main_dispatch ()
[..]
g_main_loop_run ()
gst_gl_window_navigation_thread ()
g_thread_proxy ()
start_thread ()
clone ()
2017-12-09 19:32:23 +00:00
Matthew Waters
112f85a474 gl/win32: remove egl implementation
It hasn't been used in ages and is dead code.
2017-12-09 19:32:22 +00:00
Gwang Yoon Hwang
485dffa6d5 gl/dispmanx: Implements set_render_rectangle to adjust the position of window
We cannot set the x, y coordinate of the video frame at the dispmanx at
this point. We need to teach dispmanx backend to understand about
set_render_rectangle API to draw a video with other UI.

This patch keeps the current behavior which places video frame at the
center of the display if there is no set_render_rectangle call to the
dispmanx window.

https://bugzilla.gnome.org/show_bug.cgi?id=766018
2017-12-09 19:32:22 +00:00
Matthew Waters
1e8c7e0f31 gl: add necessary padding bytes to all public structs 2017-12-09 19:32:22 +00:00
Matthew Waters
7cbac97b94 gldisplay: also free the GWeakRef when removing dead contexts
Otherwise we leak GWeakRef's.

Found with make -C tests/check libs/gstglcontext.valgrind
2017-12-09 19:32:22 +00:00
Matthew Waters
f678dcaf2b meson/gl: use separate deps for gl and glx
e.g. passing with_gl_api=gles2 would still build the glx code but not be
linking against the libGL library which is where the glX* functions are
located and would result in a linker error.

Solved by checking for the libGL library if either opengl or glx may be
needed and then disabling the corresponding deps as requested.
2017-12-09 19:32:22 +00:00
Matthew Waters
8d60fa2327 meson: add some starting build files for GL
Currently only works on linux with egl/glx + wayland/x11 but the general
principals have been layed out for adding the other GL platforms/winsys'.
2017-12-09 19:32:22 +00:00
Alistair Buxton
94f5fc5d83 gl: Remove duplicate GL_CFLAGS in Makefile.am.
https://bugzilla.gnome.org/show_bug.cgi?id=771021
2017-12-09 19:32:22 +00:00
Jan Schmidt
ae89055e67 gl: Remove extra duplicate typedef of GstGLFramebuffer
It's triggering a warning building git master on OSX
2017-12-09 19:32:22 +00:00
Alessandro Decina
29d6825f11 glupload: fix tests and check for the new RECONFIGURE behaviour
The tests were broken since 91fea30, which changed glupload to return
GST_GL_UPLOAD_RECONFIGURE if the texture target in the input buffers doesn't
match the texture-target configured in the output caps.

This commit fixes that and adds more checks for the new behaviour.
2017-12-09 19:32:22 +00:00
Alessandro Decina
cc9f65f191 gstglupload: make the GLMemoryUpload method output the correct texture-target
Now when used with video/x-raw as input, the GLMemoryUpload method checks for
->tex_target in input GLMemory(es) and sets the output texture-target
accordingly.

Fixes video corruption with a pipeline like avfvideosrc ! video/x-raw !
glimagesink where on macos avfvideosrc pushes RECTANGLE textures but glupload
was configuring texture-target=2D as output.
2017-12-09 19:32:22 +00:00
Jan Schmidt
179f7c00fe glviewconvert: Fix texture target fixation
Don't set the chosen texture-target into the wrong structure.
The input caps may not be writable, and in any case - the
intention was to configure the othercaps. Also, remove an
extra unref - the othercaps ref is consumed by
gst_caps_make_writable already.
2017-12-09 19:32:22 +00:00
Nirbheek Chauhan
598f8e0121 Add support for Meson as alternative/parallel build system
https://github.com/mesonbuild/meson

With contributions from:

Tim-Philipp Müller <tim@centricular.com>
Matej Knopp <matej.knopp@gmail.com>
Jussi Pakkanen <jpakkane@gmail.com> (original port)

Highlights of the features provided are:
* Faster builds on Linux (~40-50% faster)
* The ability to build with MSVC on Windows
* Generate Visual Studio project files
* Generate XCode project files
* Much faster builds on Windows (on-par with Linux)
* Seriously fast configure and building on embedded

... and many more. For more details see:

http://blog.nirbheek.in/2016/05/gstreamer-and-meson-new-hope.html
http://blog.nirbheek.in/2016/07/building-and-developing-gstreamer-using.html

Building with Meson should work on both Linux and Windows, but may
need a few more tweaks on other operating systems.
2017-12-09 19:32:22 +00:00
Matthew Waters
792299d9ae glwindow: marshal gst_gl_window_resize through the window loop
saves having every caller do it themselves.
2017-12-09 19:32:22 +00:00
Matthew Waters
2763baf439 gl/wayland: use multi-threaded safe event wayland API
Multiple threads may be accessing the wayland fd at the same time which
requires the use of special wayland API to deal with to ensure nobody
will steal reads and cause a stall for anyone else.
2017-12-09 19:32:22 +00:00
Matthew Waters
19f32c0f49 gl/egl: fix inverted typedef
2b6841d had an inverted typedef defining ginptr and EGLAttrib.  Fix that.
2017-12-09 19:32:22 +00:00
Matthew Waters
1a7333173a gl/build: add configure check for possibly missing EGLAttrib
Fixes the build on older android targets.
2017-12-09 19:32:22 +00:00
Song Bing
15c34b0ab1 gl/egl/dmabuf: Wrong attribute list type for EGL 1.5
For EGL 1.5 spec, the attribute list type should be EGLAttrib.

https://bugzilla.gnome.org/show_bug.cgi?id=768602
2017-12-09 19:32:22 +00:00
Vincent Penquerc'h
b9224e62b5 glcontext: fix race joining thread on finalize
https://bugzilla.gnome.org/show_bug.cgi?id=769939
2017-12-09 19:32:21 +00:00
Matthew Waters
6b635559cd glcolorconvert: add missing rgb16 and bgr16 video formats in switch
Fixes an assertion that code should not be reached

https://bugzilla.gnome.org/show_bug.cgi?id=769462
2017-12-09 19:32:21 +00:00
Haihua Hu
4cd94ddd25 glwindow: Fix glimagesink cannot show frame when connect to qmlglsrc
When connect to qmlglsrc, x11 event loop will be replace by qt event loop
which will cause the window cannot receive event from xserver, such as resize

https://bugzilla.gnome.org/show_bug.cgi?id=768160
2017-12-09 19:32:21 +00:00
Hyunjun Ko
d875e0a727 glupload: Use bufferpool to allocate new buffer in GLTextureUploadMeta
To improve performace of upload with GLTextureUploadMeta,
use bufferpool instead of allocating new buffer every time.

https://bugzilla.gnome.org/show_bug.cgi?id=769293
2017-12-09 19:32:21 +00:00
Matthew Waters
85d5489f58 glwindow: move unsetting queue_resize to _resize() instead of _draw()
Makes infinitely more sense and implementation were expecting that behaviour
anyway and would enter a resize, draw, resize, draw, ... cycle instead of only
resizing once.
2017-12-09 19:32:21 +00:00
Matthew Waters
9eda7912b4 glframebuffer: add compatibility definition for GL_DEPTH_STENCIL_ATTACHMENT
GLES2 doesn't have it defined...
2017-12-09 19:32:21 +00:00
Matthew Waters
b3d8e09839 glfilter: rewrite subclasses for filter_texture() occuring on GL thread
There's no need for the jump to an extra thread in most cases, especially
when relying solely on a shader to render.  We can use the provided
render_to_target() functions to simplify filter writing.
2017-12-09 19:32:21 +00:00
Matthew Waters
1ffbc2f1ae glutils: remove unused GstGLDisplayProjection 2017-12-09 19:32:21 +00:00
Matthew Waters
3c1c5e9d83 glcontext: remove not thread-safe get/set_error()
Use GError's instead if necessary.
2017-12-09 19:32:21 +00:00
Matthew Waters
4bbda2b626 glframebuffer: rewrite for a more consistent API
Facilities are given to create fbo's and attach GL memory (renderbuffers
or textures).  It also keeps track of the renderable size for use with
effective use with glViewport().
2017-12-09 19:32:21 +00:00
Matthew Waters
7f10822de4 gl: use GLMemory for accessing textures everywhere
This simplifies and consolidates a lot of duplicated code creating
and modifying textures.
2017-12-09 19:32:21 +00:00
Matthew Waters
c7dd43f21a glfilter: rename draw_texture to draw_fullscreen_quad
And remove unused arguments.
2017-12-09 19:32:21 +00:00
Matthew Waters
7004e44be9 gl: add memory type for renderbuffer's
Soon to be used for framebuffers for e.g. depth buffers or throwaway color
buffers.
2017-12-09 19:32:21 +00:00
Matthew Waters
6485accb47 glformat: define our own set of formats from the GL defines
also add some depth/stencil formats
2017-12-09 19:32:21 +00:00
Matthew Waters
adf47ea728 glbasememory: assert for a valid allocator instead of segfaulting 2017-12-09 19:32:21 +00:00
Tim-Philipp Müller
2c3a31c483 gl: wayland: improve debug message when connecting to display
And another copy'n'paste-o.

https://bugzilla.gnome.org/show_bug.cgi?id=768929
2017-12-09 19:32:21 +00:00
Matthew Waters
ba00657e9d glviewconvert: fix transformation matrix usage
Calling glUniformMatrix before the shader is bound is invalid and
would result in errors like:

GL_INVALID_OPERATION in glUniformMatrix(program not linked)

Move glUniformMatrix() to after the gst_gl_shader_use() call.
2017-12-09 19:32:21 +00:00
Matthew Waters
d9ed4ed447 glupload: fix raw data uploader with addition of GstVideoGLTextureType
Fixes regression from 989200820d

https://bugzilla.gnome.org/show_bug.cgi?id=768217
2017-12-09 19:32:21 +00:00
Olivier Crête
06b2871fcc glvideoconvert: RG/LA is available in OpenGL ES 3, so let that through 2017-12-09 19:32:21 +00:00
Matthew Waters
9554725cc2 Revert "Revert "gl/eagl: try getting a gles3 context""
This reverts commit eb14273631.

vtdec now successfully outputs textures that can be converted by
glcolorconvert in GLES3 contexts.
2017-12-09 19:32:21 +00:00
Matthew Waters
1153684a94 glmemory: add the texture type to allocate to parameters
Rather than assuming something.  e.g. zerocopy on iOS with GLES3 requires
the use of Luminance/Luminance Alpha formats and does not work with
Red/RG textures.
2017-12-09 19:32:21 +00:00
Matthew Waters
2ba0926385 glcolorconvert: don't assume Red/RG textures will be used
Take the used texture type from the memory instead.

Fixes conversion from multi-planar YUV formats with two components per plane
(NV12, NV21, YUY2, UYVY, GRAY16_*, etc) with Luminance Alpha input textures.

This is also needed for zerocopy decoding on iOS with GLES 3.x.
2017-12-09 19:32:21 +00:00
Matthew Waters
db51c90d5d glcontext: correct precondition for get_gl_version
The intention was to assert if both maj and min were NULL (as there would be no
point calling the function).  Instead if either maj or min were NULL, the assert
would occur.

Fix that.
2017-12-09 19:32:21 +00:00
Sebastian Dröge
f457e29192 eglimage: Only register debug category if dmabuf support is enabled
It's not used otherwise currently and causes compiler warnings.
2017-12-09 19:32:20 +00:00
Wang Xin-yu (王昕宇)
0decbc5c49 glcontext/wgl: try wglCreateContextAttribsARB even not gl3 core profile
https://bugzilla.gnome.org/show_bug.cgi?id=764018
2017-12-09 19:32:20 +00:00
Matthew Waters
4a6b20cc42 glcontext: fix get_current_gl_api() on win32
Another case of incorrect calling conventions.

Using this function on win32 would corrupt the stack pointer and end in
massive hilarity.
2017-12-09 19:32:20 +00:00
Matthew Waters
dfd6565b4b glsl: fixup external-oes shaders by mangling the required extension
Newer devices require using a different GLSL extension for accessing
external-oes textures in a shader using the texture() functions.

While the GL_OES_EGL_image_external_essl3 should supposedly be supported
on a any GLES3 android device, the extension was defined after a lot of the
older drivers were built so they will not know about it.  Thus there are two
possible interpretations of which of texture[2D]() should be supported for
external-oes textures.  Strict adherence to the GL_OES_EGL_image_external
extension spec which uses texture2D() or following GLES3's pattern, also
allowing texture() as a function for accessing external-oes textures

This adds another mangling pass to convert
 #extension GL_OES_EGL_image_external : ...
into
 #extension GL_OES_EGL_image_external_essl3 : ...
on GLES3 and when the GL_OES_EGL_image_external_essl3 extension is supported.

Only uses texture() when the GLES3 and the GL_OES_EGL_image_external_essl3
extension is supported for external-oes textures.
Uses GLES2 + texture2D() + GL_OES_EGL_image_external in all other external-oes
cases.

https://bugzilla.gnome.org/show_bug.cgi?id=766993
2017-12-09 19:32:20 +00:00
Sergey Borovkov
0731b0937d qml: Enable qmlglsink for eglfs
https://bugzilla.gnome.org/show_bug.cgi?id=763044
2017-12-09 19:32:20 +00:00
Matthew Waters
e9ba0b88e7 glsl: add some debugging 2017-12-09 19:32:20 +00:00
Matthew Waters
072b47d5b8 glutils: remove unused functions for texture creation/deletion
Everyone uses GstGLMemory now and any future code should as well.
2017-12-09 19:32:20 +00:00
Matthew Waters
632cc16767 glfilter: remove unused class fields in/out_tex_id
The functionality is not used by any subclass nor are the values set anywhere.
2017-12-09 19:32:20 +00:00
Matthew Waters
1da12235c3 gl/upload/meta: remove unneeded texture deletion
The textures are managed by the GstGLMemory inside the output buffer.  Freeing
them prematurely may result in a use-after-free.
2017-12-09 19:32:20 +00:00
Guillaume Desmottes
b23a008ab6 gst-libs: gl, video: use MAY_BE_LEAKED flag
https://bugzilla.gnome.org/show_bug.cgi?id=767162
2017-12-09 19:32:20 +00:00
Havard Graff
c8eef7bf44 gl: glquery: cast to silence compiler warning
https://bugzilla.gnome.org/show_bug.cgi?id=766973
2017-12-09 19:32:20 +00:00
Matthew Waters
57acec4b1c gldisplay: always unref the context on a collision
Otherwise we will leak GstGLContext's when adding the same context more than
once.

Fixes a regression caused by 5f9d10f603 in the
gstglcontext unit test that failed with:

Assertion 'tmp == NULL' failed
2017-12-09 19:32:20 +00:00
Xavier Claessens
1f58a480c9 gl: win32: Add debug category in gstglcontext_wgl.c
https://bugzilla.gnome.org/show_bug.cgi?id=766867
2017-12-09 19:32:20 +00:00
Haihua Hu
3cf27dd1c8 glimagesink: support video rotation using transform matrix
Add "rotate-method" to glimagesink and apply transform matrix
to vertex coordinate to control rotation.

https://bugzilla.gnome.org/show_bug.cgi?id=765795
2017-12-09 19:32:20 +00:00
Matthew Waters
537d1996e9 gldisplay: add some debugging about retrieving GL contexts 2017-12-09 19:32:20 +00:00
Sebastian Dröge
0ea3706901 eglimage: Re-add accidentially removed GST_DEFINE_MINI_OBJECT_TYPE() 2017-12-09 19:32:20 +00:00
Sebastian Dröge
b054da4c96 eglimage: Ensure that the debug category is always initalized
Before the initializer was only run if dmabuf support was used.

https://bugzilla.gnome.org/show_bug.cgi?id=766794
2017-12-09 19:32:20 +00:00
Tim-Philipp Müller
7bf17ac500 g-i: pass compiler env to g-ir-scanner
It's what introspection.mak does as well. Should
fix spurious build failures on gnome-continuous.
2017-12-09 19:32:20 +00:00
Xavier Claessens
719298af98 gl: win32: Unparent internal window before destroying it
For some reason DestroyWindow() deadlock if it's called from
parent window's KeyPress event.

https://bugzilla.gnome.org/show_bug.cgi?id=766533
2017-12-09 19:32:19 +00:00
Xavier Claessens
e2731f35bf gl: win32: Don't steal parent focus when creating internal window
This fix regression introduced by 0acc18c60f.

https://bugzilla.gnome.org/show_bug.cgi?id=766520
2017-12-09 19:32:19 +00:00
Matthew Waters
7e7aef92c2 gldisplay: demote no platform display debug to info
Avoids confusing everyone with a warning that's not always fatal.

https://bugzilla.gnome.org/show_bug.cgi?id=746933
2017-12-09 19:32:19 +00:00
Matthew Waters
2d62b2910c gl: take the affine transformation in NDC
Provide a function to get the affine matrix in the meta in terms of NDC
coordinates and use as a standard opengl matrix.

Also advertise support for the affine transformation meta in the allocation
query.
2017-12-09 19:32:19 +00:00
Matthew Waters
5efc2e8705 gl/egl: replace gsteglimagememory with an EGLImage wrapper
That can be passed to GstGLMemoryEGL.

This also ports the dmabuf uploader to GstEGLImage and GstGLMemoryEGL.
2017-12-09 19:32:19 +00:00
Gwang Yoon Hwang
ecfe5b0801 gl: implement GstGLMemoryEGL
Because current GstEGLImageMemory does not inherit GstGLMemory, GLUpload
allocates additional GLMemory and upload the decoded contents from the decoder
which uses EGLImage (e.g. gst-omx in RPi).

This work adds GstGLMemoryEGL to avoid this overhead. Decoders allocate
GstGLMemoryEGL and decode its contents to the EGLImage of GstGLMemoryEGL.  And
GLUpload uses this memory without allocation of additional textures and blit
operations.

[Matthew Waters]: gst-indent the sources and fix a critical retreiving the egl
display from the memory.

https://bugzilla.gnome.org/show_bug.cgi?id=760916
2017-12-09 19:32:19 +00:00
Matthew Waters
2753b4243e glmemory: add wrapped data pointers to setup_buffer
Allows creating wrapped memories with GstGLAllocationParams.

The wrapped pointers will be set in the parameters before being passed
to the memory allocation function.
2017-12-09 19:32:19 +00:00
Matthew Waters
04e92acd3b glbasememory: take a pointer as the wrapped gpu handle
Allows passing arbitrary data to wrap the the specific memory implementation
which is required for some memory implementations.
2017-12-09 19:32:19 +00:00
Matthew Waters
c459894f78 gl: fix gles3 header usage for older platforms
Some platforms provide an old version of GLES2/gl2.h and GLES2/gl2ext.h that
will fail when including GLES3/gl3.h due to missing typedef's.

Seen on the RPi.
2017-12-09 19:32:19 +00:00
Sebastian Dröge
1066b2a860 glviewconvert: Port more things to GLES/GL 3 compatibility
And move the shader mangling code into a single place instead of having a copy
in glcolorconvert and glviewconvert.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2017-12-09 19:32:19 +00:00
Sebastian Dröge
64c320ca3c glcolorconvert: GLES3 deprecates texture2D() and it does not work at all in newer versions than 3.3
Use the newer texture() function instead. This fixes glimagesink and other
things on various Android devices.

https://bugzilla.gnome.org/show_bug.cgi?id=765266
2017-12-09 19:32:19 +00:00
Hyunjun Ko
84be275c4f gl/cocoa: Fix incompatible type warning
https://bugzilla.gnome.org/show_bug.cgi?id=765292
2017-12-09 19:32:19 +00:00
Heinrich Fink
caa9ad59e6 gl/caopengllayer: Apply layer.contentsScale to viewport dims
Fixes blurry content on HiDPI screens

https://bugzilla.gnome.org/show_bug.cgi?id=765194
2017-12-09 19:32:19 +00:00
Matthew Waters
614f80cbcf gl/cocoa/eagl: don't leak GThread's when dispatching messages
gst_gl_context_get_thread() returns a refed pointer, we need to unref it.
2017-12-09 19:32:19 +00:00
Matthew Waters
3ee2183038 glupload: keep the parent buffer around when converting EGLImage to 2D textures
e.g. receiving and releasing a buffer from OMX too early will potentially
cause textures to be overwritten while/before they are displayed.
2017-12-09 19:32:19 +00:00
Alessandro Decina
5c506cd857 libgstgl: cocoa, eagl: use libdispatch to schedule GL calls
Use libdispatch instead of GMainLoop to dispatch GL calls. libdispatch is more
optimized and cuts a lot of poll()/pthread_* overhead.
2017-12-09 19:32:19 +00:00
Alessandro Decina
3d124f498a glwindow: reduce the number of GMutexes and GConds in send_message()
Don't create many short lived locks/conds in gst_gl_window_send_message. This is
a micro optimization to save a bunch of pthread_* calls which are expensive on
OSX/iOS and possibly other platforms.
2017-12-09 19:32:19 +00:00
Matthew Waters
b1a60af720 eglimage: perform eglCreateImage in the gl thread
while calling eglCreateImage without a GL context current in the executing
thread works on the RPi, some other implementations will return errors.

Marshall the eglCreateImage to the GL thread to appease these implementations.
2017-12-09 19:32:18 +00:00
Matthew Waters
cbf3a986ca glviewconvert: support outputting to multiple draw buffers on GLES3
A similar change that was done to glcolorconvert adding the necessary shader
mangling.
2017-12-09 19:32:18 +00:00
Matthew Waters
85cddc0891 glcolorconvert: implement multiple render targets for GLES3
There are numerous slight differences required between Desktop GL and GLES3 for
multiple render targets.

1. gl_FragData doesn't exist at all and one is required to use
   'layout (location = ?) out ...' instead.
2. gl_FragColor doesn't exist, same as 1
3. texture2D() has been deprecated

Fortunately most of these have been taken care of with GL3 and the shader
mangling already exists so just expand the conditions they are used in.  The
gl_FragData issue requires a new mangle pass though.  We also use this new
pass on desktop GL for consistency.
2017-12-09 19:32:18 +00:00
Matthew Waters
597e98b64a glcolorconvert: don't use the predefined variable name sample
Using 'sample' as a variable name is an error in GLES3
2017-12-09 19:32:18 +00:00
Matthew Waters
97e66be37d gl: add support for building against GLES3 headers
with a fallback to GLES2 headers if available.
2017-12-09 19:32:18 +00:00
Matthew Waters
0c2890cd34 glmemory: add checking the read implementation format/type on gles2 platforms
By default, reading GL_RED or GL_RG us unsupported by glReadPixels unless
exposed through GL_COLOR_READ_IMPLEMENTATION_FORMAT/TYPE.  This allows
downloading multiple-planar video frames where possible.
2017-12-09 19:32:18 +00:00
Matthew Waters
f1737c8ad7 glbasememory: rollback map state when subclass map fails
Otherwise our state doesn't reflect reality.
2017-12-09 19:32:18 +00:00
Matthew Waters
99dfbf8ed9 glmemorypbo: unmap pbo memory on pbo read error
Otherwise we are returning failure with a dangling map!

Also only unset the NEED_DOWNLOAD flag in download_transfer() if the read actually
succeeds.
2017-12-09 19:32:18 +00:00
Matthew Waters
ccbf43987f glshader: add glBindFragDataLocation
There are some cases where it's needed for binding in/out variables in shaders.
e.g. glsl 150 (gl 3.2) doesn't support the 'layout (location = ?)' specifiers in
the shader source so we have to bind them ourselves.
2017-12-09 19:32:18 +00:00
Vineeth TM
e92bbb2a83 bad: use new gst_element_class_add_static_pad_template()
https://bugzilla.gnome.org/show_bug.cgi?id=763081
2017-12-09 19:32:18 +00:00
Matthew Waters
b5e8763a07 gl/proto: sync operations are available on GLES 3.0
Without the GST_GL_API_GLES2 bit set, we will not even attempt to look
for the function pointers in the core library and will fallback to
glFlush/glFinish.
2017-12-09 19:32:18 +00:00
Matthew Waters
b1bfcac299 glmemory: unset GL_UNPACK_ROW_LENGTH in opengl3
If the user uploads their own texture without setting the unpack length, then
then the result will have the appearance of stride mismanagement due to
an incorrect row length.
2017-12-09 19:32:18 +00:00
Matthew Waters
2ba61c9049 glutils: remove custom code for setting caps features
Just use gst_caps_set_features() instead.
2017-12-09 19:32:17 +00:00
Matthew Waters
d5cc277601 glfilter: only allow the same src/sink caps when we are in passthrough mode
If we are given caps with extra features (like the overlay composition
features), we can only deal with that when we are in passthrough mode.

Previously we were bailing entirely and not allowing passthrough filter elements
with things like textoverlay.

Fixes the following pipeline (assuming glfilter supports passthrough):
gl ! textoverlay ! glfilter ! ... ! glimagesinkelement

https://bugzilla.gnome.org/show_bug.cgi?id=763756
2017-12-09 19:32:17 +00:00
Matthew Waters
356494d967 glupload: deal with the ANY caps feature correctly
When transforming, xplode it out into the necessary caps features both
with and without the passthough features.

Fixes negotiation in the following class of pipelines:

gl ! textoverlay ! glupload ! glimagesinkelement

https://bugzilla.gnome.org/show_bug.cgi?id=763756
2017-12-09 19:32:17 +00:00
Matthew Waters
fdca1dec0d glshader: some compatibility changes for GL 1.4
GL 1.4 (with GL_ARB_shader_objects) doesn't have glIsProgram or glIsShader
equivalents.  As they are simply assertions, skip them when there isn't a
valid function pointer.
2017-12-09 19:32:17 +00:00
Matthew Waters
4406730633 glfilter: retrieve the shader attributes from the GL thread
Otherwise we will receive bogus values

https://bugzilla.gnome.org/show_bug.cgi?id=763365
2017-12-09 19:32:17 +00:00
Matthew Waters
eb1a9bb9b0 gldisplay: make readding the same context a no-op
With e38af23044 returning the correct contexts,
gst_gl_display_add_context() was susceptible to causing infinte loops when
adding the same GstGLContext more than once.  Fix and add a test for
gst_gl_display_add_context().

Fixes glvideomixer gst-validate tests.
2017-12-09 19:32:17 +00:00
Sebastian Dröge
95415270f0 Revert "libgstgl: cocoa, eagl: don't marshal GL calls to the context thread"
This reverts commit 797d6415df.

We're frozen for 1.8.0 release and this change might have bigger impact.
2017-12-09 19:32:17 +00:00
Alessandro Decina
90889bc73f libgstgl: cocoa, eagl: don't marshal GL calls to the context thread
Execute GL calls without marshalling them to the context thread. In the cocoa
and eagl backends calling gst_gl_context_activate is cheap and therefore calling
it on the current thread and serializing GL calls with a per-context lock is
more efficient (faster and has less overhead) than marshalling everything to the
context thread.

This optimization cuts a large overhead in g_poll (continuously waking up the
context thread) and in g_mutex_*/g_cond_* (waiting for results from the context
thread).
2017-12-09 19:32:17 +00:00
Mark Nauwelaerts
6d343abec8 gldisplay: really retrieve glcontext for a specific thread
When requesting a glcontext (regardless of thread), the result was correct.
However, when requesting current glcontext on a specific thread, it could
come up with a glcontext active on another thread.

https://bugzilla.gnome.org/show_bug.cgi?id=763168
2017-12-09 19:32:17 +00:00
Matthew Waters
31b1094744 gl: misc docs fixes/additions 2017-12-09 19:32:17 +00:00
Matthew Waters
18a812a30f gl*memory: document new functionality and objects 2017-12-09 19:32:17 +00:00
Mark Nauwelaerts
99f9d4ccc7 glfilter: handle some more unfixed fields when fixating caps 2017-12-09 19:32:17 +00:00
Nicolas Dufresne
910d990e4b glbasememory: Don't change maxsize at run-time
Maxsize is initialized once and should never change. Allocating data
should have no impact on the selected max size for this memory. This
causing memory map failure as the maxsize would become smaller then
size. This happened when using direct rendering in avviddec on GL that
does not support PBO transfer.

https://bugzilla.gnome.org/show_bug.cgi?id=763045
2017-12-09 19:32:17 +00:00
Matthew Waters
9d66a5ff06 eglimagememory: add compatibility definitions for EGL dmabuf
e.g. the RPi doesn't have them defined
2017-12-09 19:32:17 +00:00
Matthew Waters
5f87cc0b65 glcontext: add a method to add a context to another share group
Intended for use with wrapped contexts that are created shared with gst's
gl contexts in order to manage the internal sharegroup state correctly.

e.g. with caopengllayer (which is used in glimagesink and caopengllayersink
on OS X), we create a CGL context from the gst context and the sharing state
was not being correctly set on either GL context and gst_gl_context_is_shared()
was always returning FALSE.

With 11fb4fff80 only flushing with multiple
shared contexts, the required flush was not occuring causing screen
corruption or stuttering.

Note: this didn't affect GST_GL_API=opengl pipelines

https://bugzilla.gnome.org/show_bug.cgi?id=762620
2017-12-09 19:32:17 +00:00
Matthew Waters
7e108f4763 gl: fix the build
2d287812 was incomplete
2017-12-09 19:32:17 +00:00
Matthew Waters
e71e492413 gl: error out if the configured GL API is unsupported by our element
https://bugzilla.gnome.org/show_bug.cgi?id=759801
2017-12-09 19:32:17 +00:00
Julien Isorce
1377a0a4f9 gldebug: make sure debug is initialized when calling gst_gl_insert_debug_marker
Usually gl debug is initialized in gst_gl_context_create_thread.
But this function is not used when using the GstGLContextGPUProcess
from ChromiumGStreamerBackend.

Received signal 11 SEGV_MAPERR 000000000000
gst_debug_category_get_threshold
gst_gl_insert_debug_marker
gst_gl_base_filter_gl_start
2017-12-09 19:32:17 +00:00
Sebastian Dröge
adfd016d01 gl: Fix compiler warning about unused const variable with gcc 6
CC       libgstgl_x11_la-gstglcontext_glx.lo
In file included from gstglcontext_glx.c:39:0:
../utils/opengl_versions.h:52:43: error: ‘gles2_versions’ defined but not used [-Werror=unused-const-variable]
 static const struct { int major, minor; } gles2_versions[] = {
                                           ^~~~~~~~~~~~~~
2017-12-09 19:32:17 +00:00
Sebastian Dröge
af5eddc6e8 gl: Move private headers from SOURCES to noinst_HEADERS 2017-12-09 19:32:16 +00:00
Matthew Waters
86edea9725 glfilter: insert the debug marker from the GL thread
https://bugzilla.gnome.org/show_bug.cgi?id=761538
2017-12-09 19:32:16 +00:00
Sebastian Dröge
745071b5bf gl: Remove leftover g_prints
One was commented out, but we also don't use // comments :)
2017-12-09 19:32:16 +00:00
Matthew Waters
88d71c10ca gldebug: use the correct spelling for behavior
The headers use the american spelling of behavior not the UK/AUS version with
the extra U.
2017-12-09 19:32:16 +00:00
Matthew Waters
7dcdb1d29c glcontext: don't enable GL debug for messages that won't be logged
This is an optimization to avoid pointless string processing.
2017-12-09 19:32:16 +00:00
Tim-Philipp Müller
1390312037 gl: syncmeta: define GL_TIMEOUT_IGNORED in more portable way 2017-12-09 19:32:16 +00:00
Alessandro Decina
bc8d272aad gstglshader: cache uniform locations
Avoid redundant calls to glGetUniformLocation. The results can be cached once
the shader has been linked.
2017-12-09 19:32:16 +00:00
Alessandro Decina
7e1a42ce55 gstglcontext: micro optimization to gst_gl_context_thread_add
Invoke the callback right away when called on the context thread. Removes
overhead when nesting libgstgl calls (for example when working with the sync
meta).
2017-12-09 19:32:16 +00:00
Matthew Waters
fb34d8a04b glsyncmeta: add compatibility definition for GL_TIMEOUT_IGNORED 2017-12-09 19:32:16 +00:00
Matthew Waters
f4bd4434c4 glsyncmeta: separate out gpu/cpu waits.
CPU waits are more expensive and are only required if the CPU is ever going to
access the data. GPU waits perform inter-context synchronisation and are cheaper
as they don't require CPU intervention.
2017-12-09 19:32:16 +00:00
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
Luis de Bethencourt
265005a5e1 glquery: remove unnecessary pointer check
All uses of query->context in gstglquery.c assume it exists. We can assume
this as well before unrefing it. Furthermore, gst_object_unref() will just
silently return if it ever were to not exist.
2017-12-09 19:32:16 +00:00
Matthew Waters
ed40eaca00 glbasefilter: enable qos by default
Improves the responsiveness of the pipeline when resources are close/above the
limitations of the hardware.

Any subclass that wishes not to enable qos can do so themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=761519
2017-12-09 19:32:16 +00:00
Matthew Waters
62588100fd Revert "gl/eagl: try getting a gles3 context"
This reverts commit 96b9666d59.
This reverts commit d11385d167.

This breaks the texture sharing with the applemedia elements as
CVOpenGLESTextureCache seems to have an arbitrary restriction on GLES2 only.
2017-12-09 19:32:16 +00:00
Matthew Waters
17f2b9b252 glcolorconvert: don't skip subset structures
We may need them to transform into a different set of formats.

Fixes YUV->YUV with two glcolorconverts, e.g:

format=I420 ! glcolorconvert ! glcolorconvert ! format=NV12
2017-12-09 19:32:16 +00:00
Matthew Waters
63f7d0a396 glbasefilter: always call gl_start when not called already
Fixes elements transitioning out of passthrough mode using GL resources that
hadn'e been allocated yet.
2017-12-09 19:32:16 +00:00
Matthew Waters
e2c9f4570c glcolorconvert: fix RGB,rectangle->planar YUV conversion
Converting to GRAY is no fun.  Another case of normalized vs unnormalized
texture coordinates.
2017-12-09 19:32:16 +00:00
Matthew Waters
b4704301c6 glcolorconvert: fix YUY2/UYVY,rectangle->RGB conversion
1.0 / width does not offset by one pixel in rectangular textures (which use
unnormalized coordinates).

Provide the actual pixel offset as a uniform to the shader.
2017-12-09 19:32:16 +00:00
Matthew Waters
32b71bd48d glcolorconvert: perform better negotiation
1. Correctly describe what we can caps we can transform to/from.
   i.e. no YUV->YUV or GRAY->YUV or YUV->GRAY (except for passthrough).
2. Prefer similar formats and ignore incompatible formats on fixation.
2017-12-09 19:32:16 +00:00
Julien Isorce
f2cfa7fb51 gstglwindow: initialize navigation_loop to NULL
Useful when gst_gl_window.c::gst_gl_window_new is not used.
This is the case when using a custom GstGLWindow.
(ex: GstGLWindowGPUProcess from Chromium)
2017-12-09 19:32:16 +00:00
Tim-Philipp Müller
a0d62ce32c gl: eagl: fix build
gstglcontext_eagl.m:238:45: error: too few arguments to function call,
expected at least 4, have 3
2017-12-09 19:32:16 +00:00
Matthew Waters
de5f87e72b gl/eagl: try getting a gles3 context
Fallback to a gles2 context if that fails
2017-12-09 19:32:15 +00:00
Wang Xin-yu (王昕宇)
1e4c9c1688 glprototypes: fix parameter type of glGenBuffers
The number of buffers should be GLsizei instead of GLuint.

https://bugzilla.gnome.org/show_bug.cgi?id=761272
2017-12-09 19:32:15 +00:00
Matthew Waters
d41c132dfa glcontext: back out unintended lost_context changes 2017-12-09 19:32:15 +00:00
Matthew Waters
5d2ddf7664 egl: implement selecting opengl3 contexts 2017-12-09 19:32:15 +00:00
Matthew Waters
786b2fb9f1 gl/egl: pass the error value to get_error_string() 2017-12-09 19:32:15 +00:00
Matthew Waters
2cef90184e gl: move control binding proxy implementation from glvideomixer
Other elements may need to use it's functionality
2017-12-09 19:32:15 +00:00
Holger Kaelberer
944923080b glwindow: Fix android build
https://bugzilla.gnome.org/show_bug.cgi?id=760972
2017-12-09 19:32:15 +00:00
Tim-Philipp Müller
370a151ee2 libs: g-i: fix init section to avoid compiler warnings
..GstPlayer-1.0.c: In function ‘main’:
..GstPlayer-1.0.c:587:3: warning: implicit declaration of function ‘gst_init’

https://bugzilla.gnome.org/show_bug.cgi?id=760090
2017-12-09 19:32:15 +00:00
Sebastian Dröge
72afdda3b3 glfilter: First make caps writable in fixate_caps(), then truncate them
Truncating requires writable caps.
2017-12-09 19:32:15 +00:00
Sebastian Dröge
f05da0fef7 glcolorconvert: Caps passed to fixate_caps() are not owned by us and guaranteed to be fixed
So don't try to fixate them, which takes ownership and steals them from
basetransform.

https://bugzilla.gnome.org/show_bug.cgi?id=760696
2017-12-09 19:32:15 +00:00
Sebastian Dröge
a208624354 Revert "glpool: fix caps refcount issue"
This reverts commit 3bdcdedfa0.

gst_caps_replace() takes a new reference already, if there is a problem then
it is elsewhere. And there are a few problems, see
https://bugzilla.gnome.org/show_bug.cgi?id=760696
2017-12-09 19:32:15 +00:00
Matthew Waters
554b23ae48 glquery: provide compat definition for GL_QUERY_RESULT
e.g. android doesn't have it

While we're here move a state specific assertion after the supported check.
Removes an assertion on GLES
2017-12-09 19:32:15 +00:00
Matthew Waters
fc882653b6 gl: add compatibility definition of GLint64
e.g. anrdoid doesn't have it
2017-12-09 19:32:15 +00:00
Matthew Waters
06d8000708 glpool: fix caps refcount issue
The caps are from an allocation query which are transfer none but were being
treated as transfer full.
2017-12-09 19:32:15 +00:00
Matthew Waters
575974aeaf glmemory: log the time for glTexSubImage/glReadPixels 2017-12-09 19:32:15 +00:00
Matthew Waters
65533b807c gl: add a gstglquery object for arbitrary GL queries
Currently only GL_TIME_ELAPSED and GL_TIMESTAMP are supported
2017-12-09 19:32:15 +00:00
Matthew Waters
a41f91253e gldebug: implement a delayed debug system
The messages are stored by gst_gl_async_debug_store_log_msg() and output later
by a corresponding store(), output() or an unset()/free().

Some wrapper macros are provided to avoid callers explicitly using __FILE__,
GST_FUNCTION and __LINE__
2017-12-09 19:32:15 +00:00
Matthew Waters
b804aa2399 gldebug: use gst_info_vasprintf in insert_debug_marker()
Allows expansion of GST_PTR_FORMAT and GST_SEGMENT_FORMAT arguments.
2017-12-09 19:32:15 +00:00
Matthew Waters
b56d9bd57b glfilter: recreate the fbo on caps changes
The width/height may change which requires recreating the depth buffer.
2017-12-09 19:32:15 +00:00
Matthew Waters
cb9463d1a2 glbasefilter: add a class function on set_caps (from GL)
This is simply a convenience to avoid duplicating the thread marshalling on
set_caps.
2017-12-09 19:32:14 +00:00
Matthew Waters
d5913f3048 gl/x11/navigation: add button press to the selected event mask
Otherwise we won't get the button press events and GstNavigation fails.
2017-12-09 19:32:14 +00:00
Alessandro Decina
c2a6c97a1d glcolorconvert: try harder to passthrough
This makes a pipeline like:

... ! video/x-raw(memory:GLMemory),format=UYVY ! glcolorconvert !
video/x-raw(memory:GLMemory),format={UYVY, NV12} ! ...

passthrough instead of converting UYVY => NV12. The conversion would happen
before this change since the element (and basetransform) transform the src caps
to format={NV12, UYVY} (since NV12 comes first in the glcolorconvert:src
template) and then the default caps fixate func would fixate to NV12. Blah.

Also there's no need to intersect against the template caps in ::transform_caps
since basetransform does that right after calling the vfunc.
2017-12-09 19:32:14 +00:00
Matthew Waters
1e94a8f0fb gldebug: add a specific category for the debug spam from the driver 2017-12-09 19:32:14 +00:00
Matthew Waters
0cf1eaf71a glbasememory: Free the actual memory object when requested
Otherwise we are leaking ~400B on each GstMemory allocation.

Freeing in the base class matches the GObject semantics.
2017-12-09 19:32:14 +00:00
Matthew Waters
880d2798b0 glmemorypbo: don't double read pixels
The optimistic download_transfer was not setting the required flag to not
perform glReadPixels on subsequent map (READ). resulting in glReadPixels
happening twice.
2017-12-09 19:32:14 +00:00
Matthew Waters
5ba0ab3da9 glmemory: expose gst_gl_memory_texsubimage
Removes extremely similar code from glmemorypbo.
2017-12-09 19:32:14 +00:00
Matthew Waters
1b49603d78 glfeature add a specific debug category
Saves having to trawl through the 'default' category when function retrieval
goes wrong.
2017-12-09 19:32:14 +00:00
Matthew Waters
6667408cb5 glsyncmeta: only flush with a shared context
The wait code will flush for us for single context pipelines.
2017-12-09 19:32:14 +00:00
Matthew Waters
472970324c glcontext: implement checking whether a context has been shared
Some operations are unnecessary when running with only a single GL
context.
e.g. glFlush when setting a fence object as the flush happens on wait.

API: gst_gl_context_is_shared
2017-12-09 19:32:14 +00:00
Matthew Waters
a0a0e51249 glcolorconvert: implement usage of a buffer pool
Saves unnecessary glGenTextures and glDeleteTextures which may have a
non-trivial cost.
2017-12-09 19:32:14 +00:00
Matthew Waters
3cefdd6673 glbasememory: fix copying GstGLAllocationParams
Fixes a GST_IS_GL_CONTEXT critical
2017-12-09 19:32:14 +00:00
Matthew Waters
48fbc9e096 glmemorypbo: remove unused code
https://bugzilla.gnome.org/show_bug.cgi?id=759679
2017-12-09 19:32:14 +00:00
Matthew Waters
86110c4765 glupload: always add texture-target field to GL caps
1. Various elements/base classes only perform a subset check on accept-caps
2. Some GL elements have texture-target in their pad template
3. When checking subsets, only the caps to check are allowed to contain extra
   fields.  If the 'template' caps have extra fields, the subset fails.
Thus without texture-target on the caps, various accept-caps implementations
were failing.

Also, add some convenience functions for setting and retrieving
texture targets to/from GValue.

https://bugzilla.gnome.org/show_bug.cgi?id=759860
2017-12-09 19:32:14 +00:00
Matthew Waters
ec5eb678d0 glupload: passthrough composition caps features
Don't unconditionally add it to any and all caps transformations.

https://bugzilla.gnome.org/show_bug.cgi?id=759860
2017-12-09 19:32:14 +00:00