Commit graph

166 commits

Author SHA1 Message Date
Sebastian Dröge
6df59ec79f ptp: Work around bug in ptpd in default configuration
ptpd is defaulting to the hybrid mode, and was sending invalid multicast
PTP messages in that configuration until ce96c742a88792a8d92deebaf03927e1b367f4a9.
While this commit was made in 2015 there was no release in the meantime.

Work around this by detecting this case and defaulting to the default
values for the given intervals as given by the PTP standard.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4834>
2023-06-11 18:11:58 +00:00
Tim-Philipp Müller
4599796488 Back to development 2023-02-24 00:23:26 +00:00
Tim-Philipp Müller
b7d3037cca Release 1.20.6 2023-02-23 18:23:11 +00:00
Tim-Philipp Müller
1c37d0ddec Update ChangeLogs for 1.20.6 2023-02-23 18:22:59 +00:00
James Hilliard
9ae84e3d08 buffer: fix copy meta reference debug log formatting
Fixes the following valgrind error:
==616== Conditional jump or move depends on uninitialised value(s)
==616==    at 0x4900E34: gst_debug_print_object (gstinfo.c:1143)
==616==    by 0x49010B6: gst_info_printf_pointer_extension_func (gstinfo.c:1215)
==616==    by 0x4959FDB: __gst_printf_pointer_extension_serialize (printf-extension.c:47)
==616==    by 0x495A487: printf_postprocess_args (vasnprintf.c:258)
==616==    by 0x495A52C: __gst_vasnprintf (vasnprintf.c:290)
==616==    by 0x4959F8F: __gst_vasprintf (printf.c:154)
==616==    by 0x4901C1F: gst_debug_message_get (gstinfo.c:791)
==616==    by 0x4901C75: _gst_debug_log_preamble (gstinfo.c:1431)
==616==    by 0x4903208: gst_debug_log_default (gstinfo.c:1575)
==616==    by 0x49020BA: gst_debug_log_full_valist (gstinfo.c:624)
==616==    by 0x490211D: gst_debug_log_valist (gstinfo.c:656)
==616==    by 0x49021AD: gst_debug_log (gstinfo.c:533)
==616==    by 0x48DDC11: gst_buffer_copy_into (gstbuffer.c:693)
==616==    by 0x48DF5F1: gst_buffer_copy_with_flags (gstbuffer.c:727)
==616==    by 0x48DF640: gst_buffer_copy_deep (gstbuffer.c:756)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4037>
2023-02-22 10:27:07 +00:00
Jan Alexander Steffens (heftig)
e495bff025 pad: Don't leak user_data in gst_pad_start_task
When the task already exists, we forgot to free the passed `user_data`.
This wasn't an issue for most C code, which doesn't pass a
`GDestroyNotify`, but bindings such as gstreamer-rs do!

That said, allocating a trampoline in gstreamer-rs just for it to get
thrown away again is awkward. Maybe we need a `gst_pad_resume_task`?

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3923>
2023-02-09 23:59:05 +00:00
medithe
724de12336 gstreamer: bin: Don't unlock unlocked mutex in gst_bin_remove_func()
Calling `g_mutex_unlock(mutex)` leads to an undefined behavior if the
mutex is not locked by the current thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3909>
2023-02-07 20:00:47 +00:00
Sebastian Dröge
7905628f32 gst: Fix gst_type_find_peek() return value annotation
It's not possible to annotate a in-parameter for a return value array as
the array length. Both are assumed to have the same direction and the
current annotation causes the size parameter to be considered an out
parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3794>
2023-01-26 03:19:46 +00:00
Edward Hervey
54697df6e3 multiqueue: Handle use-interleave latency live pipelines
Due to the dynamic nature of multiqueue, when `use-interleave` is used we can't
report a maximum tolerated latency (when queried) since it is calculated
dynamically.

When in such live pipelines, we need to make sure multiqueue can handle the
lowest global latency (provided by this event). Failure to do that would
result in not providing enough buffering for a realtime pipeline.

Fixes #1732

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3792>
2023-01-26 02:18:48 +00:00
Tim-Philipp Müller
bddfb98353 gstreamer: update translations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3764>
2023-01-21 11:15:45 +00:00
Jan Alexander Steffens (heftig)
e5ddd94da6 input-selector: Take the object lock while iterating sinkpads
Otherwise we can race with pad removal and crash from use-after-free.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1717
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3747>
2023-01-18 19:48:53 +00:00
Philippe Normand
9aa8393e06 tests: gstelement: Fix test_add_pad_while_paused flakiness
`gst_element_remove_pad()` doesn't automatically deactivate the pad, it has to
be done explicitly beforehand, otherwise the pad task might be left dangling,
exposed to undefined behaviour.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3651>
2022-12-28 19:02:42 +01:00
Alicia Boya García
ebe44034c1 gstelement: fix deadlock in gst_element_add_pad() when >=PAUSED
gst_element_add_pad() is supposed to activate the pad if the element
state is >= PAUSED and the pad is not already active.

