Commit graph

4249 commits

Author SHA1 Message Date
François Laignel
3fec94a234 threadshare: examples: add a new benchmark program
This new example is built upon the existing `ts-standalone`:

* `ts-standalone` allows focusing on the overhead of threadshare specific
  constructs. It uses a very light source element because buffer content is not
  the concern in this case.
* `ts-standalone-rtprecv` aims at simulating a closer to real world use case:
  it uses `ts-audiotestsrc` and `rtprecv`. `rtprecv` can push buffers either
  from the upstream thread or from a blocking thread. Note that this example
  intentionally drops buffers so `rtprecv` can exhibit both behaviours.

Reminders:

* Use `GST_DEBUG=ts-standalone*:4` to display statistics.
* Compile with `--release`.
* Compile with `--feature tunning` to get stats about the duration the
  Throttling Scheduler at the sink spent parked.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2496>
2025-08-26 20:19:20 +02:00
François Laignel
0f87d52d0d threadshare: always use block_on_or_add_subtask
Some state transitions relied on `block_on`, which caused a panic due to an
attempt to block while runing on a `Context` in the following situation:

* Upstream runs on a `Context`.
* Current threadshare element state is sync on parent in a `pad-added`
  callback.

This commit:

* Uses `block_on_or_add_subtask` in all call sites where `block_on` was used.
* Renames `task::TransitionStatus::await_maybe_on_context` as
  `block_on_or_add_subtask()`. Previous name didn't make it explicit it could
  block. The new name matches the similar function in `executor`.
* Implements a new `block_on_or_add_subtask_then()` on `task::TransitionStatus`.
  Compared to `block_on_or_add_subtask()`, it will also execute the provided
  function after the transition occured or failed, whathever the executor being
  used.
