Commit graph

19199 commits

Author SHA1 Message Date
Seungha Yang
b1b5b2d4cd 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/848>
2021-07-20 21:14:32 +09:00
Nirbheek Chauhan
ab6faaeeb4 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/852>
2021-07-19 15:28:05 +00:00
Nirbheek Chauhan
60a7a2e705 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/853>
2021-07-19 20:05:29 +05:30
Stéphane Cerveau
342c05e778 gitlab: add bug template
To clarify what is expected in an issue description and avoid
issue which is just an usage issue, add a bug template in gitlab.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/836>
2021-07-15 11:17:10 +02:00
Kasper Steensig Jensen
674e6fcf65 Add meson description for tracer_hooks
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/849>
2021-07-08 11:48:58 +02:00
Edward Hervey
8c08cdf9fe gstinfo: Improve usage of libdw for backtraces
When getting backtraces, we were always creating a new Dwfl context and then
discarding it. The problem with that is that it resulted in having to re-scan a
lot of information for every single backtrace.

In order to fix that issue, use a global on-demand Dwfl context and use it with
a lock.

Furthermore, we were scanning the mappings of the
process (dwfl_linux_proc_report) for *every single step* in the backtrace, and
that function is horrendously expensive (does sscanf on /proc/PID/maps
...). While there is a possibility that new mappings might be available (new
plugins being loaded for example), we can limit ourselves to just do it once per
backtrace.

These two modifications speed up the elements_leaks unit test (which traces all
pads with full backtraces) by a factor of 6.

Partially fixes #567

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/504>
2021-07-05 07:52:55 +00:00
Jan Schmidt
df52bdc5d4 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/846>
2021-07-02 01:59:18 +10:00
Sebastian Dröge
ba294415d7 basesink: Post a latency message whenever we're ready to answer the query
Usually the latency message is only posted whenever latency of an
element changes but that might be too early as the sinks might not be
able to query the latency at that point yet.

Similarly adding a new sink should cause latency reconfiguration once
that new sink is able to report its latency.

This fixes latency configuration in pipelines where webrtcbin is the
only "sink", i.e. it is used in a sendonly session. Before, the latency
would always be configured to 0.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/843>
2021-06-28 19:59:47 +03:00
Sebastian Dröge
81bd8913b5 basesrc: Print segments with GST_SEGMENT_FORMAT and not GST_PTR_FORMAT
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/842>
2021-06-24 07:01:38 +00:00
Víctor Manuel Jáquez Leal
9be63d2ca3 Fix GI annotations.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/840>
2021-06-22 13:02:41 +02:00
Corentin Damman
d157b23fb0 Update COPYING to LGPL 2.1
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/835>
2021-06-21 08:36:49 +00:00
Jan Schmidt
7f29361488 parse: Don't do delayed property setting for top-level properties.
If a property is supplied to gst-launch-1.0 to set on a property that
implements GstChildProxy, it would always accept any property name
and try to set it later. This means that (for example) decodebin
will accept and not complain about property names that can never exist like:

gst-launch-1.0 videotestsrc ! decodebin NON-EXISTING_PROPERTY=adsfdasf ! fakesink

