perf(windows): skip the webcam frame copy when its sequence has not changed - #941
Conversation
…hanged copyLatestFrame now takes the caller's last seen sequence and returns false without copying when nothing new arrived. Both capture backends share the rule through snapshotWebcamFrame, covered by webcam_snapshot_test.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit detailsLimit details: You’ve used all 8 included reviews currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
The video writer no longer copies the webcam frame when it already holds it. With a 30 fps camera and a 60 fps screen, that removes about 30 full-frame copies a second from the thread that paces the screen.
Fixes #934
Part of #920
Change
copyLatestFrametakes the caller's last seen sequence and returns false without copying when it has not changed.snapshotWebcamFrame, next toWebcamFrameSnapshot.main.cpp: only the twocopyLatestFramecalls in the webcam blocks change. The sequence comparison moved into the call.Measured
webcam_snapshot_test, wired into CMake andbuild-windows-wgc-helper.mjs: an unchanged sequence returns false and copies nothing.unchanged sequence reports nothing new,unchanged sequence copies nothing).node scripts/build-windows-wgc-helper.mjs: every target builds, all four native test executables pass.Pending (maintainer, real take)
storeMs/readSampleMsinINFO: Webcam capture loop ended, and the helper's CPU, before and after.🤖 Generated with Claude Code