4538 Commits

Author SHA1 Message Date
Sebastian Dröge
fbdd1aa800 dashsink: Make sure to use a non-NULL pad name when requesting a pad from splitmuxsink
If the caller passed in "audio_%u" instead of a concrete pad name into
gst_element_request_pad_simple() then the pad name will be NULL. In that case
use the pad template name for requesting the pad from splitmuxsink.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8697>
2025-03-27 02:36:30 +00:00
Jan Tojnar
bc93bbf5c8 gst-analytics: Add gst-video to Requires in pkg-config
`gst/analytics/analytics.h` includes `gst/analytics/gstanalyticssegmentationmtd.h`,
which in turn `gst/video/video-info.h` but `gst-video-1.0` was only listed
in `Requires.private` field of `gst-analytics-1.0.pc`.

This would cause projects linking against `gst-analytics-1.0.pc` to fail to find
the headers when using alternative interpretation of pkg-config specification
that only considers private dependencies for include path during static builds,
such as the case e.g. on Nix.

https://gitlab.freedesktop.org/pkg-config/pkg-config/-/issues/28

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8661>
2025-03-26 23:40:04 +00:00
Jordan Yelloz
a1876eee74 mse: Updated documentation cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
42f927f980 gstmsesrc: Added locking, improved seek implementation
The position is no longer duplicated across each pad and pad's segment. The
position is now only updated if it changes in the direction of playback so that
quickly repeated forward seeks do not cause the stream to seek from 0.

Reverse playback is expressly disallowed and an unnecessary extra flush of track
when seeking was removed.

A background task was added to periodically check on the current position and
the media source's buffering levels to keep the ready state up-to-date. The
source buffer no longer needs to trigger this update, it will happen whenever
the element state is READY or higher.

Finally, added proper error reporting when failing to push a buffer and improved
debug logging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
96ec1ba613 gstappendpipeline: Added name to background task
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
b1c279f0d8 gstsourcebufferlist: Added locking
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
8041073465 gstsourcebuffer: Added locking, re-worked track feed task
Since the sample map/track buffer now iterates samples in batches corresponding
to each coded frame group, the logic to feed the tracks is simpler. For media
without delta frames, it's a special case where the coded frame groups are all
size 1.

Now, all it does is skip data until the keyframe group containing the seek point
is found, then feed the track queue with the current sample and all future
samples until EOS or cancellation.

Resync of the iterator when the underlying track is modified is not necessary
because the outer loop attempts to resume feeding track data from where it was
interrupted in case of modification.

Also, the track feed task struct now holds a weak ref to its parent source
buffer to allow the task to cancel itself in any situation where the source
buffer is destroyed before the task is shut down.

Media parsing activity in the append pipeline no longer triggers ready state
recalculation on the msesrc since the msesrc now has a background task that
updates the ready state periodically when it's active which is more efficient in
cases where there is a high volume of samples being processed by the media
parser.

Finally, updated to adapt to track buffer API changes. Some functions previously
passed in a lower bound for sample timestamps. Now the source buffer is
responsible for clipping samples within a desired range of time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
0d0228ca87 gstsourcebuffer: Added name to track feed task
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
7b3ac877f9 gstsourcebuffer: Moved misplaced documentation comment
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
f5634c2aac gstmediasourcetrackbuffer: Improved buffered ranges calculation
Now when the buffered list is requested, the tolerance for merging two ranges
when there's a small gap between them is MAX(0.1sec, max frame duration * 2).

Previously it was hardcoded to 0.01sec. The specification suggests that it
could be something like the max frame duration * 2.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
3b32f53d7b gstmediasourcetrackbuffer: Added method to wait until any new data
The source buffer currently has a thread for each track that feeds the track
with all data in the track buffer until EOS is reached.

Each pass over the track buffer currently waits for the EOS to appear when it's
done iterating the track buffer which is too restrictive.

