Commit graph

19080 commits

Author SHA1 Message Date
Matthew Waters
d2ba6b3c91 element: NULL the lists of contexts in dispose()
If dispose() is called more than once, we may double unref the list of
GstContext's.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/876>
2021-08-27 13:00:07 +01:00
Jan Alexander Steffens (heftig)
e0a3af028f pad: Keep IDLE probe hook alive during immediate callback
When the probe returns GST_PAD_PROBE_REMOVE and gets called concurrently
from the streaming thread while we're in the callback here, the hook has
already been destroyed by the time we've reacquired the object lock.
Consequently, cleanup_hook gets passed an invalid pointer.

Keep another reference to the hook alive to avoid this situation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/874>
2021-08-24 16:05:47 +01:00
Jan Schmidt
123280064e parse: Backport "Don't do delayed property setting..."
Backport "parse: Don't do delayed property setting for top-level
properties."

Modified version of https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/832
that only warns when trying to set a non-existent property instead of
generating a hard parse error, to preserve compatibility.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/839>
2021-08-23 11:47:32 +00:00
Edward Hervey
23171cb6af concat: Properly propagate seqnum of segment events
Was broken by https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/819

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/872>
2021-08-20 15:56:56 +01:00
Edward Hervey
0b50501c43 pad: Ensure last flow return is set on sink pads in push mode
The last flow return field was never updated on sink pads in push mode. This
fixes it and makes it consistent.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/870>
2021-08-18 20:33:48 +01:00
Tim-Philipp Müller
a3ebe6c010 plugin: load plugins with unknown license strings
We shouldn't fail to load plugins just because we don't
recognise the license string. It's not our job to validate
licenses, and the license list is outdated and ambiguous
anyway.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/865>
2021-08-11 11:05:45 +01:00
Seungha Yang
0a63363f1a basesink: Don't swap rstart/rstop when stepping
Step handling is implemented based on unmodified start/stop
segment running time, and basesink takes rate into account for
stepping. This commit is partially undoing new behavior introduced by
the commit of 39b9cc554c when stepping.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/858>
2021-07-22 15:02:50 +00:00
Nirbheek Chauhan
49ae75f24d gstptpclock: Don't leak the GList
120 bytes in 5 blocks are definitely lost in loss record 7,615 of 9,510
   at 0x484486F: malloc (vg_replace_malloc.c:380)
   by 0x58A2938: g_malloc (gmem.c:106)
   by 0x58BA1F4: g_slice_alloc (gslice.c:1069)
   by 0x588F059: g_list_prepend (glist.c:335)
   by 0x5B9C5C0: select_best_master_clock (gstptpclock.c:756)
   by 0x5B9CA8E: cleanup_cb (gstptpclock.c:1930)
   by 0x589AD20: g_timeout_dispatch (gmain.c:4889)
   by 0x589A4CE: UnknownInlinedFun (gmain.c:3337)
   by 0x589A4CE: g_main_context_dispatch (gmain.c:4055)
   by 0x58EE4E7: g_main_context_iterate.constprop.0 (gmain.c:4131)
   by 0x5899A92: g_main_loop_run (gmain.c:4329)
   by 0x5B9BA4C: ptp_helper_main (gstptpclock.c:1980)
   by 0x58C8C31: g_thread_proxy (gthread.c:826)

