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

Typo in Linux device enumeration #126

Closed
gplwhite opened this issue Jan 8, 2024 · 3 comments
Closed

Typo in Linux device enumeration #126

gplwhite opened this issue Jan 8, 2024 · 3 comments

Comments

@gplwhite
Copy link
Contributor

gplwhite commented Jan 8, 2024

Hello,

I think there are a couple of mistakes in the enumeration of devices on Linux. There appear to be two places where each DefactoryStandardResolution frame width is incorrectly compared to the enumerated frame max_height - instead of the frame max_width.

r.Width <= stepwise.max_height &&

and
r.Width <= stepwise.max_height &&

@gplwhite
Copy link
Contributor Author

gplwhite commented Jan 9, 2024

I think there is a second issue with the filtering of the DefactoStandardResolutions.

The following lines don't seem to take operator precedence into account correctly. The modulo division has a higher order of precedence than the subtraction meaning it will happen before the subtraction. I think there should be parenthesis around the subtraction to ensure it occurs before the modulo division.

(r.Width - stepwise.min_width % stepwise.step_width) == 0 &&

and

(r.Height - stepwise.min_height % stepwise.step_height) == 0).

Currently I believe this will result in no characteristics being returned for devices that report a Stepwise frame size capability

(specifically this issue along with #127 seems to be stopping my Raspberry PI onboard camera from being enumerated successfully)

@kekyo
Copy link
Owner

kekyo commented Jan 10, 2024

@gplwhite I will review it in a couple of days, just wait and see.

@kekyo
Copy link
Owner

kekyo commented Jan 15, 2024

Merged, thanks!

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

No branches or pull requests

2 participants