Commit graph

91 commits

Author SHA1 Message Date
Thibault Saunier b14e675a27 gir: Checkout all .gir files and check that they are updated on the CI
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3010>
2023-04-22 09:32:32 -04:00
badcel acb913a878 base: adapter: Explicitly mark size parameter as input
The generated gir file marks the size parameter as "out" by default.
This is wrong in the context of a caller allocated buffer with a given size.
Explicitly marking the size parameter as (in) fixes the issue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4399>
2023-04-18 08:41:46 +00:00
Sebastian Dröge 6378ebbdcd ptp-helper: Add a feature option for the PTP support
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410>
2023-04-13 12:43:25 +00:00
Sebastian Dröge 2e84603b02 ptp-helper: Convert various meson message() to warning()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410>
2023-04-13 12:43:25 +00:00
Sebastian Dröge 7cba04f2c6 ptp-helper: Don't check for a Rust compiler on unsupported platforms
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410>
2023-04-13 12:43:25 +00:00
Sebastian Dröge b35d598003 ptp-helper: Check for the required Rust toolchain version via meson
If an older version is found that gives a more useful output than a
compiler error at a later time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4410>
2023-04-13 12:43:25 +00:00
Edward Hervey 0fa3c5c561 typefindhelper: Avoid dead assignment
Move variables within the loop (where they are actually used)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4387>
2023-04-11 07:23:48 +02:00
Sebastian Dröge 9d25a5075e ptp-helper: Set a process priority / nice value of -5 on UNIX platforms
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889>
2023-04-07 15:49:02 +00:00
Sebastian Dröge 572d344482 ptp-helper: Set thread priority to time-critical on Windows
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889>
2023-04-07 15:49:02 +00:00
Sebastian Dröge 3fdfcdf2f6 ptp-helper: Rewrite in Rust for portability and security
This works on Linux, Android, Windows, macOS, FreeBSD, NetBSD, OpenBSD,
DragonFlyBSD, Solaris and Illumos.
Newly supported compared to the C version is Windows.

Compared to the C version various error paths are handled more correctly
and a couple of memory leaks are fixed. Otherwise it should work identically.

The minimum required Rust version for compiling this is 1.48, i.e. the
version currently in Debian stable. On Windows, Rust 1.54 is needed at
least.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3889>
2023-04-07 15:49:02 +00:00
Guillaume Desmottes 7b41db3ab6 basesrc: add gst_base_src_push_segment()
gst_base_src_new_segment() does not send the segment right away, which
may break events ordering if subclass sends other events after
calling it.
Introducing a variant pushing the segment right away to preserve
ordering in such cases.

Will be used by appsrc which has its own internal queue where we need to
preserve events order.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4297>
2023-04-05 11:11:46 +00:00
Tim-Philipp Müller 574e6b7994 gstreamer: re-indent with GNU indent 2.2.12
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4182>
2023-03-17 03:18:53 +00:00
Nicolas Dufresne 5c256cffa6 basesink: Add GST_BASE_SINK_FLOW_DROPPED return value
This new flow return value can be used in ::render virtual method
to signal that a frame is not being rendered.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3801>
2023-03-14 21:50:57 +00:00
Alicia Boya García 0f8785cbc6 basesink: Support position queries after non-resetting flushes
A flush is resetting or not depending on the reset_time argument in the
FLUSH_STOP event is set.

Resetting flushes reset the running time to zero and clear any existing
segment. These are the kind of flushes used by flushing seeks, and by far the
most common. Non-resetting flushes are much more niche, used for instance for
quality changes in adaptivedemux2 and MediaSource Extensions in WebKit.

A key difference between the seek use case and the quality change use case is
that the latter is much more removed from the player. Seeks generally occur
because an user request it, whereas quality changes can be automatic.

Currently, there are three notable cases where position queries fail:

(a) before pre-roll, as there is no segment yet. This is one is understandable,
as for at least some time before pre-roll, we cannot know if a media stream
would start at 0 or any other position, or the duration of the stream for that
matter.

(b) after a resetting flush caused by a seek. This kind of flush resets the
segment, so it's not surprising position queries fail. This is inconvenient for
applications, as it means they always need to handle position reporting (e.g.
in UI) separately every time they request a seek, e.g. by caching the seek
target and using it when the position query fail. I'm not fond of this
behavior, as it's unintuitive and makes GStreamer harder to use, but at this
point could be difficult to change and it's not within the scope of this
proposal.