When the source buffer reaches the end of the track buffer, it should wait for
any new data to be processed -- not just an EOS -- then check for cancellation
if the deadline expires without new data.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
eec05ffeac gstmediasourcetrackbuffer: Removed start time filtering from sample iterator
This adapts to the changes to the sample map since gst_iterator_filter() is a
simpler way for callers to clip the returned samples to a desired time range.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:13 +00:00
Jordan Yelloz
c76fcabb09 gstmediasourcetrackbuffer: Removed unused code
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
3c6c0bc676 gstmediasourcetrack: Removed unused try_push() method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
537065b29e gstmediasourcetrack: Ref the sample inside push() method
This simplifies cleanup for the caller since the push method already cleans up
the sample when it is consumed by playback or if it fails to be added to the
queue.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
4f5cda94f7 gstmediasourcesamplemap: Re-worked sample iteration and removal
Both operations now work on coded frame groups (GOPs). This simplifies queueing
of video data. There is rarely any point of dealing with individual video frames
when iterating in DTS order, it's most meaningful to decode or delete whole
coded frame groups at a time, so the sample map will now do that when iterating
by DTS. When iterating in PTS order, the existing behavior is preserved since
that is used for informational purposes, not media processing.

A new private boxed type for coded frame groups was added to provide each data
item to the source buffer. Another possible solution would be creation of a new
GstSample representing the whole group by merging all the samples in a group
into a single sample containing a GstBufferList.

Also, start time filtering was removed from the API since gst_iterator_filter()
can be used by callers to achieve the same result.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
5aa3f7c16e gstmediasource: Added locking
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
f70cf55388 gstmediasource: Added caller-allocates annotation to get_live_seekable_range()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Jordan Yelloz
4e958fa45a gstmselogging: Added helper function to get nicknames of enum values
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8512>
2025-03-26 21:44:12 +00:00
Seungha Yang
2cf19176dc codecccinserter: Fix event double free
Need to steal GstVideoCodecFrame.events before unref

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8673>
2025-03-26 19:05:21 +00:00
Seungha Yang
9254c8bd41 h265ccinserter: Fix broken SPS/PPS link
Apply the same h265decoder change to h265ccinserter

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8673>
2025-03-26 19:05:21 +00:00
Seungha Yang
a014556713 h265decoder: Fix broken SPS/PPS link
Because of 2 pass nalu handling in decoder, link between
slice header and SPS/PPS can be broken at the second pass
if SPS/PPS got updated after slice header in the same AU

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4323
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8673>
2025-03-26 19:05:21 +00:00
Seungha Yang
4898020c28 h265parser: Add private method to update slice header
Adding a method to allow linking already parsed slice header
with parser's own sps/pps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8673>
2025-03-26 19:05:21 +00:00
Seungha Yang
c1835644f5 h265parser: Allow updating SPS/PPS without parent parameter set
h265parser defers linking parameter sets until slice header is parsed.
Thus valid SPS/PPS parsed by h265parser can have no linked
parent parameter set. Apply this behavior to
gst_h265_parser_update_{sps,pps} too

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8673>
2025-03-26 19:05:21 +00:00
Dongyun Seo
bbc6535a6b vkformat: fix build error
fix build error when VK_KHR_format_feature_flags2 is not defined.

Co-authored-by: Victor Jaquez vjaquez@igalia.com
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8655>
2025-03-26 00:26:02 +00:00
Eric
4e4f8b7a79 webrtc: fix hangup when duplicate sctp association IDs chosen
Fixes an issue where the webrtcbin would hangup when finalizing due
to the sctpenc hanging up when finalizing. This occurred when the
webrtcbin chose to use a sctp association ID already in use.

The sctpenc would fail to reach the paused state, but startup a task
anyways that was never stopped.

This commit modifies the behavior to not choose sctp association IDs
randomly, and instead only choose one that is free. It also prevents the
sctpenc from starting up that task if it fails to reach the paused state.

