Commit graph

19098 commits

Author SHA1 Message Date
Nirbheek Chauhan
912a39ba6e gstplugin: Better warnings on plugin load failure on Windows
It is an extremely common mistake on Windows to have incorrect PATH
values when loading a plugin, and the error from g_module_error()
(which just calls FormatMessageW()) is very confusing in this case:

 The specified module could not be found.

 https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-#ERROR_MOD_NOT_FOUND

It implies the plugin itself could not be found. The actual issue is
that a DLL dependency could not be found. We need to detect this case
and print a more useful error message.

We should still print the error fetched from FormatMessage() so that
people are able to google for it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1589>
2022-01-28 01:07:08 +00:00
Nirbheek Chauhan
9e58632c71 gst-ptp-helper: Do not disable multicast loopback
Otherwise we cannot run gst-ptp-helper if the PTP master is on the
same device.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1546>
2022-01-20 14:57:01 +00:00
Guillaume Desmottes
7bf0c5b7be concat: fix qos event handling
We were shadowing the sinkpad variable resulting in:
- the QoS event to be send to all sink pads instead of the active one
- the pad to be leaked

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1543>
2022-01-20 11:37:50 +00:00
Seungha Yang
ba873ba8b9 pluginfeature: Fix object leak
Need to release GstPluginFeature object after use

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1534>
2022-01-17 23:58:01 +00:00
Pascal Hache
f263bdcb2b baseparse: fix invalid avg_bitrate after reset
gst_base_parse_reset() does not reset data_bytecount to 0, so
gst_base_parse_update_bitrates() uses a wrong value to calculate
the average bitrate on subsequent pipeline starts. This leads to an
excessive amount of "tag" events being pushed. These events include
very high "bitrate" values that diminish over time, and are produced
until the average bitrate is back to sane values.

Fixes #840

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1285>
2021-10-31 13:10:07 +00:00
Jan Alexander Steffens (heftig)
516f9592e7 multiqueue: Fix query unref race on flush
If the query has already been destroyed at this point, GST_IS_QUERY will
read garbage, can return false and we will try to unref it again.
Instead, make note of whether the item is a query when we dequeue it.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1284>
2021-10-31 12:28:35 +00:00
Sebastian Dröge
3419ad9a45 gst: Initialize optional event/message fields when parsing
These might not exist inside the structure and then we would potentially
keep around uninitialized memory from the caller in the out parameter.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1273>
2021-10-29 18:21:18 +00:00
He Junyan
39ad758fde test: bitwriter: Add a test for reset_and_get_data when not byte unaligned.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1272>
2021-10-29 14:26:18 +00:00
He Junyan
6be57e4247 bitwriter: Fix a memory leak in reset_and_get_buffer.
We should record the ownership of the data before we reset the bitwriter.
Or we will always dup the buffer data and leak the memory.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1272>
2021-10-29 14:26:18 +00:00
He Junyan
68f6730221 bitwriter: Fix the trailing bits lost when getting its data.
In reset_and_get_data and reset_and_get_buffer, it fails to include
the trailing bits less than 8. So, when the bit_size is not byte
aligned, the trailing bits are lost in the return buffer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1272>
2021-10-29 14:26:18 +00:00
Mathieu Duponchelle
7cec3538f5 multiqueue: fix obsolete comment re initial flow status
The initial single queue srcresult is OK, it hasn't been
NOT_LINKED since 2007.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1271>
2021-10-29 11:14:28 +00:00
Mathieu Duponchelle
33ea698ef3 multiqueue: never consider a queue that is not waiting
.. when computing the high id.

After a flush for instance, sq->srcresult is reset to OK,
yet it doesn't make sense to pick a non-existing position
id as the high id when a queue doesn't contain any items
in that situation either.

It is in any case completely OK to let the not-linked stream
get consumed without throttling at this stage, as any
first packet arriving on other single queues will get assigned
a higher position id.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1271>
2021-10-29 11:14:28 +00:00
Jan Alexander Steffens (heftig)
8eebe19cae input-selector: Use proper segments when cleaning cached buffers
We need to use the segment associated with the cached buffer, not the
current segment of the pad, otherwise we miscalculate the running time
of cached buffers from before a segment change.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1270>
2021-10-29 11:30:34 +01:00
Tim-Philipp Müller
4c7bc588e3 Back to development 2021-09-09 00:12:28 +01:00
Tim-Philipp Müller
71c213f99a Release 1.18.5 2021-09-08 20:01:48 +01:00
Dmitry Samoylov
0b7c8ea661 gst: Fix doc comments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/883>
2021-09-08 16:29:09 +01:00
Chris White
248b57499a gst_child_proxy_get_property: accept G_VALUE_INIT
gst_child_proxy_get_property() can now take a value initialized to
G_VALUE_INIT.  This parallels the corresponding change in
g_object_get_property(), GLib 2.60+.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/724#note_738531

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/882>
2021-09-06 17:24:32 +01:00
Jan Schmidt
ac70fb78c4 multiqueue: Use running time of gap events for wakeups.
Use gap events to update the next_time of a queue the same
as buffers or segment events. Fixes problems where a group
consisting only of sparse streams primarily driven by
gap events would stall with a full multiqueue because
unlinked streams in the group were not being woken to
push data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/881>
2021-09-06 09:57:59 +01:00
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