Unfortunately, before this patch, the activation was performed while the
element lock was still taken, which ended causing a deadlock in
gst_pad_start_task() as it attempted to post `stream-status` message in
the element, which also requires the element lock.

Elements could work around this bug by activating the pad manually
before adding it to the element.

This patch fixes the problem by performing pad activation only after the
element lock has been released.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3651>
2022-12-28 13:16:33 +01:00
Sebastian Dröge
ccd582c332 bin: Fix race conditions in tests
The latency messages are non-deterministic and can arrive before/after
async-done or during state-changes as they are posted by e.g. sinks from
their streaming thread but bins are finishing asynchronous state changes
from a secondary helper thread.

To solve this, expect latency messages at any time and assert that we
receive one at some point during the test.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3647>
2022-12-27 20:38:37 +01:00
Tim-Philipp Müller
4a99827d4c Back to development 2022-12-20 00:39:36 +00:00
Tim-Philipp Müller
f7806a854a Release 1.20.5 2022-12-19 23:34:46 +00:00
Tim-Philipp Müller
554efedd44 Update ChangeLogs for 1.20.5 2022-12-19 23:34:34 +00:00
Sebastian Dröge
94a0d579d7 systemclock: Use futex_time64 syscall if available (32-bit systems) and use correct struct timespec definition
See also https://gitlab.gnome.org/GNOME/glib/-/issues/2634

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1648

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3572>
2022-12-15 13:16:03 +00:00
Xavier Claessens
68079f03f9 hotdoc: gst-hotdoc-plugins-scanner is not needed for libraries
Meson >= 0.64.0 does not allow any more to add executables into
hotdoc.generate_doc(..., dependencies: ...) and it should not be needed
any way.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3554>
2022-12-10 13:49:06 +00:00
Tim-Philipp Müller
7f093a779a meson: fix check for pthread_setname_np()
Need to define _GNU_SOURCE.

Fixes #1542

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3539>
2022-12-07 12:06:03 +00:00
Edward Hervey
363f8bcc1e gst-inspect: Don't leak list
Just iterate the list instead of trying to be smart...

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3499>
2022-12-04 13:48:02 +00:00
Célestin Marot
8e8a5d94d4 fakesrc: avoid time overflow with datarate
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3438>
2022-11-19 12:02:18 +00:00
Sebastian Dröge
30d894866d allocator: Switch allow-none annotations to nullable / optional
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
2022-11-09 01:47:51 +00:00
Sebastian Dröge
ef8474aad5 allocator: Copy allocator name in gst_allocator_register()
The parameter is not marked as `transfer full` and stays around in the
hash table, so we will have to copy it ourselves.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3369>
2022-11-09 01:47:51 +00:00
Edward Hervey
5ec482bdcf gstpad: Fix non-serialized sticky event push
With non-serialized sticky events, such as GST_EVENT_INSTANT_RATE, we both want
to store the event (for later re-linking) *AND* push the event in a non-blocking
way.

We therefore must *not* propagate pending sticky events if the event is "sticky
or serialized" but only if it's "serialized"

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3332>
2022-11-04 19:33:12 +00:00
Sebastian Dröge
4925002d87 core/base: Only post latency messages if the latency values have actually changed
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1525

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3291>
2022-10-27 23:18:37 +01:00
Edward Hervey
5d22503a55 concat: Properly propagate EOS seqnum
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3288>
2022-10-27 16:38:02 +01:00
Seungha Yang
8a7ae99567 padtemplate: Fix annotations
gst_caps_replace() does not take ownership of the new caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3262>
2022-10-25 10:12:21 +01:00
Bunio_FH
b7ae311c75 gstminiobject: shares capacity increase
during the MSE (WebKit) tests from Apple suite:
https://hls-streaming.cdn-apple.com/hls_conformance/dist/v1.1/index.html?pretty=true&whitelist=MSE%20Suite
webkit attempts to add a single audio buffer containing ~35.5k frames.
when corresponding GstSamples are pulled buffer is being referenced
more than object capacity allows: 2^15-1. since the case could be considered
malformed a surgical patch is applied to increase the capacity.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3233>
2022-10-20 12:42:56 +00:00
Tim-Philipp Müller
825746d121 Back to development 2022-10-12 18:40:25 +01:00
Tim-Philipp Müller
642730bd67 Release 1.20.4 2022-10-12 16:39:51 +01:00
Tim-Philipp Müller
7275d3d136 Update ChangeLogs for 1.20.4 2022-10-12 16:39:40 +01:00
Guillaume Desmottes
b5fde8d856 aggregator: fix input buffering
We need to be able to buffer at least the aggregator latency +
upstream latency, which is the value used to compute the aggregator
deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3142>
2022-10-07 21:40:24 +00:00
Edward Hervey
4ab71ca3f1 queue2: Hold the lock when modifying sinkresult
As it's done elsewhere. Avoids a potential race of the field being modified in
the meantime.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3111>
2022-10-03 17:19:53 +01:00
Philipp Zabel
1c8244a19d buffer: drop parent meta in deep copy/foreach_metadata
The purpose of a deep buffer copy is to be able to release the source
buffer and all its dependencies. Attaching the parent buffer meta to
the newly created deep copy needlessly keeps holding a reference to the
parent buffer.

