Skip to content

Use cypherstack/camera-linux, replacing OpenCV with V4L2 - #1504

Merged
julian-CStack merged 4 commits into
stagingfrom
feat/camera-linux-hook
Nov 6, 2026
Merged

julian-CStack merged 4 commits into
stagingfrom
feat/camera-linux-hook

Conversation

@sneurlax

@sneurlax sneurlax commented Nov 6, 2026

Copy link
Copy Markdown
Member

No description provided.

camera_linux is now a Linux implementation of the camera federated plugin
(sneurlax/camera-linux branch feat/native-assets-v4l2, to move to
cypherstack/camera-linux once merged): a Dart build hook compiles a V4L2
capture library at app build time, and CameraLinux registers itself as the
camera platform through the Dart plugin registrant. The resulting
libcamera_linux.so depends on libc only and is installed into bundle/lib by
the native-assets step the Linux CMake template already has, the same path
the Epic, MWC and Tor hooks use.

That makes OpenCV unnecessary: the CI image and the build docs no longer
install libopencv-dev, and no flatpak module, static OpenCV build or CMake
bundling step is needed.

The desktop QR scanner dialog now drives Linux through the same camera
platform interface code as Windows. On Linux it reads frames from the
plugin's image stream (JPEG, no temp files) and asks for the medium preset,
which is 640x480 there; "low" would be 320x240, too small for QR codes.
camera_macos exports its own CameraImageData, so that name is hidden from
its import.
The V4L2 camera_linux opens /dev/video* directly, and --device=dri does not
expose those nodes in the sandbox. Use --device=all.
@sneurlax
sneurlax force-pushed the feat/camera-linux-hook branch from fcdf7c3 to 3f81beb Compare November 6, 2026 17:43
@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.92%. Comparing base (945b09e) to head (9ce80be).
⚠️ Report is 1 commits behind head on staging.

Files with missing lines Patch % Lines
lib/widgets/desktop/qr_code_scanner_dialog.dart 0.00% 37 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #1504      +/-   ##
===========================================
- Coverage    13.92%   13.92%   -0.01%     
===========================================
  Files         1139     1139              
  Lines       114695   114707      +12     
===========================================
  Hits         15976    15976              
- Misses       98719    98731      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

camera_linux reports a capture failure on the frame stream as well as
through onCameraError. The frame listener had no error handler, so the
camera-lost message showed but the exception also escaped as an uncaught
asynchronous error. Route it through _onCameraLost, which ignores the
second report.
@julian-CStack
julian-CStack merged commit d29d84c into staging Nov 6, 2026
3 of 4 checks passed
@julian-CStack
julian-CStack deleted the feat/camera-linux-hook branch November 6, 2026 19:01
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.

2 participants