Skip to content

Match raw capture capabilities to the selected camera - #60

Draft
steveseguin wants to merge 1 commit into
mainfrom
fix/raw-capture-source-identity
Draft

steveseguin wants to merge 1 commit into
mainfrom
fix/raw-capture-source-identity

Conversation

@steveseguin

@steveseguin steveseguin commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Problem

With --raw --v4l2 /dev/v4l/by-id/... (or by-path), capability discovery compares the persistent path literally to the device monitor's /dev/videoN path. It fails to identify the selected camera and borrows the first camera's capabilities instead. With multiple cameras advertising different raw formats, the resulting pipeline can constrain the selected camera to an unsupported format and prevent capture startup.

Change

  • Match canonical resolved device paths, retaining the user's original path in the capture pipeline.
  • Skip monitor entries without a usable device path.
  • If the selected camera is absent from the monitor, return to the existing generic raw negotiation fallback instead of borrowing another camera's caps.
  • Add five focused identity tests to the existing capture-mode module, with by-id/by-path, multi-camera, direct/default, absent path/properties, and unmatched controls.

Verification

  • Executed actual production selection functions with native GStreamer 1.26.2 caps via a thin ctypes adapter: baseline persistent paths selected unrelated I420 and had empty intersection with the chosen YUY2 camera; the fix selects YUY2 with a nonempty intersection. Direct path, reordered devices and explicit-format controls succeed.
  • All five added tests pass through isolated actual-source extraction; baseline has three failed assertions and two missing-properties errors across its subcases. Thirteen existing QA native-caps tests and nine existing device-resolution tests pass.
  • Independent read-only validation reproduced baseline and fix with real temporary relative symlinks, reverse monitor aliases, default/direct/explicit controls, and native caps. It also executed the actual main raw branch: unmatched fallback retains the selected device and leaves source format unconstrained before videoconvert. No material review blockers.
  • Changed files parse with Python 3.9 grammar. Local full application import is blocked by missing gi; Compatibility CI passed at final head d4270b8bcb9b91f193c0ecc3c23a8679e96a27ec: all 155 tests pass on each of Bullseye/Python 3.9/GStreamer 1.18, Bookworm/3.11/1.22, and Trixie/3.13/1.26, including all five new identity tests. This does not establish physical-camera interoperability.

Reviewed against main 4f94ca2dcfced9f67eb72acf4102518cd3ef6674. No physical camera, remote board, external signaling, merge or deployment was used. This verifies identity selection and caps compatibility, not hardware/end-to-end media. Libcamera selection is unchanged. Independent of drafts #57, #58 and #59.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

This branch has not been deployed

No deployments
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