mirror of
https://github.com/games-on-whales/gst-wayland-display.git
synced 2026-10-15 21:02:00 +00:00
[PR #34] [CLOSED] feat(waylandsrc): add await-listener to defer caps negotiation until a consumer connects #35
Labels
No labels
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/gst-wayland-display#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/gst-wayland-display/pull/34
Author: @JBailes
Created: 6/17/2026
Status: ❌ Closed
Base:
stable← Head:feat/await-listener📝 Commits (2)
8acb12dfeat(waylandsrc): add await-listener to defer caps negotiation30b3b4frefactor(waylandsrc): replace await-listener poll with condvar📊 Changes
1 file changed (+106 additions, -1 deletions)
View changed files
📝
gst-plugin-wayland-display/src/waylandsrc/imp.rs(+106 -1)📄 Description
Problem
When
waylanddisplaysrcfeeds a decoupled consumer through aninterpipesink(as Wolf does for streaming), the producer pipeline starts and fixes its output format before any consumer is listening. With a generic producer cap such asvideo/x-raw(memory:DMABuf), the compositor settles on the first advertised drm-format, which on both AMD and Intel is a 64-bit float format (AB4H). Downstream converters likevapostproccan't ingest it, so negotiation fails withnot-negotiatedonce the client actually connects. Live renegotiation can't recover it: the in-flight buffer and the producer capsfilter are already anchored to the bad format.Fix
Add an opt-in
await-listenerproperty (defaultfalse, so existing behaviour is unchanged). When enabled,negotiate()waits until the downstream caps query changes (a consumer connected and intersected its own caps in) before fixing caps. The format is then chosen jointly with the consumer, so it's one both sides support.Detection watches for the downstream caps change rather than inspecting formats, so it stays fully format-agnostic and keeps working as GPUs add new formats. The wayland compositor runs on its own thread, so the application keeps rendering while negotiation is deferred, and
unlock()aborts the wait so state changes never block on a consumer that never arrives.Testing
Verified on real hardware via a producer/consumer interpipe harness (producer started first, consumer attached ~1.5s later, matching Wolf's lifecycle):
not-negotiatedfailure;await-listener=truenegotiates jointly and produces H265 (exit 0).await-listener=trueproduces H265 (exit 0); the producer correctly does not fixate early.await-listener=trueand no consumer ever attaching (no hang).Consumed by games-on-whales/wolf to fix DMA-BUF zero-copy negotiation (PR #419).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.