576 bytes in 24 blocks are definitely lost in loss record 8,782 of 9,510
   at 0x484486F: malloc (vg_replace_malloc.c:380)
   by 0x58A2938: g_malloc (gmem.c:106)
   by 0x58BA1F4: g_slice_alloc (gslice.c:1069)
   by 0x588F059: g_list_prepend (glist.c:335)
   by 0x5B9C5C0: select_best_master_clock (gstptpclock.c:756)
   by 0x5B9EFA0: handle_announce_message (gstptpclock.c:934)
   by 0x5B9EFA0: handle_ptp_message (gstptpclock.c:1765)
   by 0x5B9EFA0: have_stdin_data_cb (gstptpclock.c:1851)
   by 0x589A4CE: UnknownInlinedFun (gmain.c:3337)
   by 0x589A4CE: g_main_context_dispatch (gmain.c:4055)
   by 0x58EE4E7: g_main_context_iterate.constprop.0 (gmain.c:4131)
   by 0x5899A92: g_main_loop_run (gmain.c:4329)
   by 0x5B9BA4C: ptp_helper_main (gstptpclock.c:1980)
   by 0x58C8C31: g_thread_proxy (gthread.c:826)
   by 0x5DA4298: start_thread (pthread_create.c:481)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/857>
2021-07-22 14:28:48 +00:00
Nirbheek Chauhan
bbbf0c10bf gstpad: Don't spam INFO when default-chaining a buffer list
This is being logged for each buffer, so it should not use INFO.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/856>
2021-07-22 14:15:47 +01:00
Jan Schmidt
f9364a3024 parse: Fix a critical when using the : operator.
Fix "has no handler with id" output criticals when the :
multilink operator is used. These were caused by disconnecting
a signal handler multiple times.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/850>
2021-07-08 13:16:11 +01:00
Sebastian Dröge
2023446da1 basesrc: Print segments with GST_SEGMENT_FORMAT and not GST_PTR_FORMAT
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/844>
2021-06-24 10:11:02 +01:00
Olivier Crête
63350d1930 aggregator: Release the SRC lock while querying latency
This is required because the query could be intercepted and the
application could send any other requests to the element from this
thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/834>
2021-06-11 14:36:35 +01:00
Mathieu Duponchelle
53c68d92d8 concat: adjust running time offsets on events
When concat adjusts the base of the segments it forwards
downstream, it needs to also adjust the running time offsets,
as GstPad does when an offset is set by the application on a pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/823>
2021-05-14 19:27:02 +01:00
Mathieu Duponchelle
96800c0b4a concat: fix locking in SEGMENT event handler
concat->current_start_offset needs the lock taken for safe access,
as it can be accessed from outside of the streaming thread, eg
in release_pad.

An early break is also added for an error case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/822>
2021-05-14 17:12:57 +01:00
Doug Nazar
ab4ec53d56 sparsefile: Fix sparsefile on Win32
When switching between read/write a fseek() or fflush() is required.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/821>
2021-05-14 14:36:57 +01:00
Doug Nazar
20d4184a69 downloadbuffer: close file before trying to remove
On Windows, the file handles must be closed before you can delete a file.
Also, it would cause an error if you try to close an already closed handle.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/821>
2021-05-14 14:36:57 +01:00
Doug Nazar
a16492a61f downloadbuffer: return flow error on read error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/821>
2021-05-14 14:36:57 +01:00
Jan Alexander Steffens (heftig)
1dcdde9fdf multiqueue: Ensure peer pad exists when iterating internal links
The pads can be NULL when we're racing with pad removal, e.g. when the
pads get removed between `gst_pad_iterate_internal_links` acquiring the
parent element and `gst_multi_queue_iterate_internal_links` locking the
multiqueue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/811>
2021-05-06 12:59:58 +01:00
Miguel Paris
0d1fad0e92 pad: clear probes holding mutex
Protect clearing probes against concurrent modification which might happen
due to dispose does NOT guarantee that the object is not used anymore, as
it could be referenced again and so being continued used.
So, as in the rest of places where probes hook list is used, on dispose
it should be accessed holding the mutex "GST_OBJECT_LOCK (pad);" as
GHookList is not thread-safe.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/800>
2021-04-20 15:13:22 +01:00
Edward Hervey
b566cbe022 queue2: Refuse all serialized queries when posting buffering messages
When posting buffering messages there are no safe places or timing to avoid
deadlocks.

