Fix v4l2_format alignment on 64-bit Linux - #2
Open
trendcafemedia wants to merge 1 commit into
Open
trendcafemedia wants to merge 1 commit into
trendcafemedia wants to merge 1 commit into
Conversation
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.
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.
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.