kwin wayland screencapture buffer timestamps incorrect
For screencapturing under wayland, kwin opens a pipewire stream and pushes frames into it.
While working with it from the other side using GStreamer, I noticed that the buffer timestamps are borked (every buffer has the timestamp 0
).
Apparently, this is because pts needs to be absolute, where absolute means the equivalent to: clock_gettime(CLOCK_MONOTONIC, &ts)
. I think that's the clock counting nanoseconds since the computer was started. (Yeah, I also think that's weird...)
To test this, I patched kwin to not subtract the start timestamp and instead directly output the source's clock. That made it work
On the pipewire side:
Edited by Markus Ebner