147 Commits

Author SHA1 Message Date
Tim-Philipp Müller
d273b790e1 textoverlay: fix shading for RGBx/RGBA pixel format variants
... for cases where there's padding at the end of each row.

Fixes #4414.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9106>
2025-05-28 08:45:03 +00:00
Sebastian Dröge
6072e54666 gl: Implement basetransform meta transform function
This makes sure we can pass through more metas correctly, e.g.
GstVideoOverlayComposition meta.

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9004>
2025-05-21 12:13:56 +00:00
Matthew Waters
daae2c18a4 gl/window: add support for configuring whether a backing surface is needed
Fixes videotestsrc ! glimagesink videotestsrc ! glimagesink under Wayland (at
least).

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

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9007>
2025-05-21 08:30:47 +00:00
Adrian Perez de Castro
3968dd92a5 alsa: Support enumerating virtual PCM sinks
Add support to the ALSA device provider to enumerate PCM outputs that do
not correspond to a physical sound device i.e. they are "virtual" sinks,
like the plug, dmix, or softvol PCM outputs that can be setup in the ALSA
configuration files.

The main use-case for this is allowing usage of GstDeviceMonitor in setups
where there is no audio server and have custom ALSA audio configurations.
As those are likely to be uncommon, the feature is opt-in: a list of device
names and wildcard patterns separated by semicolons must be assigned to the
GST_ALSA_PCM_ALLOW environment variable before such PCM outputs will be
enumerated by the ALSA device provider. This allows either scanning all
PCM outputs, listing individual outputs, providing simple patterns with
'*' wildcards (which match only at the start or end of the name), or
a combination of them:

  GST_ALSA_PCM_ALLOW=1                         # Enable listing PCM outputs.
  GST_ALSA_PCM_ALLOW='*'                       # Same, using a wildcard.
  GST_ALSA_PCM_ALLOW='out_1;out_1'             # Exact listing.
  GST_ALSA_PCM_ALLOW='out_*'                   # Using a wildcard.
  GST_ALSA_PCM_ALLOW='out_*;other_*;line_out'  # Multiple items.

The main motivation for this patch is supporting enumeration of PCM outputs
in the WebKit GTK and WPE ports, which use GstDeviceMonitor to determine
which devices may be chosen for sound output. While on desktops typically
PulseAudio or PipeWire are used nowadays, on embedded devices it is often
desirable to avoid them and use custom configurations that perform audio
routing and processing using only ALSA.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8831>
2025-05-17 00:47:36 +03:00
Adrian Perez de Castro
6432f6a1f2 alsa: Avoid infinite loop in DSD rate detection
Stop testing DSD rates in gst_alsa_detect_dsd_rates() if the rate becomes zero
or negative. This avoids an infinite loop if gst_alsa_probe_supported_formats()
is used on a PCM sink defined like the following in the ALSA configuration file:

  pcm.buggy {
    type plug
    slave.pcm "buggy_volume"
    hint.description "Causes an infinite loop in GStreamer"
  }
  pcm.buggy_volume {
    type softvol
    slave.pcm "buggy_dmix"
    control.name "buggy_volume"
  }
  pcm.buggy_dmix {
    type dmix
    ipc_key 12345
    slave {
      pcm "hw:0,0"
      period_size 1024
      buffer_size 4096
    }
  }

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8985>
2025-05-16 17:09:05 +00:00
Doug Nazar
e4f60e44ee gstglfiltershader: Free various props before set & during cleanup
gst_object_replace() takes a reference so no need to dup object.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8978>
2025-05-13 19:42:37 -04:00
Alexander Slobodeniuk
d437e92049 properties: add G_PARAM_STATIC_STRINGS where missing
"Hold on, I know you need to generate the registry, but let me just
create copies of all those strings first", Framework whispered

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8915>
2025-05-10 12:09:38 +00:00
Jakub Adam
9f4f543bf7 gldownload: improve logging of gl-dmabuf pool usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8938>
2025-05-06 19:50:43 +00:00
Jakub Adam
f9941b135f gldmabufferpool: disable "free cache" workaround in GstGLBufferPool
This pool isn't reusing its buffers, which makes it pointless to enable
the cache

Holding an extra  buffer in free queue can also lead to a deadlock when
the pool's max buffer count is configured low (commonly 2).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8939>
2025-05-06 18:22:19 +00:00
Nirbheek Chauhan
1fdfab27a3 meson: Add include_type: 'system' everywhere to squelch wrap warnings
Wrap dependencies add a ton of warnings with the latest GCC in Fedora
42. Squelch them by specifying that these dependencies are not
a part of the gstreamer project, and should be treated as system deps.