(c) after a non-resetting flush, e.g. caused by a quality change. The segment
is not reset in this case. Position queries work until a FLUSH_STOP is sent.
Querying position after a FLUSH_START but before a FLUSH_STOP works, and
returns the position the sink was at the moment the FLUSH_START was received.
**This in fact the only reliable way (short of adding probes to the sink
element) to get this position**, as FLUSH_START receival is asynchronous with
playback.

In the case (c), as of currently, position queries fail once the FLUSH_STOP is
received. But unlike in (b), the application has no position to fall back to,
as the FLUSH_START was initiated by elements inside the pipeline that are in a
lower layer of abstraction. Specific applications that have control of both the
player and the internal element doing the flushing -- such as WebKit -- can
still work around this problem through layer violations (lucky!), but this
still puts in question this behavior in GStreamer.

This patch fixes this case by amending the position query handler of basesink,
which was previously erroneously returning early with "wrong state", even
though the flush occurs in PAUSED or PLAYING.

A unit test checking this behavior has also been added.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3471>
2023-03-03 10:16:25 +00:00
Mathieu Duponchelle f3e16deaad aggregator: improve parsing in create_new_pad
The previous implementation was a bit primitive, assuming the subclass
had registered a template name starting with sink_ . Instead make
the effort of parsing the actual template name, and use that to generate
the final pad name.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4032>
2023-02-28 17:43:57 +00:00
Sebastian Dröge 716aaa562b net: ptp: Use GSubprocess instead of lower-level GLib APIs that don't work on Windows
libgstnet depends on GIO already anyway so we can as well make use of it
instead of a half-baked Windows implementation that doesn't actually
work.

As a next step, the helper process also needs to be made usable on
Windows.

See https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1259

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3887>
2023-02-03 18:51:17 +00:00
Mathieu Duponchelle 4d240c27b7 BaseSrc: fix transfer annotation for fixate virtual method
The fixate virtual method has the same semantics as gst_caps_fixate(),
so the caps parameter must be marked as (transfer full).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3830>
2023-01-28 03:48:21 +00:00
Mathieu Duponchelle c8298a2787 BaseSrc, PushSrc: add nullable annotations to virtual methods
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3806>
2023-01-26 22:35:31 +00:00
Jan Alexander Steffens (heftig) e3fa65abab aggregator: Warn about the right segment's format
We were checking the head segment here, not the current segment.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/611>
2023-01-26 10:39:08 +01:00
Jan Alexander Steffens (heftig) 08d4b0051a aggregator: Always lock aggpad around update_time_level
`aggpad->segment` is protected by the `aggpad`'s object lock. We need to
take the lock before calling `update_time_level`.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/611>
2023-01-26 10:39:08 +01:00
Seungha Yang 621feb32e9 gst-plugin-scanner: Add support for Windows
Adding Win32 specific plugin loader implementation.

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/11
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3512>
2023-01-25 18:24:28 +00:00
Tim-Philipp Müller 45aac1e938 base: bitwriter: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller 78149326c9 libs: base: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller 1919030363 baseparse: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller ba6d952cd5 gstcheck: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Tim-Philipp Müller bda6287075 controller: drop use of GSlice
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
2023-01-24 15:25:06 +00:00
Alicia Boya García 2c2767b94a Use automatic pad activation in elements that can take advantage of it
Pads are activated automatically when they are added if the element
state is >=PAUSED, so it's not necessary to activate them manually
anymore.

This patch removes manual pad activation from gstaggregator, gstconcat,
gstfunnel, and gstinputselector.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3636>
2023-01-24 14:42:35 +00:00
Xavier Claessens cd78cbac86 Fix API visibility macros
This copies the logic from GLib discussed there:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2936

Beside being simpler, it also fix all public symbols being annotated
with dllexport when doing a static build, as discovered there:
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3540#note_1678335

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3567>
2022-12-20 14:03:35 +00:00
Mathieu Duponchelle f8b732563b basesrc: respect FIXED_CAPS flag in caps query implementation
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3590>
2022-12-17 12:04:49 +00:00
Mathieu Duponchelle b5cd758230 aggregator: Implement force_live API
Setting force_live lets aggregator behave as if it had at least one of
its sinks connected to a live source, which should let us get rid of the
fake live test source hack that is probably present in dozens of
applications by now.