Instead, only try to do deferred property setting for property names
that contain the :: separator that indicates it's a setting on a child
that might appear later.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/832>
2021-06-21 07:32:27 +00:00
François Laignel
5230cab38d Check mandatory ClockTime arguments
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/837>
2021-06-16 12:33:28 +02:00
Doug Nazar
b16e96dd87 Use g_memdup2() where available and add fallback for older GLib versions
glib 2.68 deprecates g_memdup(). Replace with g_memdup2() and
add fallback if compiling against older versions, since we
want to avoid deprecation warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/803>
2021-06-08 07:59:05 +00:00
Alba Mendez
4c75ec53e7 introspection: annotate ownership in more vfuncs
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/831>
2021-06-07 09:29:58 +00:00
Alba Mendez
b296e914a5 introspection: annotate handle_message ownership
(fixup/improvement to !747) Correct the ownership
annotation for `message` in the `handle_message` vfunc,
and remove the equivalent phrase elsewhere (following
rules of !747.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/830>
2021-06-04 04:48:39 +00:00
Guillaume Desmottes
aaaf85054f tracers: leaks: log when tracer is exiting
Useful when debugging leaks to make sure that the tracer is properly
finalized (gst_deinit() being actually called, etc).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/828>
2021-06-02 06:11:58 +00:00
Tim-Philipp Müller
81778f9d93 Back to development 2021-06-01 15:28:13 +01:00
Tim-Philipp Müller
6fa03dd151 Release 1.19.1 2021-06-01 00:07:55 +01:00
tyler-aicradle
ea33144147 systemclock: fall back to g_get_monotonic_time
This allows us to cover the case where we're on some unknown system that
doesn't have a known native precision monotonic time source. Sadly this
reintroduces some of the complexity removed in previous commits.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/829>
2021-05-27 16:01:17 -05:00
tyler-aicradle
5328941632 systemclock: reorg real and mono time functions for macOS and win32
This simplifies the pre-processor checks a little to make it easier to
follow the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/829>
2021-05-27 09:44:29 -05:00
tyler-aicradle
d8237f150c systemclock: Use g_get_real_time on Windows and macOS for realtime clock
These targets previously were unable to produce wall clock times when
using GstSystemClock, this change makes it possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/829>
2021-05-27 09:25:29 -05:00
tyler-aicradle
bb77f41abf systemclock: Reorganize defined checks for parts of GstSystemClock
The gst_system_clock_get_internal_time and
gst_system_clock_get_resolution functions had some nested defined checks
making this code somewhat harder to reason about and much harder to
change. The logical meaning of the checks has changed but the actual
code coming out of the pre-processor should not have changed
significantly. The main logical change was flattening the checks for
existence of posix timing functionality, from what I can tell these
functions aren't available on Windows where they were trying to be
included. I have checked the Linux and macOS output and they are
functionally unchanged.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/829>
2021-05-27 09:25:24 -05:00
Tim-Philipp Müller
dd22ec68d2 buffer: rename new gst_buffer_new_copy() to gst_buffer_new_memdup()
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/826

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/827>
2021-05-24 19:01:58 +01:00
Tim-Philipp Müller
04fe2233f0 buffer: add gst_buffer_new_copy() convenience function
More convenient and discoverable variant of the fairly widely-used
gst_buffer_new_wrapped(g_memdup(data,size),size).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/826>
2021-05-23 07:32:09 +00:00
Tim-Philipp Müller
caa608e5c0 docs: random: clean up outdated documents
Most of these are only of historical interest, and for that it's
fine if they're maintained in the git history. They're confusing
for anyone stumbling across them expecting documentation relating
to current versions of GStreamer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/824>
2021-05-16 12:28:53 +01:00
Mathieu Duponchelle
2a710a484c 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/819>
2021-05-14 12:53:20 +00:00
Nicolas Dufresne
76cd3ff183 doc: base: Fix reference to virtual function
The hotdoc syntax is #ClassName::function, but the code was using
without anything before.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/808>
2021-05-12 13:17:00 +00:00
Doug Nazar
9efd519c81 gstcheck: Ensure unused threadpool threads are stopped
Ensures that all unused threads are exited before the atexit()
handlers run.

This prevents a race with any thread that used the OpenSSL library
between it's thread cleanup routine and it's atexit() cleanup routine
which can cause a SIGSEGV.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/812>
2021-05-12 03:08:30 +00:00
Mathieu Duponchelle
d7272b3247 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/818>
2021-05-11 19:13:08 +00:00
Doug Nazar
24f0370c2d 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/814>
2021-05-06 23:04:27 -04:00
Doug Nazar
c71805c565 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/814>
2021-05-06 23:04:27 -04:00
Doug Nazar
135f517ea3 downloadbuffer: return flow error on read error
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/814>
2021-05-06 23:04:27 -04:00
Nikolay Sivov
41ee497b90 gstutils: Fix typo in the comment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/813>
2021-05-06 22:20:57 +03:00
Jan Alexander Steffens (heftig)
4ad1c8b7c9 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/810>
2021-05-06 13:08:26 +02:00
Chris White
b48e32ab00 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/809>
2021-05-06 10:35:51 +03:00
François Laignel
1a8dfdfc54 Introduce gst_element_request_pad_simple
The name `gst_element_get_request_pad()` is confusing to people
learning GStreamer. `gst_element_request_pad_simple()` aims at
providing the exact same functionality, while making it more
explicit it is a simplified `gst_element_request_pad()`.

`gst_element_request_pad_simple()` is consistent with other
functions such as `gst_element_seek_simple`.

This commit deprecates `gst_element_get_request_pad()` so that a
compilation warning is emitted when used and incite developers
to use the more explicit `gst_element_request_pad_simple()`.

See also https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/743#note_886586

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/802>
2021-05-04 15:49:32 +02:00
Doug Nazar
77ab7b42b3 harness: Fix object used to log caps warning.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/801>
2021-04-20 23:54:52 -04:00
Miguel Paris
fad603011d 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/798>
2021-04-19 14:58:43 +02:00
Edward Hervey
4eef67cc7e 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/796>
2021-04-16 11:41:26 +02:00
Doug Nazar
b500ac31ab tests: Remove invalid buffer test in test_get_allowed_caps.
Passing a non-GObject pointer causes SIGSEGV on certain architectures.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/790>
2021-04-12 10:15:47 +00:00
Doug Nazar
d323942999 leaks: Fix SIGSEGV detecting object type.
G_IS_OBJECT & GST_IS_OBJECT work by following pointers which is unsafe
on certain architectures. GstMiniObject detection however does a lookup
to see if it's a valid type derived from G_TYPE_BOXED.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/791>
2021-04-12 05:18:25 -04:00
Chris White
c711c8ed39 allocator: add gst_allocation_params_new()
This permits creating GstAllocationParams instances on the heap, which
is useful for language bindings that can handle GBoxed types.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/788>
2021-04-10 10:46:28 -04:00
Doug Nazar
f52937d1ff 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/786>
2021-04-08 07:27:07 +00:00
Jose Quaresma
9f95805869 gstpluginloader: when env var is set do not fall through to system plugin scanner
If we set a custom GST_PLUGIN_SCANNER env var, then we probably want to use that and only that.

Falling through to the one installed on the system is problamatic in cross-compilation
environemnts, regardless of whether one pointed to by the env var succeeded or failed.

taken from:
http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-multimedia/gstreamer/gstreamer1.0/0001-gst-gstpluginloader.c-when-env-var-is-set-do-not-fal.patch?id=0db7ba34ca41b107042306d13a6f0162885c123b

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/669>
2021-04-07 22:56:47 +00:00
Jan Alexander Steffens (heftig)
10b38146e8 gst-inspect: Allow overriding DEFAULT_LESS_OPTS with GST_LESS
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/777>
2021-04-07 22:01:14 +00:00
Sebastian Dröge
defe732ae0 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/784>
2021-04-06 21:17:56 +03:00
Chris White
96b10c158f caps: Add gst_caps_features_new_single()
For use with a single feature now that gst_caps_features_new() is
G_GNUC_NULL_TERMINATED.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774#note_855357

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774>
2021-04-01 20:55:13 -04:00
Chris White
7954eaaf25 typefind: add gst_type_find_suggest_empty_simple()
For cases where you only need a media type and no other fields.

https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774#note_848664

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774>
2021-04-01 20:55:09 -04:00
Chris White
a38d06cb1c gst: Add missing G_GNUC_NULL_TERMINATED markers
Functions that require NULL as their last vararg are marked so the
compiler can warn on missing NULL.

Also, document the NULL terminator for gst_make_element_message_details()
and gst_tracer_record_new().

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/774>
2021-04-01 20:53:26 -04:00