Screen share 5: Windows screen capture backend (#152) #202

Manually merged
charles merged 0 commits from screenshare-5-capture-windows into screenshare 2026-11-12 05:57:03 +00:00
Owner

What

DesktopScreenCapturer for Windows (spec §7.1) on libwebrtc's DesktopCapturer, in crates/fluxer-capture/src/desktop.rs:

  • WGC screen and window capture; libwebrtc falls back to DXGI/GDI by itself. Cursor included.
  • list_sources: screens ("Screen 1", ..., id screen:<n>) then other processes' windows (id window:<HWND>) with titles, owning pid (GetWindowThreadProcessId) and app_name (executable name). Untitled windows and this process's own windows are left out. Thumbnails: one frame per source, at most 480x270, four sources at a time.
  • One capture thread per session: pacing (Pacer), crop to even dimensions, area downscale to the target, BGRA to I420 (fluxer-video), Started with the first frame, Stalled/Resumed (StallDetector), permanent error = Ended(SourceClosed), switch/update on the fly, synchronous start errors, stop/drop drop the sink.
  • default_backends() returns it on Windows (or Unsupported with the reason when libwebrtc cannot create a screen capturer). capabilities(): in-app picker yes, window_audio false (Screen share 15's call).
  • Spike findings: docs/superpowers/research/2026-11-11-screenshare-spikes.md section 3.

How it was tested

  • The session machine is OS-neutral and unit tested on every OS with scripted grabbers (15 tests in desktop.rs: pacing, size/even crop, conversion, Started-first, Ended once, error-then-Ended, switch, update, sync start errors, thumbnails, drop).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green on Linux.
  • The Windows cfg code was type-checked and linted on Linux: cargo clippy --target x86_64-pc-windows-msvc -p fluxer-capture --all-targets -- -D warnings (with DOCS_RS=1 and stub C compilers, so not linked). The Windows runner is its first real build.
  • tests/windows_real.rs: server_core_reports_unsupported_or_lists_nothing_without_panicking runs on Windows CI. screen_capture_delivers_frames, window_list_has_titles_and_pids_and_excludes_self, closing_captured_window_reports_ended are #[ignore] + FLUXER_CAPTURE_TESTS=1: not run, no Windows desktop was available to the implementer.

Deviations

  • Task 4 is not merged, so desktop.rs holds the Windows part plus an OS-neutral session machine (Grabber/Opener/Lister) that Task 4 can reuse; the module is #[cfg(any(windows, test))]. Integrator merge is mechanical.
  • Touched src/lib.rs (module, export, default_backends) and tests/fake.rs (unsupported_backends_return_errors now tests the Unsupported stub directly, since Windows has a real screen backend).
  • New deps, Windows only: libwebrtc 0.4.0 (already in the graph via livekit) and windows 0.62 (already in the graph; features Win32_Foundation, Win32_System_Threading, Win32_UI_WindowsAndMessaging). Both added to the workspace; Task 4 and 15 extend them.
  • Spike answers on the WGC border, minimise/resize, Server Core and CPU are from the SDK source and prebuilt headers, marked unverified in section 3; no fallback built. Verification on a real Windows 10/11 desktop: follow-up #204.

Stacked on: screenshare-3-capture-crate

Closes #152

🤖 Generated with Claude Code

## What `DesktopScreenCapturer` for Windows (spec §7.1) on libwebrtc's `DesktopCapturer`, in `crates/fluxer-capture/src/desktop.rs`: - WGC screen and window capture; libwebrtc falls back to DXGI/GDI by itself. Cursor included. - `list_sources`: screens ("Screen 1", ..., id `screen:<n>`) then other processes' windows (id `window:<HWND>`) with titles, owning `pid` (`GetWindowThreadProcessId`) and `app_name` (executable name). Untitled windows and this process's own windows are left out. Thumbnails: one frame per source, at most 480x270, four sources at a time. - One capture thread per session: pacing (`Pacer`), crop to even dimensions, area downscale to the target, BGRA to I420 (`fluxer-video`), `Started` with the first frame, `Stalled`/`Resumed` (`StallDetector`), permanent error = `Ended(SourceClosed)`, `switch`/`update` on the fly, synchronous `start` errors, stop/drop drop the sink. - `default_backends()` returns it on Windows (or `Unsupported` with the reason when libwebrtc cannot create a screen capturer). `capabilities()`: in-app picker yes, `window_audio` false (Screen share 15's call). - Spike findings: `docs/superpowers/research/2026-11-11-screenshare-spikes.md` section 3. ## How it was tested - The session machine is OS-neutral and unit tested on every OS with scripted grabbers (15 tests in `desktop.rs`: pacing, size/even crop, conversion, Started-first, Ended once, error-then-Ended, switch, update, sync start errors, thumbnails, drop). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green on Linux. - The Windows `cfg` code was type-checked and linted on Linux: `cargo clippy --target x86_64-pc-windows-msvc -p fluxer-capture --all-targets -- -D warnings` (with `DOCS_RS=1` and stub C compilers, so not linked). The Windows runner is its first real build. - `tests/windows_real.rs`: `server_core_reports_unsupported_or_lists_nothing_without_panicking` runs on Windows CI. `screen_capture_delivers_frames`, `window_list_has_titles_and_pids_and_excludes_self`, `closing_captured_window_reports_ended` are `#[ignore]` + `FLUXER_CAPTURE_TESTS=1`: **not run, no Windows desktop was available** to the implementer. ## Deviations - Task 4 is not merged, so `desktop.rs` holds the Windows part plus an OS-neutral session machine (`Grabber`/`Opener`/`Lister`) that Task 4 can reuse; the module is `#[cfg(any(windows, test))]`. Integrator merge is mechanical. - Touched `src/lib.rs` (module, export, `default_backends`) and `tests/fake.rs` (`unsupported_backends_return_errors` now tests the `Unsupported` stub directly, since Windows has a real screen backend). - New deps, Windows only: `libwebrtc` 0.4.0 (already in the graph via `livekit`) and `windows` 0.62 (already in the graph; features `Win32_Foundation`, `Win32_System_Threading`, `Win32_UI_WindowsAndMessaging`). Both added to the workspace; Task 4 and 15 extend them. - Spike answers on the WGC border, minimise/resize, Server Core and CPU are from the SDK source and prebuilt headers, marked unverified in section 3; no fallback built. Verification on a real Windows 10/11 desktop: follow-up #204. Stacked on: screenshare-3-capture-crate Closes #152 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(video): frames, conversions, frame bus, test pattern and preview JPEG
All checks were successful
ci / Linux (x86_64) (push) Successful in 15m16s
ci / Windows (x64) (push) Successful in 16m21s
8b8a359082
Refs #148

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(capture): capture traits and fake backends
All checks were successful
ci / Windows (x64) (push) Successful in 16m9s
ci / Linux (x86_64) (push) Successful in 35m35s
d821f19097
Refs #150

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(capture): Windows screen capture
Some checks failed
ci / Windows (x64) (push) Has been cancelled
ci / Linux (x86_64) (push) Has been cancelled
8fd5f3b5da
DesktopScreenCapturer on libwebrtc's DesktopCapturer (WGC, DXGI/GDI as
libwebrtc chooses): screen and window lists with titles, owner pids,
app names and 480x270 thumbnails, own windows excluded, cursor included;
one capture thread per session pacing, cropping to even sizes, scaling
and converting BGRA to I420. default_backends() returns it on Windows.
The OS-neutral session machine is unit tested on every OS; real-device
tests in tests/windows_real.rs. Spike findings in spikes section 3.

Refs #152

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Independent review: Screen share 5 (Windows screen capture), commit 8fd5f3b

Scope: git diff d821f19..origin/screenshare-5-capture-windows. Local gate: FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh worktree FAILED at the test step (details in finding 1). fmt, clippy, deny, core isolation and parity passed before it.

Blocking

  1. [blocking] crates/fluxer-capture/src/desktop.rs: start() right after Ended can return AlreadyStarted; closed_window_reports_ended_once is flaky and turned CI red. capture_loop drops the sink when it returns, so Ended arrives and the receiver disconnects before the OS thread has exited. reap() checks JoinHandle::is_finished(), which is still false in that window, so the next start() sees the old session and returns CaptureError::AlreadyStarted. Local result: panicked at desktop.rs:887: a new session after Ended: AlreadyStarted; reran that test 20 times and it failed 2 of them. This is also a real contract bug, not only a test race: the runtime (Screen share 21) restarts as soon as it gets Ended (a window closed, then the user picks another source), and it would get a spurious AlreadyStarted. Fix suggestion: have the session record that it has finished before the final sink call/drop (e.g. an Arc<AtomicBool> set at the end of capture_loop, or a "done" message) and make reap() join when that flag is set; or have start() join an existing session whose command channel is disconnected. Then make the test deterministic.

Minor

  1. [minor] tests/windows_real.rs server_core_reports_unsupported_or_lists_nothing_without_panicking: when new() succeeds, the test expects start(Source("window:0")) to return SourceNotFound. But win::open first creates a window capturer and returns CaptureError::Backend if libwebrtc can't create one. On Server Core the screen probe could succeed while the window capturer fails, and this test would then fail on the Windows runner. Consider accepting SourceNotFound | Backend | Unsupported there, or returning SourceNotFound for an unparseable or unknown id before the capturer is created. The Windows runner's result for this PR decides this one. I did not poll CI.
  2. [minor] The 10 s first-frame timeout path is untested. source_that_never_delivers_reports_error_then_ended uses window:3, which returns Permanent straight away, so it covers the "fails before first frame" branch and not the Temporary-for-10 s branch (FIRST_FRAME_TIMEOUT). There is also no unit test of Stalled/Resumed through this session machine (the fake covers the contract). The constant is pub(crate), so the tests could inject a short timeout.
  3. [minor] pacing_holds_target_fps (16..=22 frames in a wall-clock second) depends on timing and could flake on a loaded runner. It passed here.
  4. [minor] Spikes §3 is all unverified (no Windows desktop). That is acceptable under the plan ("otherwise say so and keep them #[ignore]"), but it should become a follow-up issue (run the real tests on Windows 10/11, settle the border, minimise and CPU questions) linked from the PR before merge.

Checked and OK

  • Plan tests: CI server_core_reports_unsupported_or_lists_nothing_without_panicking, and real screen_capture_delivers_frames, window_list_has_titles_and_pids_and_excludes_self, closing_captured_window_reports_ended all exist, #[ignore] + FLUXER_CAPTURE_TESTS=1, and assert what the plan says. Thumbnails are ≤ 480×270 (THUMBNAIL_WIDTH/HEIGHT).
  • Interfaces: DesktopScreenCapturer: ScreenCapturer exported on Windows; WGC (DXGI/GDI picked by libwebrtc); Screen/Window lists with titles, owner pid, app_name; own process's windows left out (list and open); set_include_cursor(true); default_backends() returns it on Windows and falls back to Unsupported without panicking.
  • Invariants: fluxer-capture gains libwebrtc 0.4.0 (single version in Cargo.lock, the one livekit pins) and windows 0.62, Windows-only. No fluxer-core/livekit dep. libwebrtc types are confined to desktop.rs::win and appear in no public signature. Frame copy validates width/height/stride/length, so a bad frame is Temporary and never a panic. No secrets.
  • cfg(any(windows, test)) module + the Task 4 merge note: mechanical, as the plan allows.

Verdict: changes requested. One blocking finding (1): the reap race makes CI flaky and gives a real AlreadyStarted after Ended.

## Independent review: Screen share 5 (Windows screen capture), commit 8fd5f3b Scope: `git diff d821f19..origin/screenshare-5-capture-windows`. Local gate: `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh worktree **FAILED** at the `test` step (details in finding 1). fmt, clippy, deny, core isolation and parity passed before it. ### Blocking 1. **[blocking] `crates/fluxer-capture/src/desktop.rs`: `start()` right after `Ended` can return `AlreadyStarted`; `closed_window_reports_ended_once` is flaky and turned CI red.** `capture_loop` drops the sink when it returns, so `Ended` arrives and the receiver disconnects *before* the OS thread has exited. `reap()` checks `JoinHandle::is_finished()`, which is still false in that window, so the next `start()` sees the old session and returns `CaptureError::AlreadyStarted`. Local result: `panicked at desktop.rs:887: a new session after Ended: AlreadyStarted`; reran that test 20 times and it failed 2 of them. This is also a real contract bug, not only a test race: the runtime (Screen share 21) restarts as soon as it gets `Ended` (a window closed, then the user picks another source), and it would get a spurious `AlreadyStarted`. Fix suggestion: have the session record that it has finished before the final sink call/drop (e.g. an `Arc<AtomicBool>` set at the end of `capture_loop`, or a "done" message) and make `reap()` join when that flag is set; or have `start()` join an existing session whose command channel is disconnected. Then make the test deterministic. ### Minor 2. **[minor] `tests/windows_real.rs` `server_core_reports_unsupported_or_lists_nothing_without_panicking`**: when `new()` succeeds, the test expects `start(Source("window:0"))` to return `SourceNotFound`. But `win::open` first creates a *window* capturer and returns `CaptureError::Backend` if libwebrtc can't create one. On Server Core the screen probe could succeed while the window capturer fails, and this test would then fail on the Windows runner. Consider accepting `SourceNotFound | Backend | Unsupported` there, or returning `SourceNotFound` for an unparseable or unknown id before the capturer is created. The Windows runner's result for this PR decides this one. I did not poll CI. 3. **[minor] The 10 s first-frame timeout path is untested.** `source_that_never_delivers_reports_error_then_ended` uses `window:3`, which returns `Permanent` straight away, so it covers the "fails before first frame" branch and not the `Temporary`-for-10 s branch (`FIRST_FRAME_TIMEOUT`). There is also no unit test of `Stalled`/`Resumed` through this session machine (the fake covers the contract). The constant is `pub(crate)`, so the tests could inject a short timeout. 4. **[minor] `pacing_holds_target_fps` (16..=22 frames in a wall-clock second)** depends on timing and could flake on a loaded runner. It passed here. 5. **[minor] Spikes §3** is all *unverified* (no Windows desktop). That is acceptable under the plan ("otherwise say so and keep them `#[ignore]`"), but it should become a `follow-up` issue (run the real tests on Windows 10/11, settle the border, minimise and CPU questions) linked from the PR before merge. ### Checked and OK - Plan tests: CI `server_core_reports_unsupported_or_lists_nothing_without_panicking`, and real `screen_capture_delivers_frames`, `window_list_has_titles_and_pids_and_excludes_self`, `closing_captured_window_reports_ended` all exist, `#[ignore]` + `FLUXER_CAPTURE_TESTS=1`, and assert what the plan says. Thumbnails are ≤ 480×270 (`THUMBNAIL_WIDTH`/`HEIGHT`). - Interfaces: `DesktopScreenCapturer: ScreenCapturer` exported on Windows; WGC (DXGI/GDI picked by libwebrtc); `Screen`/`Window` lists with titles, owner `pid`, `app_name`; own process's windows left out (list and `open`); `set_include_cursor(true)`; `default_backends()` returns it on Windows and falls back to `Unsupported` without panicking. - Invariants: `fluxer-capture` gains `libwebrtc` 0.4.0 (single version in `Cargo.lock`, the one `livekit` pins) and `windows` 0.62, Windows-only. No `fluxer-core`/`livekit` dep. libwebrtc types are confined to `desktop.rs::win` and appear in no public signature. Frame copy validates width/height/stride/length, so a bad frame is `Temporary` and never a panic. No secrets. - `cfg(any(windows, test))` module + the Task 4 merge note: mechanical, as the plan allows. **Verdict: changes requested.** One blocking finding (1): the reap race makes CI flaky and gives a real `AlreadyStarted` after `Ended`.
fix(capture): a session that sent Ended can be restarted at once
All checks were successful
ci / Linux (x86_64) (push) Successful in 36m45s
ci / Windows (x64) (push) Successful in 15m17s
9214c9248a
reap() only forgot a session whose thread had finished, but the thread
delivers Ended (and drops the sink) before it exits, so start() right
after Ended could return AlreadyStarted. The thread now sets an `ended`
flag before the final sink call and reap() joins such a session.

Also from review: first-frame and stall timeouts are configurable on the
session machine, with tests of the first-frame timeout and of
Stalled/Resumed; the pacing test bounds frames by the measured elapsed
time; the Server Core test accepts Backend/Unsupported for an unknown
window; spikes section 3 points at follow-up #204.

Refs #152
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Owner

Review round 1 addressed in 9214c92:

  • blocking, reap() race (desktop.rs): fixed. The capture thread sets an ended: AtomicBool (Release) before its final Ended sink call; reap() treats a session as over when that flag is set or the thread is finished, and joins it (which only waits for the sink call to return and the sink to drop). New test start_right_after_ended_is_not_already_started reproduces the race deterministically (a sink whose drop sleeps 200 ms); it failed before the fix and passes after. 15 back-to-back reruns of the desktop tests were green.
  • minor, Server Core window:0 expectation (windows_real.rs): the test now accepts SourceNotFound, Backend or Unsupported there, with the reason in a comment.
  • minor, no FIRST_FRAME_TIMEOUT / Stalled-Resumed test: the session machine takes Timeouts { first_frame, stall } (defaults FIRST_FRAME_TIMEOUT and STALL_AFTER; the tests shorten them). New tests source_that_never_starts_times_out_with_error_then_ended (a source that only returns Temporary) and stalled_source_reports_stalled_then_resumed_before_its_next_frame (checks Started, Frame, Stalled, Resumed, Frame in that order).
  • minor, timing-dependent pacing test: pacing_holds_target_fps now measures the elapsed time and asserts at most elapsed x 20 + 2 frames (pacing never overshoots) and at least half of elapsed x 20 (a loaded runner may deliver fewer).
  • minor, spikes section 3 unverified on Windows: follow-up #204 opened (run the ignored real tests on Windows 10/11 and settle border, minimise/resize, CPU and pixel format). It is linked from the PR body and from spikes section 3.

FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci is green locally. The Windows cfg code was re-checked with cargo clippy --target x86_64-pc-windows-msvc -p fluxer-capture --all-targets -- -D warnings, which passes.

Review round 1 addressed in 9214c92: - **blocking, reap() race (`desktop.rs`)**: fixed. The capture thread sets an `ended: AtomicBool` (Release) before its final `Ended` sink call; `reap()` treats a session as over when that flag is set or the thread is finished, and joins it (which only waits for the sink call to return and the sink to drop). New test `start_right_after_ended_is_not_already_started` reproduces the race deterministically (a sink whose drop sleeps 200 ms); it failed before the fix and passes after. 15 back-to-back reruns of the `desktop` tests were green. - **minor, Server Core `window:0` expectation (`windows_real.rs`)**: the test now accepts `SourceNotFound`, `Backend` or `Unsupported` there, with the reason in a comment. - **minor, no FIRST_FRAME_TIMEOUT / Stalled-Resumed test**: the session machine takes `Timeouts { first_frame, stall }` (defaults `FIRST_FRAME_TIMEOUT` and `STALL_AFTER`; the tests shorten them). New tests `source_that_never_starts_times_out_with_error_then_ended` (a source that only returns Temporary) and `stalled_source_reports_stalled_then_resumed_before_its_next_frame` (checks Started, Frame, Stalled, Resumed, Frame in that order). - **minor, timing-dependent pacing test**: `pacing_holds_target_fps` now measures the elapsed time and asserts at most `elapsed x 20 + 2` frames (pacing never overshoots) and at least half of `elapsed x 20` (a loaded runner may deliver fewer). - **minor, spikes section 3 unverified on Windows**: follow-up #204 opened (run the ignored real tests on Windows 10/11 and settle border, minimise/resize, CPU and pixel format). It is linked from the PR body and from spikes section 3. `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` is green locally. The Windows `cfg` code was re-checked with `cargo clippy --target x86_64-pc-windows-msvc -p fluxer-capture --all-targets -- -D warnings`, which passes.
Author
Owner

Independent review: Screen share 5 (Windows capture), head 9214c92

Scope: git diff d821f19..origin/screenshare-5-capture-windows. I read the code without relying on the implementer's notes.

Plan tests. All four named tests are in tests/windows_real.rs. server_core_reports_unsupported_or_lists_nothing_without_panicking runs on Windows CI. The three real-device tests are #[ignore] and also need FLUXER_CAPTURE_TESTS=1, which the plan allows because no Windows desktop was available. They assert what the plan asks: titles, pids, exclusion of this process, Ended(SourceClosed) when the window closes, non-black frames, and thumbnails no larger than 480x270. The unit tests of the session machine cover the spec values: STALL_AFTER = 3 s, thumbnails at 480x270, and cursor on.

Interfaces. These match the plan:

  • DesktopScreenCapturer: ScreenCapturer is public, with new() -> Result<Self, CaptureError> on Windows.
  • default_backends() returns it on Windows and falls back to Unsupported when it cannot be created.
  • The Screen/Window lists carry the title, the owning pid and app_name. This process's windows are filtered out by the SDK and again by pid. in_app_picker: true.

Invariants.

  • fluxer-capture depends on neither fluxer-core nor livekit.
  • libwebrtc and windows are Windows-only target dependencies, and their types stay in src/desktop.rs (private win module).
  • No public signature carries a libwebrtc type.
  • Frame copies check width, height, stride and data length before slicing (stride is u32).
  • There are no secrets.

Review Focus. None of the items belongs to Task 5.

The reap() race fix. Verified. ended is stored (Release) before the final Ended sink call, and reap() loads it with Acquire. start_right_after_ended_is_not_already_started covers it with a sink that is slow to drop.

Local CI. FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci passed: "all steps passed", and the 16 desktop::tests passed. The first run failed with a transient cargo dep-info I/O error ("could not parse/generate dep info … tempfile-*.d"). It is unrelated to this change, and a clean rerun was green.

Findings

  1. minor: capture_loop, Grab::Frame arm. When fit_to_target returns None (for example a 1x1 window, or a frame shorter than its stride claims), the loop does continue before the first-frame timeout and the stall poll. A source that only ever delivers such frames never sends Started, Error or Ended; the session stays silent until stop. Suggested fix: treat a frame that cannot be used like Grab::Temporary, so it falls through to the timeout and stall logic.
  2. minor: the Windows cfg code has only been type-checked (clippy with stub C compilers). It has not been linked or run anywhere yet. The Windows runner is its first real build, and the real-device facts in spikes section 3 are unverified. #204 tracks this, which is right; the integrator should confirm that the Windows runner is green before merging.
  3. minor: docs/superpowers/research/2026-11-11-screenshare-spikes.md is created as a new file here, and Screen share 4 (section 2) will most likely create it too. That is a mechanical merge conflict, so keep the sections in number order when merging.

Verdict: APPROVED (no blocking findings; local CI green).

## Independent review: Screen share 5 (Windows capture), head 9214c92 Scope: `git diff d821f19..origin/screenshare-5-capture-windows`. I read the code without relying on the implementer's notes. **Plan tests.** All four named tests are in `tests/windows_real.rs`. `server_core_reports_unsupported_or_lists_nothing_without_panicking` runs on Windows CI. The three real-device tests are `#[ignore]` and also need `FLUXER_CAPTURE_TESTS=1`, which the plan allows because no Windows desktop was available. They assert what the plan asks: titles, pids, exclusion of this process, `Ended(SourceClosed)` when the window closes, non-black frames, and thumbnails no larger than 480x270. The unit tests of the session machine cover the spec values: `STALL_AFTER` = 3 s, thumbnails at 480x270, and cursor on. **Interfaces.** These match the plan: - `DesktopScreenCapturer: ScreenCapturer` is public, with `new() -> Result<Self, CaptureError>` on Windows. - `default_backends()` returns it on Windows and falls back to `Unsupported` when it cannot be created. - The `Screen`/`Window` lists carry the title, the owning `pid` and `app_name`. This process's windows are filtered out by the SDK and again by pid. `in_app_picker: true`. **Invariants.** - `fluxer-capture` depends on neither `fluxer-core` nor `livekit`. - `libwebrtc` and `windows` are Windows-only target dependencies, and their types stay in `src/desktop.rs` (private `win` module). - No public signature carries a libwebrtc type. - Frame copies check width, height, stride and data length before slicing (stride is `u32`). - There are no secrets. **Review Focus.** None of the items belongs to Task 5. **The reap() race fix.** Verified. `ended` is stored (Release) before the final `Ended` sink call, and `reap()` loads it with Acquire. `start_right_after_ended_is_not_already_started` covers it with a sink that is slow to drop. **Local CI.** `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` passed: "all steps passed", and the 16 `desktop::tests` passed. The first run failed with a transient cargo dep-info I/O error ("could not parse/generate dep info … tempfile-*.d"). It is unrelated to this change, and a clean rerun was green. ### Findings 1. **minor**: `capture_loop`, `Grab::Frame` arm. When `fit_to_target` returns `None` (for example a 1x1 window, or a frame shorter than its stride claims), the loop does `continue` before the first-frame timeout and the stall poll. A source that only ever delivers such frames never sends `Started`, `Error` or `Ended`; the session stays silent until `stop`. Suggested fix: treat a frame that cannot be used like `Grab::Temporary`, so it falls through to the timeout and stall logic. 2. **minor**: the Windows `cfg` code has only been type-checked (clippy with stub C compilers). It has not been linked or run anywhere yet. The Windows runner is its first real build, and the real-device facts in spikes section 3 are unverified. #204 tracks this, which is right; the integrator should confirm that the Windows runner is green before merging. 3. **minor**: `docs/superpowers/research/2026-11-11-screenshare-spikes.md` is created as a new file here, and Screen share 4 (section 2) will most likely create it too. That is a mechanical merge conflict, so keep the sections in number order when merging. **Verdict: APPROVED** (no blocking findings; local CI green).
charles manually merged commit 61a073cefa into screenshare 2026-11-12 05:57:03 +00:00
Sign in to join this conversation.
No description provided.