The issue this solves is the fact you need to allocate more
buffers, as you have free buffers being held for no reason. In the good
cases it will use more memory, in the bad case it will stall your
pipeline (since codecs often need a minimum number of buffers to
actually work).

Fixes #283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3090>
2022-09-29 11:57:53 +01:00
Sebastian Dröge
c2c20d2437 gsturi: When setting the same string again do nothing
Otherwise code like gst_uri_set_host(uri, gst_uri_get_host(uri)) would
first free the string, then create a copy of the freed string and then
assigned that.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3081>
2022-09-27 09:37:20 +01:00
Paweł Stawicki
0589e3ca80 queue2: Fix deadlock when deactivate is called in pull mode
check is flush was called before waiting on condition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3058>
2022-09-20 17:22:05 +01:00
Martin Dørum
674bb309d8 gstpluginloader: Don't hang on short reads/writes
If read_one or write_one was called but the stream closed before it could
read/write a whole packet, read_one/write_one would hang indefinitely,
consuming 100% CPU. This commit fixes that by treating a short read/write
as an error.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2994>
2022-09-07 10:15:51 +01:00
Xavier Claessens
1ba67eab9e gst_init: Initialize static plugins just before dynamic plugins
All plugins needs to be initialized after `gst_initialized = TRUE;`
otherwise they could complain that gst_init() has not been called.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2991>
2022-09-07 09:38:20 +01:00
Olivier Crête
fa10a28016 value: Use g_critical() when trying to serialize things that can't be
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2986>
2022-09-06 23:05:21 +01:00
Olivier Crête
1d32310089 gstvalue: Don't loop forever when serializing invalid flag
The serialization code would loop forever if an invalid flag was sent into it.

With unit test for this corner case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2986>
2022-09-06 23:05:20 +01:00
Nirbheek Chauhan
aaa75d022a meta: Set the parent refcount of the GstStructure correctly
The parent refcount is of the *transformed* buffer, not the input
buffer.

Also update the docs to clarify that @transbuf is the transformed
buffer, and not the buffer on which a transformation is being
performed.

Due to this bug, modifying the structure of a meta that has been
copied to another buffer fails with:

gst_structure_set: assertion 'IS_MUTABLE (structure) || field == NULL' failed

Add a test for the same.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2894>
2022-08-15 22:52:49 +01:00
Sebastian Dröge
3aafef7955 gst: Protect initialization state with a recursive mutex.
Otherwise a gst_init() call from a plugin would deadlock if the plugin
is loaded as part of registry updating.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/940

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Sebastian Dröge
d80589592d registry: Remove dead code
Initialization/updating of the registry can't possible fail and all code
paths always returned TRUE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Sebastian Dröge
e192116c37 gst: Don't fail gst_init() if updating the registry fails
Everything is already marked as initialized at that point and by failing
no tracers would be loaded or plugin feature rank overrides would be
applied.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2858>
2022-08-10 16:05:51 +01:00
Tim-Philipp Müller
703f05b6f9 tracers: leaks: delay type name lookup
Micro optimisation: Store the quark of the type name when tracking
objects and only do the quark to string conversion (hashtable lookup)
later when we actually need the string.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:24 +01:00
Corentin Damman
6212831f04 tracers: leaks: fix potentially invalid memory access when trying to detect object type
The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

Eliminates all remaining uses of object_is_gst_mini_object().

Fixes #1334

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:24 +01:00
Tim-Philipp Müller
5948da1a1f tracers: leaks: fix potentially invalid memory access when trying to detect object type
The is_gst_mini_object_check would sometimes detect a proper GObject
as a mini object, and then bad things happen.

We know whether a pointer is a proper GObject or a MiniObject here
though, so just pass that information to the right code paths and
avoid the heuristics altogether.

There are probably more cases where the check should be eliminated.

Fixes #1334, maybe

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2846>
2022-08-05 23:37:23 +01:00
Rafael Sobral
43b15a5b01 aggregator: fix reversed active/flushing arguments in debug log output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2826>
2022-08-01 23:53:25 +01:00
Jan Alexander Steffens (heftig)
185c231871 gstinfo: Parse "NONE" as a valid level name
This allows using `NONE` in `GST_DEBUG`,
`gst_debug_set_threshold_from_string`, etc. It was accessible before,
but only via the integer `0`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2775>
2022-07-19 18:22:13 +02:00