indi-libcamera: use negotiated stream size for CCD geometry#1344
Open
OLEGsandrMB wants to merge 1 commit into
Open
indi-libcamera: use negotiated stream size for CCD geometry#1344OLEGsandrMB wants to merge 1 commit into
OLEGsandrMB wants to merge 1 commit into
Conversation
Collaborator
|
Thanks! @geoffrey-vl Can you please take a look? |
geoffrey-vl
reviewed
Jul 2, 2026
|
|
||
| config->validate(); | ||
| cam->configure(config.get()); | ||
| // Save the negotiated StillCapture stream size. |
geoffrey-vl
reviewed
Jul 2, 2026
|
|
||
| if (width == 0 || height == 0) | ||
| { | ||
| auto pas = m_ControlList.get(properties::PixelArraySize); |
Contributor
There was a problem hiding this comment.
nit: indentation looks to be of here too
geoffrey-vl
reviewed
Jul 2, 2026
|
|
||
| if (pas) | ||
| { | ||
| width = 2 * (pas->width / 2); |
Contributor
There was a problem hiding this comment.
nit: I'd keep the comment here about rounding down
geoffrey-vl
reviewed
Jul 2, 2026
| int m_LiveVideoWidth {-1}, m_LiveVideoHeight {-1}; | ||
| uint8_t m_CameraIndex; | ||
|
|
||
| uint32_t m_CaptureWidth = 0; |
Contributor
There was a problem hiding this comment.
nit: indentation looks of
geoffrey-vl
reviewed
Jul 2, 2026
| { | ||
| width = 2 * (pas->width / 2); | ||
| height = pas->height; | ||
|
|
Contributor
There was a problem hiding this comment.
nit: I'd remove this empty line
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
Use the negotiated libcamera StillCapture stream size to initialize the INDI CCD geometry instead of
properties::PixelArraySize.Background
While testing an IMX462 camera on Raspberry Pi OS Bookworm (64-bit) with libcamera 0.5.2, I noticed the driver reported a CCD/ROI size of 1944×1097, while libcamera negotiated a 1920×1080 StillCapture stream.
The driver initialized the CCD geometry from
properties::PixelArraySize, which describes the sensor array and may differ from the negotiated capture stream on some cameras.This patch stores the negotiated StillCapture stream dimensions after camera configuration and uses them to initialize the CCD geometry.
If the negotiated stream size is unavailable, the driver falls back to
PixelArraySizeto preserve compatibility.Tested on
Verified using:
rpicam-hello --list-camerasrpicam-stillAfter this change the driver reports:
matching the negotiated libcamera capture stream.
This is my first contribution to the project. If there is a preferred way to implement this or any coding style changes you'd like, I'd be happy to update the patch.