Skip to content

Add screenshot and screen recording APIs for macOS and Windows - #86

Draft
lijy91 wants to merge 1 commit into
mainfrom
codex/screen-capture
Draft

lijy91 wants to merge 1 commit into
mainfrom
codex/screen-capture

Conversation

@lijy91

@lijy91 lijy91 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Add CaptureSource, ScreenCapturer and ScreenRecorder so callers can select a display or window, capture an independent image, and record silent H.264 MP4 files. Implement ScreenCaptureKit/AVAssetWriter on macOS 14+ and Windows Graphics Capture/Media Foundation on Windows 10 version 2004+. Android, iOS, Linux and OpenHarmony expose explicit unsupported stubs.

The shared layer defines source exclusivity, physical-pixel cropping, cursor options, asynchronous recording states and terminal events, bounded frame buffering, cancellation cleanup and publication without overwriting an existing file. Includes the generated C ABI, handle tags, native dependencies and regression/smoke tests.

Validation:

  • Rebuilt the macOS native library and capture tests on the latest main; screen_capture_test passes.
  • Earlier desktop runs on macOS and Windows verified cropped pixels, red/blue frame changes, resize handling, H.264 decoding and the static recording tail. Windows desktop tests have not been rerun after updating the main baseline.
  • Flutter macOS smoke testing successfully captured a 2560 × 1440 image and saved short MP4 recordings.

Draft: source-picker denial/parent destruction, source invalidation, long-running memory behavior, runtime shutdown and complete asynchronous binding coverage remain to be validated. No audio or pause/resume support.

The companion workspace PR libnativeapi/nativeapi#19 contains the spec, generator changes, six bindings and Flutter example. Merge core first; update the workspace gitlink if this PR is squash-merged.

This was referenced Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant