Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

picamera2: Allow setting of stride #892

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

will-v-pi
Copy link
Collaborator

Allow setting of the stride in stream configuration, and default to 0 if not set to allow libcamera to set the correct stride.

if stream_config.get("stride") is not None:
libcamera_stream_config.stride = stream_config["stride"]
else:
libcamera_stream_config.stride = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would libcamera_stream_config.stride = stream_config.get("stride", 0) be the same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yes, that'll be cleaner, I'll change that and push a new commit

@davidplowman
Copy link
Collaborator

Thanks for this Will - are we happy that is doesn't rely on any other libcamera/libpisp changes? (The tests all pass, so presumably not...)

@will-v-pi
Copy link
Collaborator Author

It does rely on a libpisp and libcamera change, but that's only to get it to actually set the stride, so worth merging it now in anticipation of those changes being merged, as once the libcamera change is merged it'll break picamera2 (because it's accidentally setting an incorrect stride, which is currently ignored but if it's not ignored then it'll break). Without those changes it'll just do nothing when you set the stride, it won't break or anything.

@davidplowman
Copy link
Collaborator

The tests seem to have got very unhappy, do we know what that's about? I can't believe that teeny tweak would have caused it...!

Allow setting of the stride in stream configuration, and default to 0 if
not set to allow libcamera to set the correct stride.

Signed-off-by: William Vinnicombe <[email protected]>
@will-v-pi
Copy link
Collaborator Author

will-v-pi commented Dec 13, 2023

It seems the stream_config sometimes has the stride set to None, so that was causing things to break - I've gone back to the original code which guarded against that case, but added a comment to say why

@davidplowman davidplowman merged commit fb1aa19 into raspberrypi:next Dec 13, 2023
4 checks passed
@will-v-pi will-v-pi deleted the stride-fixes branch December 13, 2023 14:05
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