Commit graph

1129 commits

Author SHA1 Message Date
Philippe Normand
892bea99cd encodebasebin: Fix parser selection
If an encoder supports multiple codecs (a bin wrapping/auto-plugging encoders)
then its src pad template caps might list the supported codecs. Without this
patch the selected parser would be the one corresponding to the first codec,
leading to caps negotiation error later on. The proposed fix is to check the
media type on the parser candidates sink pad templates according to the
requested encoded format.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7756>
2024-10-26 11:56:23 +01:00
Philippe Normand
31a697dd06 encodebasebin: Fix parser cleanup
When removing the parser from the stream group, it might not be linked to a
combiner so this needs to be checked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7756>
2024-10-26 11:56:23 +01:00
James Cowgill
8131c3eb1d exiftag: Check the result of gst_date_time_new_local_time
Fixes a critical warning when parsing a JPEG containing a malformed
`DateTime` tag (like `0000:00:00 00:00:00`).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7713>
2024-10-23 09:19:18 +00:00
Nicolas Dufresne
6604421cba glcontext: egl: Unrestrict the support base DRM formats
There is no requirement for a base DRM format to be supported by libgstvideo
in order to be uploaded to. Don't limite to DRM fourcc that have a libgstvideo
format mapping. This notably enabled AFBC support, which uses an opaque based
format that does not have a linear definition. This also adds R8/RG88 and
simimlar other formats that are not yet mapped in libgstvideo.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7699>
2024-10-20 10:37:49 +00:00
Edward Hervey
b36d8de28c urisourcebin: Don't remove probe if not present
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Edward Hervey
1e6506cc09 urisourcebin: Set pad probe before linking pad
We want to grab all events that pass through, so we need to set the
probe **before** the pad is linked

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Edward Hervey
15b8a05d1a urisourcebin: Streamline event forwarding code
Instead of two different functions for copying events and rewriting the
stream-start event, just have a single one.

This is needed, since we want to do both of those in one go, with the pad lock
taken.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Edward Hervey
cb00dd3ba6 parsebin: Set stream collection on pad before exposing it
We want to ensure the stream-collection is present on the pad (as a sticky
event) before we expose the pad.

This is more reliable since it will ensure it is present before any other event
is pushed through.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Edward Hervey
f197bc01a2 uridecodebin3: Use lock when checking input/output items
Otherwise there is the risk that the play items list could have changed in
between

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Edward Hervey
a92f4be40c decodebin3: Free pending events on input pads when unlinking
Otherwise we could end up with *old* events leaking through on the next linking.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7682>
2024-10-18 10:13:13 +00:00
Mathieu Duponchelle
8be82ad9e5 audioconvert: fix setting of mix matrix at run time
There were two main issues:

The mix matrix was not protected with the object lock

The code was mistakenly assuming that after updating the mix matrix
a reconfigure event sent upstream would be enough to cause upstream to
send caps again, and the converter was only reconstructed in ->set_caps.

That was not actually enough, as if the new matrix didn't affect the
number of input / output channels there was no reason for upstream to do
anything after getting the unchanged caps.

The fix for this was to have ->transform also recreate the converter
when needed, with the added subtlety that depending on the mix matrix
the element could be set to passthrough. This means that when setting
the mix matrix the converter also had to be recreated immediately to
check if the element had to be switched back to non-passthrough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7399>
2024-10-17 10:44:53 +00:00
Nirbheek Chauhan
279fbb2ca2 Revert "meson: Fix invalid include flag in uninstalled gl pc file"
This reverts commit 9d719b9937.

The old pkg-config implementation errors out if a variable specified
in the pkgconfig file is not defined, so this actually broke
uninstalled pc files.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7606>
2024-10-03 12:05:42 +01:00
Théo Maillart
1d86761712 decodebin3: do not attempt to remove a null stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Théo Maillart
bb05e78349 decodebin3: protect internal reset with SELECTION_LOCK
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Théo Maillart
3b6f6073e4 decodebin3: remove output event probe on remove input stream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7605>
2024-10-03 09:42:03 +00:00
Edward Hervey
94c393341c urisourcebin: Ensure all stream-start are handled
In order to ensure all initial events (stream-start, caps, ..) are present on
pads that we expose, those various sticky events are propagated (from parsebin
to multiqueue output, from multiqueue output to exposed pads).

The problem was that the "hack" in `urisourcebin` to inform downstream elements
that the stream is parsed data and a collection will be present was only done in
one place : a probe on the output of parsebin ... but the stream-start could
potentially have already been propagated to the output pads before that.

In order to fix that, we make sure any pending sticky stream-start event is
updated before being propagated.

Fixes #3788

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7604>
2024-10-03 00:56:25 +00:00
Edward Hervey
7e438dfaa7 urisourcebin: Allow more cases for posting stream-collection
Previously urisourcebin only allows stream-collections messages from adaptive
demuxers or sources to be posted.

This commit also allows the case where they come from a single parsebin. We
still want to prevent it in the case where they are multiple parsebins, since
that would require some form of aggregation to show a single/unified collection.

In order to avoid a regression with uridecodebin3 behavior, we also implement
support for GST_QUERY_SELECTABLE, so that uridecodebin3 can figure out whether
it should let GST_MESSAGE_STREAM_COLLECTION flow upwards (because app/user could
react on it) or whether it drops it in order for decodebin3 to do the collection
aggregation and posting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7603>
2024-10-02 23:04:42 +00:00
Edward Hervey
9eacd54847 decodebin3: Make update/posting of collection messages atomic
The presence (or not) of a collection on an input will determine whether events
will be throttled so that there are only forwarded when that input gets a valid
collection.

Therefore the input lock should be used.

In addition to that, we want to ensure that the application/user has a chance to
reliably (i.e. synchronously) specify what streams it is interested in by
sending a GST_EVENT_SELECT_STREAMS.

But we cannot allow anything to go forward until that message posting has come
back, otherwise we run in various races.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7602>
2024-10-02 23:06:07 +01:00
Elliot Chen
f805aa2d60 decodebin3: check and send selected stream message even if no decoder is selected
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7601>
2024-10-02 12:59:54 +01:00
Nicolas Dufresne
b17f22bc68 allocators: drmdump: Add NV15 supports
This is a packed version of P010, names NV14_10LE40 in GStreamer. This
format is used on all Rockchip SoC variants.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7596>
2024-10-01 17:32:31 +00:00
Nicolas Dufresne
a0da8c6b53 allocators: drmdumb: Fix bpp value for P010
P010 uses 16 bits per pixel, with least significant being padding. This
code worked with Intel display driver since they roundup that value, but
does not work with the generic DRM helpers which also support NV15,
which does not have any padding.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7596>
2024-10-01 17:32:31 +00:00
Jakub Adam
1250f6fc7e gldownload: use gst_gl_sync_meta_wait_cpu()
Simple gst_gl_sync_meta_wait() is not sufficient to ensure GL commands
are executed before dma-buf devices get to see the buffer.

This is the first step that should make the code behave correctly for
everybody, although there may be performance penalty. In the future we
should introduce a more general sync meta that would allow to move the
waiting from gldownload (the producer) to the sink elements (the
consumers).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7595>
2024-10-01 17:12:37 +01:00
Tim-Philipp Müller
29b77fb2df Back to development after 1.24.8
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7549>
2024-09-19 12:12:53 +02:00
Tim-Philipp Müller
c396e7da4c Release 1.24.8 2024-09-19 12:01:21 +02:00
Edward Hervey
ca33e15de9 encodebin: Fix pad removal for encodebin vs encodebin2
Clarify the fact that `encodebasebin->src_pad` is set when using a static source
pad (`encodebin`) and when not set it's dynamically added source
pads (`encodebin2`).

Fixes usage of encodebin2 when profiles are updated

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7523>
2024-09-15 19:55:23 +01:00
Sebastian Dröge
ca23c3c762 video: Don't overshoot QoS earliest time by a factor of 2
By setting the earliest time to timestamp + 2 * diff there would be a difference
of 1 * diff between the current clock time and the earliest time the element
would let through in the future. If e.g. a frame is arriving 30s late at the
sink, then not just all frames up to that point would be dropped but also 30s of
frames after the current clock time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7518>
2024-09-13 23:04:43 +01:00
Carlos Bentzen
eea3df38fc meson: gst-play: link to libm
gst-play.c depends on libm due to using `round`.
Passing by, correct identation of `gst_tools` definition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7501>
2024-09-11 10:33:09 +01:00
Chao Guo
01ab04a0b4 glimagesink: resize viewport when video size changed in caps
When re-negotiation happends and caps is changed, resize the
viewport to the corresponding video size in changed caps.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7450>
2024-09-08 12:06:32 +00:00
Edward Hervey
2bd45e8fd2 decodebin3: Fix collection identity check
Collections can be auto-generated from upstream and yet have exactly the same
streams in it.