Previously the code was trying to be "smart" by only forwarding serialized
queries if the queue was empty ... but that could happen when queue2 hadn't yet
posted a 100% buffering message. Meaning the pipeline might be paused and
pushing a serialized query downstream might never complete.

Therefore let's completely disable forwarding of serialized queries when
`queue2` is used as a buffering element (meaning `ALLOCATION` and `DRAIN`
queries).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/797>
2021-04-17 09:28:46 +01:00
Edward Hervey
93e6261db7 systemclock: Update monotonic reference time when re-scheduling
There is no guarantee that the clock is currently advancing, therefore if we
re-schedule (because of timeouts) a clock wait, we need to re-acquire the
current monotonic clock value against which we will wait.

Avoids spinning the cpu like mad (due to constant timeout) when clocks are
PAUSED.

Fixes #673

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/794>
2021-04-13 12:24:02 +00:00
Doug Nazar
daf4e5b410 clocksync: Fix providing system clock by default
clocksync defaults to sync=true so should advertise it by default.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/795>
2021-04-13 11:19:54 +01:00
Matthew Waters
fdf6a793dc gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead.  GCC 11 has started warning about using volatile
with atomic operations.

https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/793>
2021-04-13 01:58:54 +01:00
Sebastian Dröge
934e6bb114 aggregator: Release pads' peeked buffer when removing the pad or finalizing it
The peeked buffer was always reset after calling ::aggregate() but under
no other circumstances. If a pad was removed after peeking and before
::aggregate() returned then the peeked buffer would be leaked.

This can easily happen if pads are removed from the aggregator from a
pad probe downstream of the source pad but still in the source pad's
streaming thread.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/785>
2021-04-06 20:02:43 +01:00
Tim-Philipp Müller
102232fa62 Back to development 2021-03-15 19:48:45 +00:00
Tim-Philipp Müller
eacb7aa8d1 Release 1.18.4 2021-03-15 17:47:25 +00:00
Guillaume Desmottes
5700308701 clock: define AUTO_CLEANUP_FREE_FUNC for GstClockID
GstClockID is secretly a gpointer so we can't use g_autoptr(),
instead user can do:
  g_auto (GstClockID) clock_id = 0;

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/770>
2021-03-11 17:48:40 +00:00
Sebastian Dröge
f90e9a71dd info: Don't leak log function user_data if the debug system is compiled out
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/743>
2021-01-31 13:41:41 +00:00
Seungha Yang
d5150b7c54 task: Use SetThreadDescription Win32 API for setting thread name
Since Windows 10 1607, we can make use of SetThreadDescription() API
for setting thread name. Unlike previously used exception based
method, this API will preserve configured thread name on dump file.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/741>
2021-01-30 15:10:16 +00:00
Marijn Suijten
41999d974e gstmemory: Mark memory_map @info as caller-allocates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/740>
2021-01-28 17:55:51 +00:00
Marijn Suijten
50214723d7 gstbuffer: Mark buffer_map* @info as caller-allocates
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/740>
2021-01-28 17:55:50 +00:00
Marijn Suijten
8922fc6436 gst,base: Take GstAllocationParams parameter by const ptr
This parameter is only informational and should not be modified. Enforce
this at compile-time and to get the right signature in G-IR.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/740>
2021-01-28 17:55:50 +00:00
Tim-Philipp Müller
615d4b511a Back to development 2021-01-14 02:16:45 +00:00
Tim-Philipp Müller
a42fe476d3 Release 1.18.3 2021-01-13 21:05:14 +00:00
Seungha Yang
968f261fe2 uri: Remove leftover documentation
Follow-up from https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/728

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/731>
2021-01-13 03:47:34 +09:00
Seungha Yang
9aa009ab45 gst: Add non-inline methods for bindings to able to use core APIs
Provide non-inline version of refcounting APIs so that it can be
consumed by bindings

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer-sharp/-/issues/46
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/731>
2021-01-12 15:26:08 +00:00
Jakub Adam
16178d46c8 harness: don't use GST_DEBUG_OBJECT with GstHarness
GstHarness is not a GObject. Fixes assert on recently added check in
gst_debug_log_valist() if GST_ENABLE_EXTRA_CHECKS is enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/721>
2020-12-11 16:03:10 +00:00
Tim-Philipp Müller
eb4c1ffb96 Back to development 2020-12-06 23:56:34 +00:00
Tim-Philipp Müller
6a62351b8a Release 1.18.2 2020-12-06 13:21:20 +00:00
Marijn Suijten
865cfb8ea2 check: gst_test_clock_process_next_clock_id returns nullable
It is possible there are no more pending clocks in the chain, in which
case this function returns null.

