Commit graph

3611 commits

Author SHA1 Message Date
He Junyan
6ffddd27e5 glimagesink: Avoid assert in query.
The sink_query just uses context, other_context and display to query info.
But all these objects can be changed or distroyed in state_change() func
and other places.
This patch is not very perfect. The condition race still exists in other
places in this element. All the functions directly access these objects
without protection. Most of them are executed when the data is pushing and
draw context/window have already been established, so they should not have
problems. But the sink_query and propose_allocation functions are the query
-like functions and executed in query context, which can be called in any
state of the element. So it can cause some crash issues because of destroyed
context object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
2020-12-04 00:40:12 +08:00
He Junyan
f7ea6d9b64 glcolorconver: Return empty caps in transform_caps if fails.
We should not return a NULL in transform_caps() function. The NULL
will generate a assert of:
  "transform_caps returned caps which are not a real subset of the
   filter caps"
in transform base class.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/922>
2020-12-04 00:24:32 +08:00
Stéphane Cerveau
20d541368a opus: disable docs option in meson fallback
As the docs are not necessary, no need to keep it
enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/943>
2020-11-26 17:37:01 +01:00
Tim-Philipp Müller
78ccc551d6 opus: add subproject fallback
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/924>
2020-11-13 15:11:03 +00:00
He Junyan
297a1555bf gluploadelement: Avoid race condition in propose_allocation().
The inside upload and context may have race condition in the function
of propose_allocation(). They may be destroyed while this function is
stilling using it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/916>
2020-11-05 04:08:13 +00:00
He Junyan
e8bb524278 gluploadelement: Avoid race condition of base class' context.
The base class' context may change, we should use the common API
with lock to access it, rather than the just directly access the
struct field.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/916>
2020-11-05 04:08:13 +00:00
He Junyan
9e37fa55bf gluploadelement: Avoid race condition of inside upload creation.
The operations for the inside GstGLUploadElement->upload have race
condition. The _transform_caps() will creates this object if it does
not exist, while the _stop() and change_state() can destroy this object.
The _transform_caps() is called by the gst_base_transform_query(),
so it does not hold the stream lock. It may use the upload while the
_stop() and change_state() has already destroy that object, and then
crash.

Fix: #645
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/913>
2020-11-04 13:55:07 +08:00
Dinesh Manajipet
ad697e8f97 gl: optimize glcolorbalance by precomputing shader math
Precompute the rgb -> yuv conversion and color balance adjustment math
so that the shader does minimal work per pixel.

Merging these 15+ steps into 3 steps let us jump from choppy
360p video to smooth 720p video on our underpowered embedded system.

If we can remove the clamp() step inside the shader, or apply it after
rgba
conversion, there are more performance benefits to reap. But I am not
sure
what the side effects will be in that case.

<https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/893>

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/893>
2020-10-29 01:16:49 +00:00
Tim-Philipp Müller
5ecdb2f268 gldeinterlace: fix doc blurb
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/899>
2020-10-28 13:22:09 +00:00
Zebediah Figura
e999318fd7 theoradec: Set telemetry options only if they are nonzero
Setting telemetry options, even to zero, causes libtheora to enable an expensive code path. For large enough videos (e.g. 1920x1080) this can increase the time to decode each frame by 30-40 ms, which can be enough to cause noticeable stutter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/887>
2020-10-22 08:05:20 +00:00
Sebastian Dröge
28ff6b377d timeoverlay: Add elapsed-running-time mode
This takes the first running time and the first after each flush-stop as
an offset for the running time that is rendered.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/737>
2020-10-08 23:51:02 +03:00
Xavier Claessens
c66e276550 pango: Add fallback dependency
When we'll depend on Meson >=0.55 this can be replaced by [provide]
section in gst-build's pango.wrap file. The dependency variable name can
also be dropped when pango is updated to use override_dependency:
https://gitlab.gnome.org/GNOME/pango/-/merge_requests/250

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/844>
2020-10-06 05:44:25 +00:00
Guillaume Desmottes
dd5f7f1bf9 gl: move each gl platform specific API to its own gir
With contributions from:
Thibault Saunier <tsaunier@igalia.com>
Matthew Waters <matthew@centricular.com>

Fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/651

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/661>
2020-08-06 04:09:09 +00:00
Jordan Petridis
31d683d59e alsamidisrc: fix compiler warning with clang 10
```
../subprojects/gst-plugins-base/ext/alsa/gstalsamidisrc.c:201:54: error: converting the result of '<<' to a boolean always evaluates to false [-Werror,-Wtautological-constant-compare]
  snd_seq_ev_schedule_real (&ev, alsamidisrc->queue, SND_SEQ_TIME_MODE_ABS,
                                                     ^
/usr/include/alsa/seq_event.h:215:34: note: expanded from macro 'SND_SEQ_TIME_MODE_ABS'
```

The ALSA API expects 0 or 1 here and will then add the flags accordingly,
and that's also what other code using this API does.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/777>
2020-08-04 15:19:08 +03:00
Olivier Crête
2de70ed7c5 alsadeviceprovider: Remove redundant start function
The ALSA provider doesn't provider live monitoring, so don't
pretend otherwise.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/735>
2020-07-20 21:12:54 +00:00
Olivier Crête
2f83ca5c7f alsadeviceprovider: Rank down to secondary so PulseAudio can hide it
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/727>
2020-07-06 16:32:21 +00:00
Mathieu Duponchelle
101dc08e5b basetextoverlay: mark valign and halign props as DOC_SHOW_DEFAULT
To document it, we instantiate a subclass and inspect the properties
on the created object. Subclasses (in that case textrender) may
initialize those properties with a different default, we do not
want to expose that in the base class documentation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/723>
2020-07-01 19:44:57 +01:00
Mathieu Duponchelle
3412827a61 docs: mark more plugin API 2020-06-23 14:52:21 -04:00
Mathieu Duponchelle
69d5428bfc docs: mark more types as plugin API 2020-06-23 14:52:20 -04:00
Sebastian Dröge
fddd7df2d3 Don't call gst_ghost_pad_construct() anymore
It's deprecated, unneeded and doesn't do anything anymore.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/717>
2020-06-22 16:11:28 +00:00
Jordan Petridis
1b567af051 libvisual: use gst_element_class_set_metadata when passing dynamic strings
gst_element_class_set_metadata is meant to only be used with
static or inlined strings, which isn't the case for this element
resulting in use-after-free later on.

https://gstreamer.freedesktop.org/documentation/gstreamer/gstelement.html?gi-language=c#gst_element_class_set_static_metadata

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/698>
2020-06-11 20:57:58 +03:00
Mathieu Duponchelle
cc516695b0 plugins: uddate gst_type_mark_as_plugin_api() calls 2020-06-06 00:41:17 +02:00
Mathieu Duponchelle
e666c9ec04 plugins: Use gst_type_mark_as_plugin_api() for all non-element plugin types 2020-06-03 22:44:23 -04:00
Niels De Graef
3843452366 glimagesink: Correct signals gtkdoc
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/669>
2020-05-26 20:21:27 +00:00
Mathieu Duponchelle
1aef6b8fd5 glcolorscale: fix documentation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/653>
2020-05-15 14:34:16 +00:00
Edward Hervey
add3023f09 gloverlaycompositor: Don't leak caps feature
Only copy it if we really are going to modify and use it

CID #1439873

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/652>
2020-05-05 17:17:57 +02:00
Matthew Waters
5d47b8e232 gl: fix application context querying between elements
Fixes error introduced by:
a4e49ba8c9
https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/642

Using the application GL context as the local GL context is not going to
work very well.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/643>
2020-04-27 11:36:02 +10:00
Guillaume Desmottes
989bbe29d8 opusdec: add 'stats' property
Allow users to retrieve the number of samples, and their duration,
generated using PLC.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/641>
2020-04-24 14:49:05 +02:00
Matthew Waters
a4e49ba8c9 gl: avoid deadlock querying for OpenGL context
If there are two elements and threads attempting to query each other for
an OpenGL context. The locking may result in a deadlock.

We need to unlock each element's context_lock when querying another
element for the OpenGL context in order to allow any other element to
take the lock when the other element is querying for an OpenGL context.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/642>
2020-04-24 18:03:16 +10:00
Jan Schmidt
f16d970f77 textrender: Don't calculate caps on every buffer
Only renegotiate with downstream when the srcpad has a pending
reconfigure flag, instead of querying, fixating and sending caps
for every buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/640>
2020-04-21 23:17:28 +10:00
Matthew Waters
cdd5470f06 glvideomixer: fix black output after display changes
Partial revert of 55e80b550e

https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/743
2020-04-14 12:03:49 +10:00
Matthew Waters
ebf8198a97 glvideomixer: intersect with template caps when updating
Downstream may provide extra things when we ask it for caps that we may
need to remove.

Fixes the following pipeline warning:

gltestsrc ! glvideomixerelement ! glimagesinkelement

** (gst-launch-1.0:908581): WARNING **: 13:53:28.518: glvideomixer0: update_src_caps returned caps which are not a real subset of the filter caps
2020-04-14 12:03:49 +10:00
Jan Schmidt
212c94312e textrender: Fix AYUV output.
Fix the check for whether the element is operating in ARGB mode. It
was incorrectly checking if the output format has an alpha channel,
which is true for both ARGB and AYUV, leading to the element
incorrectly outputting ARGB values into AYUV caps.
2020-04-09 18:29:51 +00:00
Philippe Normand
3f79805aa0 gl/wayland: Mouse events handling 2020-03-19 09:59:47 +00:00
Philippe Normand
5a4c5e9169 gl/navigation: Scroll events dispatch support 2020-03-19 09:59:47 +00:00
Edward Hervey
0200175d97 gloverlay: Fix various issues in allocation handling
* A copy-paste error was getting the information from the wrong
  query
* The 'allocation_meta' GstStructure was being leaked
* No check was done on whether the query existed (to try to set the
  resulting allocation meta on)

CID: 1439872
CID: 1439873
CID: 1439874
CID: 1439875
CID: 1439876
CID: 1439877
2020-03-05 06:01:50 +00:00
Matthew Waters
6dbda0681b glstereomix: support gl display changes 2020-03-03 02:11:52 +00:00
Matthew Waters
7e2073000a glbasefilter: add support for changing the display
Each element will remove its usage of the old display and context and
try to retrieve a new GL context.
2020-03-03 02:11:52 +00:00
Matthew Waters
4e12363cb7 glstereosplit: support gl display changes 2020-03-03 02:11:52 +00:00
Matthew Waters
55e80b550e gl/mixer: support GstGLDisplay changes 2020-03-03 02:11:52 +00:00
Matthew Waters
2a4a3aa0d6 gltestsrc: NULL out the functions used
Fixes segfault when the display changes
2020-02-05 15:32:14 +11:00
Tim-Philipp Müller
37c996dcf4 clockoverlay: fix bogus time display caused by previous commit
Fixes regression introduced by "clean-up" done as part of commit 98ebcb4.

dummy must live as long as use the return value of localtime_r() since
that's just a pointer to it, and by putting it inside the block we made
dummy go out of scope right after localtime_r() returned, which messed
up the time values since when we poked at the struct the contents might
already have been overwritten.

Fixes #722
2020-01-23 18:28:45 +00:00
Philippe Normand
6be01f0738 oggstream: Workaround for broken PAR in VP8 BOS
Similarily to the Theora mapping, process 0:N, N:0 and 0:0 pixel aspect ratios
as 1:1.

Fixes #719
2020-01-13 09:09:02 +00:00
Tim-Philipp Müller
cd4e64f885 meson: add graphene subproject
So we can build all the OpenGL elements.
2020-01-08 17:28:46 +00:00
Stéphane Cerveau
f8dc428a2a remove various useless linefeed in logs 2019-12-11 10:07:12 +01:00
Tim-Philipp Müller
2b99761dcf tests: oggmux: check vorbisenc + theoraenc availability at runtime
HAVE_VORBIS was used but never set, so only 3 out of 7 tests
actually ran. Drop now-unused HAVE_THEORA define.
2019-12-09 07:33:55 +00:00
Tim-Philipp Müller
72bafd442f vorbis: drop unneeded check for vorbis_synthesis_restart()
This was added in 1.0.1 more than 16 years ago, I think we
can safely assume this is always present now. Also in tremor.

While at it, bump vorbis requirement to 1.3.1 from 2010.
2019-12-09 07:33:55 +00:00
Tim-Philipp Müller
98ebcb4b8a pango: check if localtime_r is available
HAVE_LOCALTIME_R was used, but never defined.
2019-12-09 07:33:55 +00:00
Ambareesh "Amby" Balaji
d7913a0d14 opusenc: Add low delay option
Fixes #681
2019-11-17 18:23:59 +00:00
Nicolas Dufresne
95abc6c263 gldownload: Fix renegotiation loop
When DMABuf was tried, we would renegotiate back and fourth between
DMABuf and system memory if the export failed. This would happen for
every single frame.

This patch introduces try_dmabuf_exports boolean, which is unset when
an export failed. This boolean is then put back to TRUE when upstream
pushes new caps, or downstream pushes a reconfigure event.
2019-11-11 17:11:45 -05:00