+ Expose API for subclasses to set and get force_live
+ Expose force-live properties in GstVideoAggregator and GstAudioAggregator
+ Adds a simple test

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3008>
2022-11-18 18:14:26 +00:00
Sebastian Dröge 72c5105312 typefindhelper: Fix docs/annotations for the new functions
Follow-up for https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3418>
2022-11-16 04:07:09 +00:00
Sanchayan Maity 30841dae99 typefindhelper: Use the new GstTypeFind * API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 89da632219 typefindhelper: Introduce a new API for working with a GstTypeFind *
Introduce a new API that can return a GstTypeFind * with helper functions
and data set around buffer data.

While at it, drop factory field from GstTypeFindBufHelper. While it was
useful for logging, it was not passed through function arguments and keeping
it for logging would require an additional API increasing the API surface
and making it harder to use.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 036b77b519 typefindhelper: Add helpers to improve type finding given the caps
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sanchayan Maity 58f7d88585 typefindhelper: Update annotation for function parameters
Fix the nullable/optional situation. allow-none is deprecated and
replaced by either or both of the others.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3296>
2022-11-15 14:05:40 +00:00
Sebastian Dröge c878d0f68b core/base: Only post latency messages if the latency values have actually changed
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1525

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3282>
2022-10-27 15:25:22 +00:00
Sebastian Dröge 366893e9ac Fix various warnings from gobject-introspection
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3261>
2022-10-25 09:45:25 +03:00
Sebastian Dröge fee144bca5 net: Add missing nullable annotation on the name parameter in the net/NTP clock constructors
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3249>
2022-10-22 15:59:16 +00:00
Sebastian Dröge 0a513e9168 check: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 3e7f684609 net: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 07f8c012c7 base: Add/fix annotations in GstQueueArray
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Sebastian Dröge 2ede719b4b controller: Add/fix various annotations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>
2022-10-18 08:56:58 +00:00
Guillaume Desmottes 2df2dfce55 aggregator: fix input buffering
We need to be able to buffer at least the aggregator latency +
upstream latency, which is the value used to compute the aggregator
deadline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3138>
2022-10-07 16:27:51 +02:00
Philipp Zabel 3b900e1fa4 buffer: drop parent meta in deep copy/foreach_metadata
The purpose of a deep buffer copy is to be able to release the source
buffer and all its dependencies. Attaching the parent buffer meta to
the newly created deep copy needlessly keeps holding a reference to the
parent buffer.

The issue this solves is the fact you need to allocate more
buffers, as you have free buffers being held for no reason. In the good
cases it will use more memory, in the bad case it will stall your
pipeline (since codecs often need a minimum number of buffers to
actually work).

Fixes #283

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2928>
2022-09-28 12:34:44 -06:00
Edward Hervey b2701418d7 basetransform: Avoid useless codepath
If QoS is disabled, skip the whole computation (avoids calculating values which
won't be needed)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3034>
2022-09-22 13:45:50 +00:00
Xavier Claessens 5f0493d33a meson: Set install_tag on some targets
Trying to follow recommendation from Meson documentation:
https://mesonbuild.com/Installing.html#installation-tags

Move tools into 'bin' or 'bin-devel' categories to keep only libs and
plugins in the default 'runtime' category. This simplifies distribution
of GStreamer application skipping parts that are not needed, similarly
to what Cerbero does by hardcoding huge list of files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3017>
2022-09-20 10:08:15 +00:00
Edward Hervey 7a5846d69d baseparse: If available, return average bitrate upstream
Helps improve queue2 buffering for single stream playback (ex: FLAC or mp3)

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3033>
2022-09-16 16:12:03 +00:00
Thibault Saunier bc9c1e3956 meson: Namespace the plugins_doc_dep/libraries variables
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2970>
2022-09-01 21:17:35 +00:00
Sebastian Dröge d9bd870db4 aggregator: Improve debug output to better understand why pads are not ready or can't accept more data
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2907>
2022-08-17 19:06:35 +00:00
Rafael Sobral e9a642feb8 aggregator: fix reversed active/flushing arguments in debug log output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2813>
2022-08-01 23:03:59 +01:00