Therefore do a more in-depth check for equality.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7402>
2024-08-22 11:23:12 +01:00
Tim-Philipp Müller
29b51fb13d Back to development after 1.24.7 2024-08-21 12:33:28 +01:00
Tim-Philipp Müller
0f1e984e41 Release 1.24.7 2024-08-21 12:25:15 +01:00
Edward Hervey
bfcd23db61 urisourcebin: Actually drop EOS on old-school pad switch
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7376>
2024-08-19 10:40:07 +01:00
Edward Hervey
97461dc47d urisourcebin: Don't hold lock when emitting about-to-finish
This could trigger actions that re-enter this element

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7373>
2024-08-17 10:17:06 +01:00
Víctor Manuel Jáquez Leal
68913e0a56 pbutils: descriptions: use subsampling factor to get YUV subsampling
The algorithm used to determine the YUV subsampling string uses width and height
subsampling factor, not the raw subsampling. Otherwise all 4:2:0 YUV frames will
be detected as 4:4:4

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7359>
2024-08-15 01:06:48 +00:00
Max Romanov
8aa5a9520c rtspconnection: Handle invalid argument properly
In case when conn->input_stream is NULL and glib was built with
"glib_checks" enabled, g_pollable_input_stream_read_nonblocking()
returns -1, but does not set the "err".

The call stack:
  read_bytes() ->
    fill_bytes() ->
      fill_raw_bytes()

The return value -1 passed up to read_bytes() and incorrectly
processed there after "error:" label.

This changes the return value to EINVAL.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7309>
2024-08-06 09:32:13 +01:00
Nicolas Dufresne
12283d9d97 xv: imagepool: Improve error logging
The shm creation function can return a GError, use this to improve the error
reporting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7292>
2024-08-05 08:32:24 +00:00
Nicolas Dufresne
15bed85173 xvimagesink: Fix crash in pool on error
The set_config() virtual function is not support to free the config. As a side
effect, when there is protocol error of some sort, we endup with a crash.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7292>
2024-08-05 08:32:24 +00:00
Nicolas Dufresne
487e41b815 glframebuffer: Improve error tracing
glCheckFrameStatus() can fail by returning 0, and otherwise return a
status. Fix the trace to make it clear when we get an unkown status
compare to having an error, in which case we also trace the error code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7295>
2024-08-02 14:57:32 +01:00
Tim-Philipp Müller
ad0cc551e1 Back to development after 1.24.6 2024-07-29 16:48:02 +01:00
Tim-Philipp Müller
8d175ea255 Release 1.24.6 2024-07-29 16:41:37 +01:00
Philippe Normand
14ca30a014 parsebin: accept-caps handling for elements with unusual pad names
In case the last element of the parse chain doesn´t have a sink pad named
"sink", send the accept-caps query to the first sink pad of the element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7257>
2024-07-29 14:26:19 +01:00
Shengqi Yu
65327c1a8c videoscale: correct classification error
videoscale does not have convert function, so remove the convert
description in it's classification. Otherwise, if we want use
autovideoconvert to convert colorsapce, autovideoconvert will select
videoscale to do convert and this will cause to fail.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7235>
2024-07-25 16:43:34 +00:00
Nirbheek Chauhan
4a14196f28 glvideomixer: Fix critical when setting start-time-selection
It caused a critical, but did not affect functionality because the
GValue was passed as-is to the glvideomixerelement which actually does
something with the property.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7207>
2024-07-20 10:03:40 +01:00
Jakub Adam
d56f601b48 gstvideoaggregator: preserve features in non-alpha caps
Fixes caps negotiation when sink template caps of an element inheriting
GstVideoAggregator have features different from the implicit
"memory:SystemMemory".

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7198>
2024-07-18 16:14:34 +01:00
Sebastian Dröge
b19a687437 typefind: Add typefinders for formats that were previously available via ffmpeg
Co-Authored-By: Matthew Waters <matthew@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7148>
2024-07-08 16:25:32 +00:00
Nirbheek Chauhan
a9fec8f638 meson: Fix invalid include flag in uninstalled gl pc file
${libdir}/gstreamer-1.0/include is only valid after installation, but
extra_cflags are added unconditionally, so we can't use that for
include flags.

Instead, let's add the include flag via variables, which are different
for installed and uninstalled pc files.

This is particularly bad for consuming GStreamer via CMake which barfs
on non-existent include paths.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7143>
2024-07-05 18:43:27 +01:00
Tim-Philipp Müller
24de7cf1fe subparse: remove regex optimized flag explicitly
That way the other flags in jit_flags are not touched and
flags changes in future only need to be done in one place.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7129>
2024-07-03 12:22:18 +01:00
Tim-Philipp Müller
051b8b6dbb gst-plugins-base: put valgrind header availability define into config.h for subparse
Make the valgrind header avaibility accessible to any code in
gst-plugins-base, currently it was only signalled to unit tests.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7129>
2024-07-03 12:22:18 +01:00
Edward Hervey
bad0daeb8f subparse: Don't use jitted regex when used with valgrind
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7124>
2024-07-02 11:04:01 +00:00
Edward Hervey
00903e36cb encoding-target: Chain up to parent class
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7123>
2024-07-02 10:10:45 +01:00