libsoup needs some porting work for the bump, and vorbis/lame are
already at their latest releases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8753>
2025-04-30 10:18:56 +00:00
Alexander Slobodeniuk
a03c4de48f elements: use set_static_metadata when it's allowed
Those strings are nice but CPU doesn't want to copy them

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8905>
2025-04-26 19:30:15 +02:00
Philippe Normand
c4bfa73391 oggdemux: Don't push new packets if there is a pending seek
There was a race condition where the demuxer would seek back to beginning after
determining the duration and while that seek was in progress one pad would
attempt to push a new buffer downstream, leading to a critical warning in
gst_pad_push().

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8785>
2025-04-14 10:15:05 +01:00
Hou Qi
bf24ca6d29 gldownload: unref glcontext after usage
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8807>
2025-04-10 09:27:04 +00:00
Doug Nazar
5a19c4a4ae theoraenc: Free various props before being set
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
3a20c0bca3 gl: Free various props during cleanup
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
a7dce91f0d alsamidisrc: free ports during finalize()
If the element is never start/stopped the ports variable will leak.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Doug Nazar
5f90a4ae67 all: Annotate *_set_property() contructor only props without free
Properties that are marked constructor only aren't required to be freed
before g_value_dup_string() as they can only be called once during construction.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8648>
2025-03-27 09:03:18 +00:00
Olivier Blin
9b47a2dde3 alsadeviceprovider: Fix leak of Alsa longname
Detected by ASan.

As a drive-by fix, use free() instead of g_free() in gstalsadeviceprovider.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8619>
2025-03-13 01:01:39 +00:00
Sebastian Dröge
4fb5784e53 gluploadelement: Fix typo in debug output
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8431>
2025-02-14 18:44:33 +00:00
Alexander Slobodeniuk
33fc2d9c65 glvideomixer: fix missing GObject vtable chainups
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8452>
2025-02-11 22:49:06 +01:00
Alexander Slobodeniuk
6016cdccf1 gl: fix chaining up GObject's constructed virtual method
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8416>
2025-02-10 17:49:29 +00:00
Philippe Normand
5de3cfca31 oggdemux: Fix racy decode error
Sometimes the seek to the end of file to determine the duration would trigger a
reset of the source pads, that would confuse the decoder downstream and trigger
an error. So the proposed fix is to not reset pads when the segment event being
processed is the consequence of a seek performed to determine the duration.

Fixes #4212

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/937>
2025-02-04 18:56:25 +00:00
Tomas Granath
49e4c0b451 oggdemux: Do not change total duration until new duration is found
After calculating a correct duration the oggdemux in some cases sets the duration to GST_CLOCK_TIME_NONE.
After that any seek will fail due to the oggdemux calculating a target time after the actual duration.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8296>
2025-01-27 17:13:38 +00:00
Mathieu Duponchelle
3de86b2b97 docs: port plugins to explicit sources
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8273>
2025-01-13 19:17:13 +01:00
Edward Hervey
a9984a0003 vorbisdec: Fix check for "-1" bitrate values
The check is exactly the same, but more explicit.

Original commit that introduced the check is
20fb58be198e7d76ece4e6c635cda7c919fad6d2:
---
vorbisdec: don't put invalid bitrate values into the taglist

Bitrates are stored as 32-bit signed integers in the vorbis
identification headers, but seem to be read incorrectly,
namely as unsigned 32-bit integers, into the vorbis structure
members which are of type long, which makes our check for
values <= 0 fail with files that put -1 in there for unset
values.
---

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
2025-01-13 12:51:45 +00:00
Edward Hervey
989539830d libvisual: Fix for libvisual headers
They use old style definition

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
2025-01-13 12:51:44 +00:00
Edward Hervey
319ff17300 base: Fix fallthrough declarations
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
2025-01-13 12:51:44 +00:00
Guillaume Desmottes
94253529c4 glmixerbin: derivate the mixer name from the bin name
Make it easier to identify a specific instance in logs in complex
pipelines.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8183>
2025-01-06 07:50:43 +00:00
Sebastian Dröge
5093691ef2 vorbisdec: Set at most 64 channels to NONE position
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-115
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3869

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8035>
2024-12-03 14:30:41 +00:00
Mathieu Duponchelle
e633ec6428 oggstream: review and fix per-format min_packet_size
This addresses all manually detected invalid reads in setup functions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8038>
2024-12-03 08:59:25 +00:00
Mathieu Duponchelle
006047a23a vorbis_parse: check writes to GstOggStream.vorbis_mode_sizes
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-117 Fixes gstreamer#3875

Also perform out-of-bounds check for accesses to op->packet

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8038>
2024-12-03 08:59:25 +00:00
Sebastian Dröge
2838374d6e opusdec: Set at most 64 channels to NONE position
Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-116
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3871

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8037>
2024-12-03 08:09:09 +00:00
Jakub Adam
2209d4382f gldownload: warn on fallback from DMABuf to system memory
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8013>
2024-12-02 20:25:37 +00:00
Philipp Zabel
c024c5e3bf gstgldmabufbufferpool: use gsteglimagecache
Store the imported GstEGLImage in a GstEGLImageCache. Since this passes
ownership to the cache, stop unreffing the images from the GstMemory.
Free the cache when the buffer pool is stopped.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Nicolas Dufresne
a18f1af1a4 gldownload: Implement importing RGBA with modifiers
For single plane RGBA based formats, implement support for modifiers.
This fixes issues where linear is actually configured in GL causing
visual artifacts.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Jakub Adam
b7970a4d95 gldownload: enumerate emulated video formats
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:28 -05:00
Nicolas Dufresne
5b55930db8 gldmabufbufferpool: allow the dmabuf_pool configuration to change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
533d115659 downloadelement: support dma_drm caps in try_export_dmabuf
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Jakub Adam
188b626ffc gldownload: import DMABufs from downstream pool
* if downstream provides us with a pool that can allocate DMA buffers,
  gldownload wraps it into a GL buffer pool that uses
  glEGLImageTargetTexture2DOES() to import dmabuf into textures
* upstream GL elements can allocate from that pool
* gldownload unwraps DMA buffers from incoming GL buffers and passes
  them downstream

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6792>
2024-11-28 15:25:27 -05:00
Nirbheek Chauhan
c1a8ee9655 meson: Don't use libdrm_dep in cc.has_header()
It can't handle subproject dependencies. Pointed out in
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4033#note_2665974

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7927>
2024-11-20 17:47:01 +00:00
Matthew Waters
e2d143f65d oggdemux: silence a maybe-unitialized warning
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7875>
2024-11-18 12:10:57 +11:00
Sebastian Dröge
b7b24573ce common: Use more efficient versions of GstCapsFeatures API where possible
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:26:18 +03:00
Sebastian Dröge
6233eb0ff3 common: Stop using GQuark-based GstStructure field name API
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7432>
2024-09-26 19:21:29 +03:00
Chao Guo
c35687fcbf 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/7341>
2024-09-04 02:52:56 +00:00
Nirbheek Chauhan
2ee51bf6f6 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/7204>
2024-07-20 01:05:58 +00:00
Nirbheek Chauhan
a1463637e0 pango: Add a property to compensate for display response time
When measuring video latency, one mechanism involves taking a photo
with a camera of two screens showing the test video overlayed with
timeoverlay or clockoverlay. In these cases, if the display's pixel
response time is crappy, you will see ghosting due to which it can be
quite difficult to discern what the current timestamp being shown is.

This commit adds a property that *also* shows the timestamp in
a different (sequentially predictable) location every frame, which
makes it easy to tell what the latest rendered timestamp is.

For bonus points, you can also use the fade-time of the previous frame
to measure with sub-framerate accuracy when the photo was taken, not
just clamped to the framerate, giving you a higher precision latency
value.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6935>
2024-06-06 14:03:04 +00:00
Jakub Adam
c56a87b73d 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/6968>
2024-06-01 08:09:34 +00:00
Nirbheek Chauhan
fe1a7edda2 gl: Fix libdrm dependency detection and usage
drm_fourcc.h should be picked up via the pkgconfig dep, not the system
includedir directly. All this allows it to be picked up consistently
(via the subproject, for example).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6932>
2024-05-29 15:49:45 +00:00
Guillaume Desmottes
0b17b17a8a basetextoverlay: use GST_DEBUG_OBJECT instead of GST_DEBUG
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6918>
2024-05-27 08:36:17 +02:00
Thibault Saunier
41f8276c2b glvideomixer: Handle pads which have no caps set on mouse events
And directly use the pad vinfo instead of getting current caps

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6265>
2024-05-05 12:37:05 +00:00