Repository navigation
vcli-capture: Capture trait + macOS ScreenCaptureKit + MockCapture + Windows stub - #7
Merged
Merged
Conversation
Plan deviation: screencapturekit = "1.5.4" used (plan said "0.3" which does not exist on crates.io; latest compatible major version chosen instead). Stub files for permission.rs, mock.rs, macos/, windows/ included to allow compilation; filled out in subsequent tasks.
Plan deviation: screencapturekit v1.5.4 has no util::has_permission. Used extern "C" links to CGPreflightScreenCaptureAccess / CGRequestScreenCaptureAccess from CoreGraphics framework directly (via build.rs rustc-link-lib). Changed #![forbid(unsafe_code)] to #![deny(unsafe_code)] + #[allow(unsafe_code)] on permission module to permit the two extern "C" call sites.
Plan deviation: screencapturekit v1.5.4 API differs from plan's v0.3 assumptions. Key adaptations: - SCContentFilter::create() builder pattern (not direct ctor) - CGRect has flat fields .x/.y/.width/.height (not .origin.x/.size.width) - application_name() returns String directly - window_id() returns u32, converted to u64 via From<u32> - CGDisplayScaleFactor via extern "C" (no display.scale_factor() method) - build.rs adds rpath to Xcode swift-5.5/macosx for libswift_Concurrency.dylib (macOS 26 moved this dylib out of the dyld cache path screencapturekit expects) - assign_window_indices() extracted as pub(crate) for unit testing
Also: refine MacCapture to remove CGDisplayScaleFactor (not in macOS 26 SDK). SCDisplay.width()/height() already report logical pixels, so scale=1.0 is correct. Fix mock.rs unused-import warnings by moving Rect/WindowIndex/DisplayId to the test submodule where they are used. Fix rpath for libswift_Concurrency.dylib (macOS 26 moved it; added Xcode swift-5.5/macosx to rpath in build.rs).
All clippy::pedantic warnings resolved, cargo fmt applied, dyn Capture roundtrip test added to MockCapture test suite. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…li-capture # Conflicts: # Cargo.lock # Cargo.toml
The module-level `use std::env;` was unused on non-macOS targets because `env::args()` is only called from the macOS `run()` function. Under `-D warnings` on Ubuntu this failed the build. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…li-capture # Conflicts: # Cargo.lock # Cargo.toml
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
vcli-capturecrate (plan §v0 scope) across 10 commits covering all 12 plan tasksCapturetrait +WindowDescriptor+DisplayIdscaffold with full# Errors/# PanicsdocsCaptureErrortaxonomy with stablecode()strings (permission_denied,unknown_window,capture_failed,unsupported)MockCapturewith cycling frame sequences, per-window frame maps, and single-shot armed error injection —Send + Sync, tested viadyn CaptureCGPreflightScreenCaptureAccess/CGRequestScreenCaptureAccessFFI + CoreGraphics framework linkMacCapture(ScreenCaptureKitv1.5.4) —enumerate_windows,grab_screen,grab_window; 2 TCC-gated#[ignore]smoke testsWindowsCapturestub returningCaptureError::Unsupportedfor all methodscapture_onceexample binary for manual TCC/SCK verification-D warnings) +cargo fmtcleanDeviations from plan
screencapturekit = "0.3"CGDisplayScaleFactorfor Retina scalecgimage.bgra_bytes()rgba_data()(RGBA);Frame.formatset toRgba8util::has_permission()@rpath/libswift_Concurrency.dylibmissing on macOS 26build.rsrpath pointing to Xcode swift-5.5/macosx; ObjC duplication warnings appear but tests passTest plan
cargo test -p vcli-capture— 26 unit tests pass, 2 integration tests ignoredcargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleancargo test --workspace --locked— cleancargo run --example capture_onceon a macOS machine with TCC permission granted🤖 Generated with Claude Code