Commit graph

651 commits

Author SHA1 Message Date
Alan Coopersmith
9c0fbfd2eb gstreamer: netclock-replay: use gst_c_args when building
Need HAVE_CONFIG_H to avoid build failure on Solaris 11.4 with gcc 14.1:

../subprojects/gstreamer/tests/misc/../../libs/gst/net/gstnetutils.c:71:7:
 error: implicit declaration of function ‘setsockopt’
 [-Wimplicit-function-declaration]
   71 |   if (setsockopt (fd, IPPROTO_IP, IP_TOS, &tos, sizeof (tos)) < 0) {
      |       ^~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7553>
2024-09-20 06:20:15 +00:00
Sebastian Dröge
37ef85f268 aggregator: Add gst_aggregator_push_src_event()
This ensures that any pending events are pushed before pushing the new event.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7542>
2024-09-19 17:08:45 +03:00
Sebastian Dröge
075a81b44f aggregator: Remove unused tag handling code
If this becomes API it would now have to be implemented differently because
various elements are implementing tag handling themselves now and this would
conflict.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7542>
2024-09-19 16:12:14 +03:00
Peter Kjellerstedt
0db32b3b3a meta: Add missing include of gststructure.h
This avoids the following error when only including gstmeta.h:

  /usr/include/gstreamer-1.0/gst/gstmeta.h:146:3: error: unknown type
  name 'GstStructure'
    146 |   GstStructure *structure;
        |   ^~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7520>
2024-09-16 06:58:08 +00:00
Sebastian Dröge
03d2b28559 aggregator: Immediately return NONE from simple_get_next_time() on non-TIME segments
Otherwise this gives critical warnings.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7511>
2024-09-13 12:23:52 +03:00
Arun Raghavan
f30321538b pad: Check data NULL-ness when probes are stopped
We were correctly handling this for buffers, but not events and queries.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7493>
2024-09-12 05:47:16 +00:00
Sebastian Dröge
e5133033fa clock: Use external / internal as term for the two clock bases everywhere
It was confusing that some functions were using master for the external time and
slave for the internal time. This is not consistently using external / internal
when talking about concrete clock times.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7456>
2024-09-08 11:42:38 +01:00
Sebastian Dröge
f463d4c3c1 clock: Use nullable / optional annotations instead of ambiguous allow-none
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7456>
2024-09-08 09:54:56 +00:00
Tim-Philipp Müller
6031f9ece1 gstreamer: use g_sort_array() instead of deprecated g_qsort_with_data()
Fixes compiler warnings with the latest GLib versions.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4127

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7384>
2024-09-02 22:31:34 +00:00
Sebastian Dröge
55994477a7 bus: Switch from GstAtomicQueue to GstVecDeque
All accesses to it were protected either by a mutex already, or at least
used yet another mutex for gst_poll_read_control() / gst_poll_write_control().

The usage of GstPoll has to stay for backwards compatibility as it is
used to manage the (public) fd that can be used to wait for the bus to
be ready, but this switch at least simplifies the implementation a bit
and results in fewer atomic operations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6684>
2024-09-02 09:26:23 +00:00
Sebastian Dröge
8e589eec08 bufferpool: Switch from GstAtomicQueue to GstVecDeque and a mutex/cond
While the atomic queue itself is lock-free, all its usage had to be
synchronized externally via a GstPoll and gst_poll_read_control() /
gst_poll_write_control(). Both functions were always taking a mutex
internally since cd06aea1, so the implementation was just very
complicated but not lock-free at all.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6684>
2024-09-02 09:26:23 +00:00
Sebastian Dröge
3c7ddf902a structure: Remove quadratic behaviour from gst_structure_fixate()
It was iterating over each field and after fixating its value was again
iterating over every field to find where to store the value.

Instead directly overwrite the value after validating it.

Also actually check that the structure is writable before modifying its fields
by using gst_structure_map_in_place() instead of gst_structure_fixate().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7420>
2024-09-02 07:32:16 +00:00
Sebastian Dröge
8b0ae3ba87 clock: Fix calculation for number of bits needed to store a 64 bit value
It was using log2(n) but what actually is needed is log2(n) + 1. Also add a
fast-path that uses __builtin_clzll() on gcc/clang.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7406>
2024-08-29 10:55:35 +00:00
Sebastian Dröge
41f3fab3d4 clock: Fix unchecked overflows in linear regression code
The initial calculation for the precision shift was wrong and would allow for
overflows during the calculations which were not detected and lead to wrong
results.

Also add a test for a case where overflows where previously not detected and
caused a completely wrong result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7406>
2024-08-29 10:55:35 +00:00
Daniel Morin
4106ad4ae6 doc: correct delimiters documentation
- "<>" are delimiters for GST_TYPE_ARRAY and "{}" are delimiters for
  GST_TYPE_LIST.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7419>
2024-08-29 00:00:43 +00:00
Edward Hervey
8da2ea6fa1 gstreamer: Make dlopen leak suppression more generic
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7415>
2024-08-28 06:54:02 +00:00
Jan Schmidt
807dbfbebf check: Add fail_unless_matches_string() and assert macros
Add string check macros for checking expected strings against
a regular expression instead of just a direct literal match
as provided by the existing fail_unless_equals_string()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7365>
2024-08-16 14:18:35 +00:00
Jan Schmidt
e76581fe93 core: Log pad name, not just the pointer
Change a debug statement that was just logging a pad pointer where
it could log the pad name more usefully.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6943>
2024-08-12 12:38:44 +05:30
Sebastian Dröge
9bbb7accb3 bin: Don't keep the object lock while setting a GstContext when handling NEED_CONTEXT
This can potentially deadlock.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7305>
2024-08-06 07:00:29 +00:00
Jan Schmidt
7bd51afd04 gsturi: Ensure file:// URIs retain //
Add the // back after the scheme for file URIs so 'file:///path/to/file'
doesn't become 'file:/path/to/file' in gst_uri_to_string()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6969>
2024-07-30 00:06:50 +00:00
L. E. Segovia
5929829131 gst: clock: Move Android OS check to the __ANDROID__ macro
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6510>
2024-07-17 22:33:52 +00:00
Guillaume Desmottes
3b47b87038 downloadbuffer: send EOS in push mode
gst_download_buffer_read_buffer() returns FLOW_EOS but it was not
handled in the 'out_flushing' goto block which uses srcresult,
so EOS was not sent downstream.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7128>
2024-07-05 07:34:03 +00:00
Guillaume Desmottes
894bef7a1d downloadbuffer: initialize upstream_size when activated in push mode
Push mode flow relies on upstream_size but it was not initialized when
activated as it is when activated in pull mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7128>
2024-07-05 07:34:03 +00:00
Guillaume Desmottes
560d9b5b91 downloadbuffer: init upstream_size to -1
Code in check_upstream_size() is checking for -1 to check if
upstream_size has been set or not.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7128>
2024-07-05 07:34:03 +00:00
Guillaume Desmottes
523adcfb1d downloadbuffer: properly log when receiving events
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7128>
2024-07-05 07:34:03 +00:00
Tim-Philipp Müller
154b84649f info: remove unused valgrind header include
Follow-up to commit a2cbf75523.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7126>
2024-07-03 03:46:19 +00:00
Vivia Nikolaidou
331b37ac9a ptpclock: Fix typo in comments
s/continous/continuous/

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7121>
2024-07-02 00:08:28 +00:00
Edward Hervey
b2edab940a gstreamer/gst-tester: Don't leak thread
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7115>
2024-07-01 23:19:40 +00:00
Edward Hervey
61a8d4d43d gst-inspect: Fix leak of plugin/feature
Reordering changes the initial list head

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7115>
2024-07-01 23:19:39 +00:00
Xavier Claessens
84b3a0950d build: Add missing common options that are yielding in subprojects
- Align `glib_debug`, `glib_assert` and `glib_checks` options with GLib,
  otherwise glib subproject won't inherit their value. Previous names
  and values are preserved using Meson's deprecation mechanism.
- Add `extra-checks` and `benchmarks` options in the main project so it
  can be inherited in GStreamer subprojects.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1165>
2024-06-27 15:53:46 +00:00
Edward Hervey
a20569b1ba basesink: Remove field not used
It was never actually used since it was introduced as part of the commit
introducing support for instant rate

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7077>
2024-06-21 09:29:48 +02:00
Sebastian Dröge
8117ee4fa3 queue, queue2, multiqueue: Timestamps of gap events must be valid
This is checked in gst_event_new_gap() so doesn't have to be checked again here,
but simply can be asserted with a g_return_if_fail().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7071>
2024-06-20 20:02:43 +03:00
Sebastian Dröge
909cd6d865 queue: queue2: multiqueue: Don't work with segment.position if buffers have no timestamps
If the first buffers have no timestamp then the sink position would be
initialized to 0. The source pad might output this buffer, which would then
initialize the source position to 0 too.

Afterwards two buffers with a valid but huge timestamp might arrive before any
of them are output on the source pad. The first one would set the sink position
to a huge value, the second one would notice that the difference between the
huge value and 0 is certainly larger than max-size-time and consider the queue
as full.

Instead, simply don't update the times from buffers without timestamps and
assume whatever was set before is still valid, i.e. the buffer has the same
timestamp as the previous one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7071>
2024-06-20 20:02:43 +03:00
Seungha Yang
27662d5fb8 bufferpool: Clarify GstBufferPoolClass::start() usage
Make it clear that chaining up to the default implementation
is optional if subclasses do not want preallocation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6328>
2024-06-13 10:59:56 +00:00
Guillaume Desmottes
e2b1730398 typefindhelper: implement get_length on GstTypeFindBufHelper
Some typefind code may rely on gst_type_find_get_length() which was not
working when using the helper.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6937>
2024-06-07 10:00:56 +02:00
Edward Hervey
4f94749665 gstpromise: Don't use g_return_* for internal checks
If assertion/checks are disabled bad things will happen and the function won't
return as expected

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6993>
2024-06-05 18:47:05 +00:00
Martin Nordholts
5d2421b8c8 gst_debug: Add missing gst_debug_log_id_literal() dummy with gst_debug=false
E.g. gst_debug_log_literal() already has a dummy variant.
gst_debug_log_id_literal() is simply missing, which can
cause link errors for project using gstreamer with
gst_debug=false.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6972>
2024-06-01 07:30:34 +00:00
Samuel Thibault
31047b878f ptp-helper: Add GNU/Hurd support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6970>
2024-05-30 16:14:29 +00:00
Edward Hervey
1f4c1c18ca gstmessage: Allow retrieving and setting details on messages
This was only available on warning/error/info messages creator/parsers. These
new functions make it more generic and also add a writable variant for users who
want to add/extend the details

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6929>
2024-05-29 22:24:07 +00:00
Sebastian Dröge
529f2472b3 gstreamer: parse: Don't assume that child proxy child objects are GstObjects
The name is already passed via the signal parameters so it doesn't have
to be retrieved again via GstObject API, which would crash on other
GObjects. Child proxy child objects can be any kind of GObject and the
code here otherwise handles this correctly already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6938>
2024-05-29 05:33:03 +00:00
Sebastian Dröge
2a58e6de8f gstreamer: ptp-helper: Use u64 instead of c_ulong for ifa_flags on Solaris/Illumos
See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3553#note_2429400

Patch by Marcel Telka <marcel@telka.sk>.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6934>
2024-05-28 09:06:57 +03:00
Sebastian Dröge
a7908b05da info: Make gst_debug_print_object() and gst_debug_print_segment() public
It can be useful in custom logging code to easily get string
representations of all kinds of objects or a segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6820>
2024-05-27 17:08:03 +00:00
Sebastian Dröge
1c88b06912 gstreamer: ptp-helper: Use if_nametoindex and setsockopt on Solaris / Illumos too
Patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:26 +03:00
Sebastian Dröge
354623a246 gstreamer: ptp-helper: Don't import Context trait multiple times unnecessarily
This only affected the Solaris / Illumos code path.

Patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:21 +03:00
Sebastian Dröge
8bff6b4988 gstreamer: ptp-helper: Use c_ulong for ifa_flags on Solaris/Illumos
Based on a patch by Marcel Telka <marcel@telka.sk>.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:34:13 +03:00
Sebastian Dröge
1f12493787 gstreamer: Solaris/Illumos require linking to libnsl / libsocket for various socket APIs
Patch by Tim Mooney <Tim.Mooney@ndsu.edu> from OpenIndiana/oi-userland

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6925>
2024-05-26 12:33:50 +03:00
Sebastian Dröge
562cecaef4 clock: Fix 32 bit assertions in GST_TIME_TO_TIMEVAL and GST_TIME_TO_TIMESPEC
On various 32 bit systems, time_t is actually 64 bits while long is
still only 32 bits. The macro would wrongly trigger its assertion in
this case if a value with more than 68 years worth of seconds is
converted.

Examples are various newer 32 bit platforms and old ones that are
compiled with -D_TIME_BITS=64.

Also statically assert that time_t is either 32 or 64 bits. Other values
might need adjustments in the macro.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6869>
2024-05-24 09:27:01 +00:00
Sebastian Dröge
1a8e7aa92d bufferlist: get() is not actually nullable in its return value
Passing an out of bounds index is the only way to get a NULL buffer but
this causes an assertion so is not to be considered for the
annotations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6884>
2024-05-23 06:34:59 +00:00
Jordan Petridis
b7357fd316 tests/check: Avoid using "bool" for the variable name
Glib 2.82 will be aliasing [1] TRUE and FALSE to the C99
definitions, which means it will be including stdbool.h

As such, having variables named "bool" causes issues
since it conflicts with the symbol defined in stdbool.h

[1] https://gitlab.gnome.org/GNOME/glib/-/merge_requests/4001

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6893>
2024-05-21 19:15:36 +00:00
Seungha Yang
e56d3d3e07 filesrc: Don't abort on _get_osfhandle()
_get_osfhandle() expects valid fd and CRT will abort program
if given paramerter is invalid. The fd can be invalidated
in various way, file was deleted by other process after
we open a file. To avoid it, our own exception
handler must be installed so that _get_osfhandle() can return
INVALID_HANDLE_VALUE if fd is invalid.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6877>
2024-05-20 08:32:43 +00:00