Fixes: #4188
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8607>
2025-03-25 23:07:51 +00:00
Víctor Manuel Jáquez Leal
6cf03e31bc vulkan: fix memory leak at dynamic registering
Also it cleans up a bit the code.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8639>
2025-03-14 17:13:29 +00:00
Marc Leeman
f2b5c0b602 meson.build: test for and link against libatomic if it exists
It's needed on some platforms for some subset (or all) atomic operations and
checking for the cases when it's actually needed is quite complex.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8637>
2025-03-14 15:12:33 +00:00
Piotr Brzeziński
ad6c5b05e9 vtenc: Reset restart flag when creating session in set_format()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8597>
2025-03-14 10:12:38 +00:00
Piotr Brzeziński
f7fe817c87 vtenc: Avoid deadlocking when changing properties on the fly
VT supports changing properties on the fly, and old code attempted to
support that. Perhaps 10 years ago that worked, but these days
VTSessionSetProperty will always wait for the output callback to finish
before proceeding. This means that it's very prone to deadlocking, as
property setters will take the object lock, the callback thread will
take the stream lock, and the main (streaming) thread attempts to take
both, resulting in a deadlock.

New version uses something similar to other encoders (e.g. x264enc) -
changing a property when a session is already created will just flag it
to be reconfigured upon the next encode call. This is done in similar
fashion to how restarting the session upon an error works.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8597>
2025-03-14 10:12:38 +00:00
Víctor Manuel Jáquez Leal
2172b4ab9f va: remove unused headers
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8626>
2025-03-13 10:02:05 +00:00
Philippe Normand
1e2b103b20 alphacombine: De-couple flush-start/stop events handling
There is no guarantee that any FLUSH_STOP event is preceded by a FLUSH_START.
The element now stops flushing once it has received a FLUSH_STOP on all its sink
pads.

Fixes #4174

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8604>
2025-03-12 18:34:53 +00:00
Thibault Saunier
ed693c7435 video: Give better names to buffer pools
Making debugging simpler

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8617>
2025-03-12 14:49:22 +00:00
Tim-Philipp Müller
1a971d8e12 Back to development in main branch after 1.26.0
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8621>
2025-03-12 14:21:08 +01:00
Tim-Philipp Müller
d31ce8e5e1 Release 1.26.0 2025-03-11 20:20:16 +00:00
Ruben Gonzalez
7b98c739c8 vacompositor: Add missing GST_VIDEO_CROP_META_API_TYPE
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8537>
2025-03-10 16:39:00 +00:00
Carlo Caione
69c1746139 uvcgadget: Properly implement GET_INFO control responses
According to the UVC 1.5 specification, section 4.1.2, the GET_INFO request
must return a bitmap indicating supported operations for the control.
Value 0x00 indicates that neither GET nor SET operations are supported.

This patch fixes control handling in the UVC gadget implementation to properly
respond to GET_INFO requests with the correct bitmap, allowing host systems
to properly detect supported control operations (none in this case).

The pipeline I'm using to test this is:

  gst-launch-1.0 videotestsrc ! uvcsink v4l2sink::device=/dev/video0

This is the equivalent of [0] but the difference is that we are now returning
0x00 instead of 0x03.

Without this change the host in my case is unable to probe the UVC gadget at
all, automatically disconnecting the device after a few seconds.

Following is the log when the gadget is not working (without this fix):

  usb 1-1.2: new high-speed USB device number 73 using xhci_hcd
  usb 1-1.2: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.15
  usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-1.2: Product: UVC Gadget
  usb 1-1.2: Manufacturer: localhost.localdomain
  usb 1-1.2: SerialNumber: 0123456789
  usb 1-1.2: Found UVC 1.10 device UVC Gadget (0525:a4a2)
  usb 1-1.2: Failed to query (GET_INFO) UVC control 2 on unit 1: -110 (exp. 1).
  usb 1-1.2: UVC non compliance - GET_DEF(PROBE) not supported. Enabling workaround.
  uvcvideo 1-1.2:1.1: Failed to query (129) UVC probe control : -71 (exp. 34).
  uvcvideo 1-1.2:1.1: Failed to initialize the device (-71).
  cdc_subset 1-1.2:1.0: probe with driver cdc_subset failed with error -22
  cdc_subset 1-1.2:1.1: probe with driver cdc_subset failed with error -22
  usb 1-1.2: USB disconnect, device number 73

