mirror of
https://github.com/games-on-whales/gst-wayland-display.git
synced 2026-10-15 12:51:57 +00:00
[PR #45] [MERGED] fix(vulkan): clear PTS on recycled encode-src ring buffers so do_timestamp restamps #48
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#48
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/45
Author: @salty2011
Created: 7/26/2026
Status: ✅ Merged
Merged: 8/16/2026
Merged by: @JBailes
Base:
feat/vulkan-encode← Head:fix/vulkan-encode-src-pts📝 Commits (2)
35da978fix(vulkan): clear PTS on recycled encode-src ring buffers so do_timestamp restamps7853a24review: move PTS reset into convert_inner after the reuse gate📊 Changes
1 file changed (+27 additions, -0 deletions)
View changed files
📝
wayland-display-core/src/utils/vulkan_nv12.rs(+27 -0)📄 Description
VulkanNv12::to_gst_buffer()returns a bare clone of the current ring slot's persistentGstBuffer.waylanddisplaysrcruns withset_do_timestamp(true), which only stamps a buffer whose PTS isGST_CLOCK_TIME_NONE— and a recycled slot buffer still carries the PTS from its previous use, sodo_timestampskips it.With the default ring depth of 4, the exported PTS therefore degenerate to four recurring values, non-monotonic and duplicated across frames. Live trace on my host: 99.9% of frames shared a timestamp with another frame, 25% were non-monotonic, and exactly four distinct RTP timestamps cycled forever.
Downstream that is fatal for WebRTC:
rtph264payderives RTP timestamps from those PTS, and libwebrtc'sPacketBuffercannot assemble the result. The browser dropped roughly 60% of frames at the decode stage on a clean LAN with zero packet loss (framesAssembledFromMultiplePackets39.7%, versus 99.9% on the VA path). The stream looks black or frozen whilevideo.videoWidthis set andcurrentTimeadvances, so it is easy to misread as a negotiation problem.The RGBx and DMABuf output paths never hit this because each builds a fresh
GstBuffer(PTSNONE) every frame. This restores the same behaviour for the Vulkan path: clear PTS/DTS/duration on the recycled buffer before returning it, sodo_timestampre-stamps it with the current running time each frame.Scoped to the
encode_srccase, so the compositor-NV12 dmabuf path (encode_src == false) is byte-identical. Only timing metadata is reset — the buffer's memory and video meta are untouched.Build-verified on this branch's head (
43d4c25). This fix has been running in my deployment since 2026-07-06.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.