See also tests like test_single_shot_async_future that validate NULL
returns.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/716>
2020-12-04 16:13:26 +00:00
Sebastian Dröge
877f2b6800 streams: gst_stream_type_get_name() is not nullable
It takes an enum and only the defined values are valid to pass in here
as it's not extensible from the outside.

Add a g_return_val_if_reached() for the unreachable case and return
"invalid".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/713>
2020-12-02 16:41:43 +00:00
Khem Raj
12937488ae gst_private.h: increse padding in struct _GstClockEntryImpl
When compiling for 32bit architectures with 64bit time_t e.g. riscv32,
the static assert that the GstClockEntryImpl smaller or
equal to the struct _GstClockEntryImpl triggered.
(they were 12bytes off).

To fix this, the padding is increased by 8 bytes (on 32bit).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/695>
2020-11-20 14:59:43 +00:00
Bing Song
b39a06065a identity/clocksync: Also provide system clock if sync=false
identity should provide when sync=true. Don't provide when sync=false.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/697>
2020-11-20 14:00:16 +00:00
Jonathan Matthew
d1fb776782 typefind: copy seqnum to new segment event
Fixes: #635
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/701>
2020-11-16 10:47:28 +00:00
Sebastian Dröge
2334f5451f Add some missing nullable annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/699>
2020-11-05 15:48:50 +00:00
Jonathan Matthew
39df723ba5 queue2: Fix modes in scheduling query handling
Create a new query to send upstream and copy the flags across from it,
rather than reusing the same query, as this allows us to prevent use
of pull mode when we don't have a download file.

Fixes: #629
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/696>
2020-11-04 10:00:18 +00:00
Chris White
e231f1d3af gstinfo: colorize PIDs in log messages
The PIDs on log lines were supposed to be colorized before, but the
escape sequence was incorrect.  With this change, the code uses the
correct sequence to colorize those PIDs.  E.g., instead of `\033[334m`
(incorrect), use `\033[34m` (correct).

This makes the log messages easier to read.  It also reduces the chance
that a buggy terminal will choke on the invalid escape sequence.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/624

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/691>
2020-11-02 11:55:30 +00:00
Jan Schmidt
34b4a03f01 harness: Handle element not being set cleanly.
If a harness is created with gst_harness_new_empty(), there
might not be an internal element to unref on cleanup.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/687>
2020-10-30 15:01:25 +00:00
Jan Schmidt
882175dc43 bin: When removing a sink, check if the EOS status changed.
Removing a sink that hasn't posted EOS might change the bin itself
to EOS if it's the last remaining non-EOSed sink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/685>
2020-10-30 12:41:36 +00:00
Nicolas Dufresne
c983df161c aggregator: Include min-upstream-latency in buffering time
While we can fixe the upstream latency using the min-upstream-latency, we
are now forced to use queues (hence more thread) in order to store the pending
data whenever we have an upstream source that has lower latency.

This fixes the issue by allowing to buffer the fixed upstream latency. This is
particularly handy on single core systems were having too many threads can
cause serious performance issues.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/684>
2020-10-29 17:53:53 +00:00