Skip to content

Add screen capture bindings, specification, and Flutter example - #19

Draft
lijy91 wants to merge 2 commits into
mainfrom
codex/screen-capture
Draft

lijy91 wants to merge 2 commits into
mainfrom
codex/screen-capture

Conversation

@lijy91

@lijy91 lijy91 commented Oct 31, 2026

Copy link
Copy Markdown
Member

Expose CaptureSource, ScreenCapturer and ScreenRecorder across Dart, Rust, C#, JavaScript, Python and Go, with generated API reference and a Flutter desktop example for source selection, cropped screenshots, PNG saving and silent MP4 recording. Fix screenshot previews to decode the data URI returned by Image.toBase64().

Depends on libnativeapi/nativeapi-core#86. The core gitlink points to published commit ecdf94e9dbd8ddc8f74f43ae7e31154c96da2795. Merge core first; refresh this gitlink if core is squash-merged.

Generator changes support static utility classes, nested value ownership and Rust trait/import requirements. Preserve the C# clipboard formatting already present on main in the generator itself. Update native linking, binding regression tests, the Dart changelog and specs/screen-capture.md.

Validation:

  • ./codegen sync completed, including Rust bindgen and Dart ffigen.
  • ./codegen check passes: 81 C ABI files and 366 binding/reference files; no new skipped APIs.
  • Code generator tests and Flutter example analysis pass.
  • Latest-base macOS core build and screen_capture_test pass.
  • Earlier implementation checks covered Rust/Dart/C#/JS/Python/Go builds or analysis, with Rust/JS/Python/Go ABI tests; native desktop smoke tests passed on macOS and Windows.
  • The macOS Flutter example was run with a successful 2560 × 1440 screenshot and short MP4 recordings. The Windows Flutter example has not yet been run.

Draft / remaining work:

  • Complete the acceptance checklist in specs/screen-capture.md: permission denial, source invalidation, long recordings and asynchronous runtime teardown.
  • Generated options defaults are not consistent with C++; the example supplies fields explicitly.
  • The example's Open folder / Open / Play actions currently fail because UrlOpener accepts HTTP/HTTPS only. Saved PNG/MP4 files can be opened manually using their displayed paths.
  • No audio or pause/resume support. Other core platforms remain unsupported stubs.

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