* Remove `task::TransitionStatus::block_on` as private: it shouldn't be used in
  user code (it's still used in unit tests though).

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2494>
2025-08-26 18:48:55 +02:00
Robert Mader
5d976540b3 gtk4: Try importing dmabufs withouth DMA_DRM caps
If an upstream elements uses dmabufs - and supports the videometa -
but negotiated sysmem caps, try to use the dmabuf texture builder
for direct GPU buffer imports.

This is notably the case if a udmabuf allocator is used, but also
if elements support dmabufs but do not yet support the DMA_DRM API.
An example for the later is Snapshot on phones. On one hand its
current implementation around camerabin makes using DMA_DRM caps hard
without breaking capturing with software encoders, while on the other
hand importing buffers with GL/VK not only avoids a buffer upload/copy,
but also `DMA_BUF_IOCTL_SYNC` calls, which are potentially expensive
on aarch64. Finally importing dmabufs potentially allows offloading to
display planes.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2490>
2025-08-24 16:45:23 +02:00
Robert Mader
b2ae5dfa54 gtk4: Add debug logs for frame type
Since commit 7b561354 it is easy - and helpful for development
and debugging.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2490>
2025-08-23 17:06:17 +02:00
r4v3n6101
de26c2d58b rtmp4gdepay2: fix condition while creating parser
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2441>
2025-08-22 08:05:33 +00:00
François Laignel
db8dabf195 threadshare: update examples
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2484>
2025-08-20 18:05:08 +02:00
Thibault Saunier
9dcb2afaf7 cargo_wrapper: Fix depfile generation for binaries and add debug logging
The depfile generation was only handling lib.rs files, missing main.rs
files used by binary crates. This caused incomplete dependency tracking
for binary targets.

Also added debug logging to help diagnose issues with Cargo.toml
detection and stripped whitespace from source paths to handle parsing
edge cases.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2471>
2025-08-20 06:51:33 +00:00
Thibault Saunier
738de23ef8 cargo_wrapper: Ignore stale dep files from previous branch builds
When switching between branches that have different plugins or dependencies,
stale .d files from the previous branch can cause cargo to be unnecessarily
invoked on every build, even when no actual changes have been made.

This fix checks the modification time of dependency files against the current
build start time and ignores any .d files that weren't generated during the
current cargo run. This prevents spurious rebuilds when switching between
branches with different plugin configurations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2471>
2025-08-20 06:51:33 +00:00
Thibault Saunier
c1712113a9 cargo_wrapper: Fix log file name
We were using the same log files for bins and plugins

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2471>
2025-08-20 06:51:33 +00:00
Thibault Saunier
04e9660c26 cargo_wrapper: Reindent and cleanup
This commit should go into a new .git-blame-ignore-revs file when we have the
final hash

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2471>
2025-08-20 06:51:33 +00:00
Tim-Philipp Müller
01b8303b5c threadshare: blocking_adapter: fix Since marker in docs
Should be 0.14.2 since it has been backported to the 0.14 branch.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2479>
2025-08-20 06:21:17 +00:00
François Laignel
829cc21696 threadshare: inter: update doc example
Use recent improvements:

* `ts-audiotestsrc` can now be used properly.
* `ts-blocking-adapter` must be used before a blocking element.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2477>
2025-08-19 16:49:24 +02:00
François Laignel
243a8a93ea threadshare: have Task log its obj
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2476>
2025-08-19 13:38:51 +02:00
Sebastian Dröge
a005cf8e05 fallbacksrc: Don't keep CustomSource state locked while adding/removing pads
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2474>
2025-08-18 13:08:07 +03:00
Sebastian Dröge
6fb729d771 fallbacksrc: Don't lock CustomSource state lock twice when exposing pads
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2474>
2025-08-18 13:07:51 +03:00
Thibault Saunier
90cc117095 ci: Re enable skia as https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/692 was fixed
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2472>
2025-08-14 22:39:51 -04:00
Sanchayan Maity
3e291611b2 Update docs for hlssink3 plugin to include single media file property
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 20:02:14 +05:30
Sanchayan Maity
bd30823dbb hlssink3: Add fmp4 plugin as a dependency for hlscmafsink tests
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 20:02:14 +05:30
Sanchayan Maity
1f68cf4f44 hlssink3/hlscmafsink: Make GioOutputStream a sub-class of OutputStream
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 20:02:14 +05:30
Sanchayan Maity
917e1f5885 hlssink3/hlscmafsink: Add test for validating non-overlapping byte range
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 20:02:14 +05:30
Sanchayan Maity
a8684853d0 hlssink3/hlscmafsink: Add byte range tag information to hls-segment-added message
While at it, for tests, replace unreachable!() with panic!() and print
the error message contents.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 20:02:14 +05:30
Sanchayan Maity
efbfab76bc hlssink3/hlscmafsink: Add tests for single media file
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 19:24:50 +05:30
Sanchayan Maity
2539a59b99 hlssink3/hlscmafsink: Support the use of a single media file
Allow the use of a single file for media. Media playlist will use byte
range tags like below while referencing the same single media file.

```
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MAP:URI="main.mp4",BYTERANGE="768@0"
#EXT-X-BYTERANGE:198120@768
#EXTINF:10,
main.mp4
#EXT-X-BYTERANGE:197426@198888
#EXTINF:10,
main.mp4
```

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2439>
2025-08-14 19:24:50 +05:30
François Laignel
8ec5d0995f rtprecv: fix race condition on first buffer
When an incoming buffer is received, a deadlock can occur if:

1. 1st buffer is currently being handled by the src pad's task
   => holds semaphore.
2. 1st buffer reaches downstream AudioDecoder => Latency query.
3. src pad's task still holding semaphore while relaying Latency query.
4. `src_query()` calls `Pad::default()` which calls `iterate_internal_links()`.
5. `iterate_internal_links()` tries to acquire the `state` `Mutex` which is
   already locked  by `handle_push_jitterbuffer()`.

This commit temporarily releases the `state` `Mutex` until the semaphore is
acquired.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2466>
2025-08-13 18:20:23 +00:00
François Laignel
e4e14cf5ca threadshare: intersink: return from blocking tasks when stopping
This commit cancels blocking tasks when the element is requested to stop.
This is to prevent deadlocks.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2465>
2025-08-13 17:47:18 +00:00
François Laignel
458e59979f threadshare: inter: store upstream latency in InterContext
... instead of retrieving the element following the sink pad.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2465>
2025-08-13 17:47:18 +00:00
François Laignel
c9334b218f threadshare: add a blocking adapter element
When a threadshare element streams buffers to an element which synchronizes on
the clock or which uses a limited blocking queue, the threadshare context is
perdiodically blocked, preventing other async tasks from progressing.

One workaround is to use a regular `queue` with enough buffering to cope with
early buffers. This is suboptimal though because this `queue` doesn't propagate
backpressure upstream.

The `ts-blocking-adapter` applies an async backpressure when downstream blocks,
allowing the threadshare context to process other tasks. This is achieved by
having the 'sink' Pad forward serialized items (buffers, ...) to the 'src' Pad
Task (thread) via a rendezvous channel.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2427>
2025-08-13 17:04:54 +00:00
Sebastian Dröge
61578518d4 transcriberbin: Fix settings/state lock order violation in set_property()
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2463>
2025-08-13 13:57:35 +03:00
Sebastian Dröge
9710476c96 transcriberbin: Don't keep state locked while querying upstream latency
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2463>
2025-08-13 13:57:17 +03:00
François Laignel
357336cd56 threadshare: audiotestsrc: fix setting samples-per-buffer...
... by not locking `settings` twice.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2461>
2025-08-12 12:49:31 +02:00
Mathieu Duponchelle
75e2582802 tttocea708/translate: improve logic for prepending spaces
No space needs to be prepended after inserting a carriage return or
clearing the screen.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2345>
2025-08-11 18:21:55 +00:00
Mathieu Duponchelle
4ad8295ae3 tttocea708: implement the same behavior as tttocea608 on speaker change
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2345>
2025-08-11 18:21:55 +00:00
Mathieu Duponchelle
db8d0e90c9 tttocea608: expose speaker-prefix property
When set, the value will be used to prefix the new line when outputting
a carriage return after a speaker change in roll-up mode.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2345>
2025-08-11 18:21:55 +00:00
Thibault Saunier
abc5cf7303 rtpgccbwe: avoid clamp() panic when min_bitrate > max_bitrate
Prevent calling clamp() with invalid bounds where min > max, which would
cause a panic with "assertion failed: min <= max". This panic would poison
the mutex lock, causing all subsequent lock().unwrap() calls to fail with
PoisonError.

This can happen when min-bitrate and max-bitrate properties are set
individually, creating a temporary inconsistent state between the values.

Fix by validating the bitrate range before calling clamp() and using
max_bitrate for both bounds when min > max to ensure safe operation.
Use LogContext to log the error only once per unique invalid pair.

Fixes #711

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2456>
2025-08-11 11:29:11 -04:00
Sebastian Dröge
2336688c8a fallbacksrc: Don't restart source if the element is just being shut down
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2455>
2025-08-11 16:40:37 +03:00
Seungha Yang
ef3c03074a aws: Ensure task stopping on paused-to-ready state change
Disconnect channel so that srcpad task can stop immediately

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2440>
2025-08-11 11:59:52 +00:00
Sebastian Dröge
a41a6954fc fallbacksrc: Don't panic during retries if the element was shut down in parallel
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2451>
2025-08-11 14:30:42 +03:00
Sebastian Dröge
9861f682e6 s302mparse: Add new S302M audio parser
This extracts metadata from an S302M audio stream and interpolates PTS
as needed, but still requires a properly packetized stream from
upstream.

Parsing S302M without packetization is not easily possible because of
the lack of synchronization markers.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2435>
2025-08-11 08:33:18 +00:00
Sebastian Dröge
8270a44192 Update CHANGELOG.md for 0.14.1 2025-08-10 22:06:30 +03:00
Sebastian Dröge
512f655b1d Update Cargo.lock
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2448>
2025-08-10 11:39:40 +00:00
Sebastian Dröge
d1b2c3a2e9 Update to async-tungstenite 0.31
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2448>
2025-08-10 11:39:40 +00:00
Tim-Philipp Müller
ece7013e71 README: add missing plugins
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2443>
2025-08-10 09:26:31 +00:00
Tim-Philipp Müller
9ac981b731 ci: add script to check README against plugins list
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2443>
2025-08-10 09:26:31 +00:00
Sebastian Dröge
e52dedcf38 analytics: Ignore some tests that fail due to core changes until fixed
See https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2444
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9522

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2442>
2025-08-10 09:31:29 +03:00
Sebastian Dröge
97ed00c8cd docs: Update plugins cache
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2442>
2025-08-08 17:12:56 +03:00
Sebastian Dröge
860b8fc241 Don't suggest running cargo cinstall after cargo cbuild
That will build everything twice as `cargo cbuild` builds with the dev
profile by default and `cargo cinstall` uses the release profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2442>
2025-08-08 16:48:51 +03:00
Sebastian Dröge
a8be57a742 Fix various new clippy 1.89 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2436>
2025-08-07 12:26:54 +00:00
Thibault Saunier
4e7d42c16e tracers: pipeline-snapshot: reduce WebSocket connection log level
Change WebSocket connection failure log from warning to debug level as
these retries are expected behavior and don't indicate an error condition.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2433>
2025-08-06 10:41:51 -04:00
Sebastian Dröge
aa4d9333b9 threadshare: Also enable windows Win32_Networking_WinSock feature
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2431>
2025-08-06 11:09:59 +00:00
François Laignel
fe4e355b9e webrtc: android example: remove videoconvert
The `glimagesink` can handle video conversion just fine, we don't need to use
a `videoconvert` in that branch.

This commit also moves the `handle_media_stream()` branches within
`on_incoming_stream()` as the factorization is no longer justified.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2216>
2025-08-06 10:42:36 +00:00