Commit graph

19227 commits

Author SHA1 Message Date
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
Pieter Willem Jordaan c899d0a52c systemclock: Fix deadlock on clock_nanosleep
Always use the monotonic clock's diff and end time for clock_nanosleep to have predictable behaviour even with other clock types.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/779>
2021-03-31 21:16:36 +02:00
Jason Carrete bda42a7a00 Update gst-launch-1.0.1
Fixed a small typo in the gst-launch-1.0 man page

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/780>
2021-03-26 21:00:54 +00:00
Sebastian Dröge 96a5000210 bin: Don't special-case G_SIGNAL_RUN_CLEANUP stage in latency signal accumulator
This signal don't run the class handler in the CLEANUP stage.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/776>
2021-03-26 14:12:03 +00:00
Aaron Boxer d7d12f6aaa gst: enforce gst_deinit one call per process
unit tests do not need to call deinit as it is already called in exit handler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/236>
2021-03-24 21:14:22 +00:00
Aaron Boxer 2e0a21c9c2 gst: disable indent for parse_goption_arg
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/236>
2021-03-24 21:14:22 +00:00
Stéphane Cerveau 178c7d2732 device provider: add custom register macro
This macro allows to register a device provider with
a custom function which gives more flexibility when
registering it (see v4l2 register).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/773>
2021-03-19 10:15:49 +00:00
Matthew Waters 3d887c7f07 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/775>
2021-03-19 04:15:19 +00:00
Seungha Yang 69e6cd773a clocksync: Add a new property "sync-to-first" for automatic ts-offset setup
Add a new property so that clocksync can setup "ts-offset" value
based on the first buffer and pipeline's running time when the
first arrived. Newly update "ts-offset" in this case would be
a value that allows outputting the first buffer without clock waiting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/702>
2021-03-18 14:22:44 +00:00
Olivier Crête c6a98609e5 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/771>
2021-03-17 14:13:27 +00:00
Mathieu Duponchelle 12661d90a3 value: fix parsing of explicit value casts
Since acdb4ce03d , parsing of the
value for a property can use the pspec to determine what type
a value should be casted to.

However, this broke the case where the value is explicitly casted
to a type (eg <(float) 0.0>). In that situation, we want to respect
the casting decision, and only use the pspec to perform "implicit"
casts.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/772>
2021-03-17 14:11:39 +01:00
Guillaume Desmottes 44bdad58f6 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/769>
2021-03-11 15:41:16 +01:00
Stéphane Cerveau 0da1721364 element: remove useless ret test
The ret test is unrelevant and confusing.
We dont want the code to fail and the register
to succeed by example.
In the case of a conditional element_init,
the element should be defined with
GST_ELEMENT_REGISTER_DEFINE_CUSTOM instead
of GST_ELEMENT_REGISTER_DEFINE_WITH_CODE.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/768>
2021-03-08 16:37:31 +01:00
Stéphane Cerveau d093b2894b bash-completion: various bash fixes
-d tests the folder which is existing but with .in file, so I prefered
the -f to test if the gst file was available which is not the case, so
it fallbacks on the pkg-config

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/766>
2021-03-03 09:43:36 +01:00
Stéphane Cerveau a4b5d8bb60 meson: add uninstalled var for bash-completion
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/766>
2021-02-26 11:18:54 +01:00
Guillaume Desmottes 3e27558095 miniobject: add GST_TYPE_MINI_OBJECT
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/764>
2021-02-24 13:13:07 +01:00
Mathieu Duponchelle 670596abdb docs: standardize debugutils documentation
* add a SECTION comment

* Misc cleanup / typo fixes / addition of links

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/760>
2021-02-17 18:36:22 +01:00
Mathieu Duponchelle d7e2861398 docs: standardize GstControlSource, GstDateTime documentation
* Don't repeat what annotations are stating with respect to ownership
  transfer, nullability

* Misc cleanup / typo fixes / addition of links

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/759>
2021-02-16 17:05:16 +00:00
Mathieu Duponchelle f1f226f811 Revert "baseparse: always use incoming DTS"
This reverts commit fc5cd9591a.
2021-02-16 17:13:02 +01:00
Mathieu Duponchelle 45d11f6590 docs: standardize GstContext, GstControlBinding documentation
* Document virtual methods in standalone comments, in order to properly
  annotate them

* Don't repeat what annotations are stating with respect to ownership
  transfer, nullability

* Mark GstControlBinding ABI field as private

* Misc cleanup / typo fixes / addition of links

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/758>
2021-02-15 15:27:14 +01:00
Mathieu Duponchelle d5ae9f293a docs: standardize GstClock documentation
* Don't mention explicitly that API is MT safe, this implies that
  other API is not. GStreamer API is assumed to be MT safe, thread
  safety should only be explicitly mentioned when API is *not* MT safe

* Don't repeat what annotations are stating with respect to ownership
  transfer, nullability

* Document virtual methods in standalone comments, so that parameters
  can be documented. This is not critical here, as parameters do not
  need annotations / specific documentation, but serves as an up to
  date example

* Document enumeration members in standalone comments, so that their
  Since tag is accounted for by gobject-introspection

* Misc cleanup / typo fixes / addition of links

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/756>
2021-02-15 13:44:48 +00:00
Stéphane Cerveau 3952e19c2a features: remove extra G_BEGIN_DECLS/G_END_DECLS
_GST_ELEMENT_REGISTER_DEFINE_BEGIN
_GST_ELEMENT_REGISTER_DEFINE_END was introducing
an extra extern "C" in case of c++ build.

Add missing ";" in GST_ELEMENT_REGISTER_DECLARE

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/757>
2021-02-15 12:21:49 +01:00
Mathieu Duponchelle c53ea138c6 docs: standardize GstCapsFeatures, GstChildProxy documentation
* Don't mention explicitly that API is MT safe, this implies that
  other API is not. GStreamer API is assumed to be MT safe, thread
  safety should only be explicitly mentioned when API is *not* MT safe

* Document virtual methods in standalone comments, in order to properly
  annotate them

* Don't repeat what annotations are stating with respect to ownership
  transfer, nullability

* Misc cleanup / typo fixes / addition of links

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/755>
2021-02-11 16:43:14 +01:00