Repository navigation
Conversation
Contributor
Author
|
@greptileai review |
Contributor
|
@kyzer1023 is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Thanks for this. The refcount handling looks right to us: a slot is only refilled once
Once those are in, it needs a 5/5 Greptile review on the new head plus green CI to merge. |
Contributor
Author
|
Both items addressed on
Requesting Greptile recheck on the new head. |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@richiemcilroy Ready for another look — Greptile 5/5 and CI green on |
This was referenced Oct 25, 2026
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
Contributor
Author
|
@greptileai review |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
X11 and PipeWire screen grabs allocated a new
ffmpeg::frame::Videoon every frame, then copied the capture bytes into it. This change keeps a 4-frame pool per grabber, keyed by pixel format, width, and height. The pool is rebuilt when that key changes. A frame that is still referenced by the caller is not reused. The caller gets anav_frame_refof the slot (Video::clonedeep-copies, so it is not used here). If every slot is still live, that grab allocates one frame and does not grow the pool.Benchmark
Re-measured on an Intel Xeon (family 6 model 207 stepping 2, 4 cores, x86_64, AVX2 and AVX-512). Warmup 30, runs 200, previous frame kept live, BGRZ. Fresh process per resolution. Numbers come from a throwaway harness on the cloud agent VM (not checked into this PR).
An earlier throwaway scan on a similar VM saw about 1.86 ms for alloc+copy at 1080p versus about 0.48 ms into a resident frame. That split did not reproduce here: both paths are about 0.50 ms median at 1080p. At 4K the median stays about 2.0 ms either way. The 4K alloc path mean is about 4.4 to 4.7 ms from slow outliers; the pool mean stays about 2.0 ms.
Test plan
cargo fmt --allcargo clippy -p cap-recording --lib --tests --no-deps(no new warnings from this change)cargo test -p cap-recording --lib -- pipewire_frame_tests(10 passed), includingcapture_frame_pool_keeps_held_frames_when_capacity_is_busycargo test -p cap-recording --test x11_shm_capture(7 passed, 1 ignored)

Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues were found.Summary
Adds a four-frame pool for X11 and memory-backed PipeWire capture.
The earlier busy-pool test request is addressed by
capture_frame_pool_keeps_held_frames_when_capacity_is_busy.Reviews (9) · Last reviewed commit: "fix: wait for transient macOS permission..." · Reviewed by Greptile