Skip to content

Fix v4l2_format alignment on 64-bit Linux - #2

Open
trendcafemedia wants to merge 1 commit into
Romonaga:mainfrom
trendcafemedia:fix/v4l2-format-alignment
Open

trendcafemedia wants to merge 1 commit into
Romonaga:mainfrom
trendcafemedia:fix/v4l2-format-alignment

Conversation

@trendcafemedia

Copy link
Copy Markdown

Resolution selection wasn't working correctly with my EMEET Pixy
on Pop!_OS 24.04. Captured dimensions differed from the requested
format, and format readback returned invalid values.

The backend was reading and writing the v4l2_format union at byte 4.
Checking the layout against the Linux headers on my system showed
that the union starts at byte 8 on 64-bit Linux.

This updates the packing and readback offsets and adds regression
tests for the structure layout.

Tested with all 98 backend tests passing, plus real 1080p and 4K
MJPEG capture on the camera with the expected dimensions.

The format union starts at byte 8, but the backend packed and
read it at byte 4. This caused incorrect capture dimensions
and garbled format readback.

Correct the offset and add regression coverage for the layout.
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