With the fix the USB device is correctly probed:

  usb 1-1.2: new high-speed USB device number 88 using xhci_hcd
  usb 1-1.2: New USB device found, idVendor=0525, idProduct=a4a2, bcdDevice= 5.15
  usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 1-1.2: Product: UVC Gadget
  usb 1-1.2: Manufacturer: localhost.localdomain
  usb 1-1.2: SerialNumber: 0123456789
  usb 1-1.2: Found UVC 1.10 device UVC Gadget (0525:a4a2)

[0] camera/uvc-gadget@0df9d3ad

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8572>
2025-03-07 10:12:25 +01:00
Benjamin Gaignard
cb681d8d28 v4l2codecs: Fix caps leak after sorting caps
gst_v4l2_format_sort_caps() create a new caps which need to be
release to avoid leak.

Co-authored-by: Robert Mader <robert.mader@posteo.de>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
Benjamin Gaignard
95a3c0123f v4l2codecs: Release sink allocator when deciding allocation
All decoders have the same design pattern in decide allocation
and forgot to release sink allocator before allocating a new one.
Fixing the memory leak by clearing sink allocator before creating
the new one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
Benjamin Gaignard
0d1cc08176 v4l2codecs: allocator: Fix buffers leak when using remove buffers
When removing buffers from v4l2 queue do not forget to release
the memory on gstreamer side.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8583>
2025-03-06 21:28:33 +00:00
Seungha Yang
dba3bdd0cf h264ccextractor,h265ccextractor: Do not resend caps per output buffer
Send caps event only when it's required

Fixes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4281
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8596>
2025-03-06 16:24:44 +00:00
Pablo García
af148bb746 curl: replace #if with #ifdef (part 2)
Continuation of 47d1262402c81a9054e618052deeff7414b4f75d, that is not enough.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8595>
2025-03-06 13:44:33 +00:00
Stéphane Cerveau
93364189d0 vulkan/operation: fix timeline semaphore extension detection
As for synchronization2, the timeline semaphore has been
been promoted in 1.2 and does not have to be enabled explicitely.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
b9bbcf9202 vulkan/operation: fix synchronization2 extension detection
The synchronization2 extension is a core part of Vulkan 1.3.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
e23bc6ed77 vulkan/device: only enable relevant extensions
Extensions can have a minimum set of dependencies (e.g. API version) and may
also be promoted to core in a later version.  Don't explicitly enable extensions
that fail to meet their requirements or that have been promoted to the core API.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
e7b8ac099f vulkan/operation: retrieve function pointers directly from the device
The instance API version supported may not be of the same version supported by
the device. It is possible that the function that is returned may be non-0
but not functional due to the requested API version of the instance limiting the
availability of calling the returned function.

Can be reproduced by running a pipeline with GST_VULKAN_INSTANCE_API_VERSION=1.1

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
7452589ff8 vulkan/instance: allow the requested api version to be larger than the supported
Since Vulkan 1.1, the requested API version is the maximum API version that the
application is expecting to use. It is also possible for individual devices
(backed by potentially different drivers) may support a higher or lower API
version than the instance.  Both cases (higher and lower) should be supported
and as such, it is not an error to request an API version that is larger than
the instance supported API version.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:21 +00:00
Matthew Waters
156b05d52b vulkan: plugin: add debug for why an instance fails to open
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Matthew Waters
4692a45dea vkformat: fix format_from_video_info_2 to actually runtime check versions and extensions
If the vulkan plugin was compiled against a newer version than the supported
vulkan runtime instance or device, then it was possible for format retrieval to
fail.  Failure was due to unconditionally using newer extensions and features
without runtime checking them.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00
Matthew Waters
51dda24a88 vulkan: fix device related API version checks
The API version exposed by a particular device can be completely different from
what is exported by the parent instance.  Since Vulkan 1.1 it is also possible
to use newer device API than supported by the instance API version (with the
appropriate version checks).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8554>
2025-03-06 12:14:20 +00:00