fix(meta_quest_camera): restore adapter on main + decode preview with Pillow - #13
Merged
Conversation
The auto WiFi switch (networksetup) is unreliable on macOS without
Location Services granted to the Python interpreter — a permission
the user can't easily grant on a vanilla "uv run python ..." setup.
The Insta360 iOS app does it via signed-app entitlements; we don't
have that luxury.
Reframe the workflow around what actually works in production:
the user clicks the camera SSID once in the macOS WiFi menu (no
permission needed — it's a user-initiated action), then clicks
Collect Videos. We now detect this case and short-circuit:
- On run() entry, read current_ssid().
- If it case-insensitively matches camera.wifi_ssid, log
"already on camera AP — skipping WiFi switch" and jump straight
to the probe + download steps.
- In the finally block, skip restore too — yanking the user off a
network they manually joined would be hostile. Restoring is now
only done when WE switched the WiFi.
CollectResultBanner now hints at this workflow:
"For best results, connect your Mac to GO 3S xxxxxx.OSC (password
88888888) from the macOS WiFi menu first — that lets us skip the
auto-switch (which often fails without Location permission)."
50 tests pass. Frontend has a pre-existing pointLight type error in
quest3-pose-panel.tsx (user's in-progress Quest3 work) that prevents
yarn build from emitting; my TS changes are syntactically correct
and will ship once that unrelated build issue is resolved.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
User report: viewer was spamming health events like
[left] mjpeg error: No module named 'cv2'
every frame because MjpegPreviewConsumer._decode_jpeg imported
OpenCV, which isn't a dependency of any syncfield extra — users on
``pip install "syncfield[viewer,camera]"`` had no way to get it
short of adding opencv-python themselves.
Pillow is already required by ``syncfield[viewer]`` (the viewer
server re-encodes video frames through PIL to serve MJPEG), so
switching the decoder to Pillow means a stock viewer install now
renders the Quest stereo preview out of the box with no extra deps.
Output convention is unchanged: still a BGR numpy.ndarray, matching
OakCameraStream / UVCWebcamStream and what the viewer server
expects. Lazy import preserved so tests that pass
``decode_jpeg=False`` still run on hosts without Pillow.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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
Two fixes rolled into one PR, both blocking `examples/meta_quest/record.py`:
1. `MetaQuestCameraStream` was never on `main`
PR #10 merged the camera adapter into `feat/metaquest-clock-domain-health-events` (its PR base), not `main`. When that base branch was deleted, the camera adapter went with it.
Restored from the PR #10 merge commit (`3773a68`):
27 unit + helper tests pass.
2. Preview decoder was importing cv2 which isn't a dep
User saw these every frame after connecting Quest:
```
[left] mjpeg error: No module named 'cv2'
```
Switched `MjpegPreviewConsumer._decode_jpeg` from OpenCV to Pillow. Pillow is already in `syncfield[viewer]`, so stock install now works. BGR output convention unchanged.
Test Plan
🤖 Generated with Claude Code