Skip to content

fix: stop repeated Windows camera resource allocation - #2248

Merged
richiemcilroy merged 2 commits into
codex/desktop-release-readinessfrom
fix/windows-camera-idle-resources
Sep 8, 2026
Merged

fix: stop repeated Windows camera resource allocation#2248
richiemcilroy merged 2 commits into
codex/desktop-release-readinessfrom
fix/windows-camera-idle-resources

Conversation

@richiemcilroy

@richiemcilroy richiemcilroy commented Sep 8, 2026

Copy link
Copy Markdown
Member

GPUI's camera picker refreshes every two seconds. Each refresh previously reopened every camera to inspect its formats, reintroducing the native resource pressure behind #2214 even after the identity-enumeration fix in #2143. This follow-up to #2219 reuses capability metadata for unchanged connected cameras and queries new devices after an observed reconnect. Failed probes are retried explicitly from the format chooser; Automatic stays available, and a late background result cannot erase a successful retry. Delayed query results also validate the full device identity before updating capabilities or displaying choices.

Format-only Windows queries now retire their temporary Media Foundation sources after collecting formats. Capture ownership and asynchronous stop behavior remain unchanged. Debug formatting no longer opens cameras. The existing leak example also covers MF/DirectShow format probes and rejects runs without a usable camera.

Validation: 19 focused GPUI tests passed; root and GPUI formatting, scoped camera checks/Clippy on macOS, GPUI test compilation, and compilation of the isolated PR snapshot passed. A Windows cross-check on macOS stopped in ring because Windows SDK headers are unavailable. Native Windows handle/thread/private-memory soaks, capture after format-query shutdown, and camera reconnect/permission tests are still required before release.

Stacked on #2219 so this PR contains only the five-file amendment. Related to #2214; not a claim of completed Windows release validation.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; the asynchronous capability result now validates the full camera identity and no new actionable defect was identified.

Summary

  • Reuses format metadata only when the full camera identity remains unchanged.
  • Retries failed capability probes when the format chooser is opened while retaining Automatic mode.
  • Rejects delayed capability results after the selected camera changes or disconnects.
  • Extends the Windows enumeration leak utility to exercise Media Foundation and DirectShow format probing.

@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

Comment thread apps/desktop-gpui/src/main_window.rs Outdated
@richiemcilroy

Copy link
Copy Markdown
Member Author

hey @greptileai, please re-review the PR

@richiemcilroy
richiemcilroy merged commit 5cccfae into codex/desktop-release-readiness Sep 8, 2026
18 of 20 checks passed
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