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

Expanded support for Libcamera Controls (ControlInfoMap and ControlInfo) #46

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

SoZ0
Copy link

@SoZ0 SoZ0 commented Dec 8, 2024

I believe i have implemented the rest of ControlInfoMap and ControlInfo and created a few methods to turn it into an iterator.

I have tested on my host machine (Libcamera 0.3.1, Fedora 40 - x86) and with cross compiling to arm64 (Libcamera 0.3.2, Debian Bookworm). The code works on both x86 and arm64 (tested with a compute module 4).

  • Exposed the methods to get the name, id and type from the ControlID type directly but they have not been implemented rust side.
  • Exposed a few of the methods to interact with ControlIdMap and plan to give it the same treatment as done with ControlInfoMap
  • Made an Iterator for ControlInfoMap to allow rust to loop through the contents of the ControlInfoMap
  • Implemented all of ControlInfo's methods with each of them returning their respective rust counterparts (min, max, def all returning ControlValue)
  • Modified build.rs and tomls for libcamera to fix issues with not being able to compile with cross
  • updated bindgen and cc to 0.70 and 0.3 respectively

I am working on a project that requires quite extensive information from libcamera so I will continue to make pull request as I expand libcamera-sys and libcamera to support the remaining missing implementation I need

@SoZ0
Copy link
Author

SoZ0 commented Dec 8, 2024

I realized I skipped over the values method inside of ControlInfo. I have added an implementation that appears to work with the same systems mentioned before.

I also expanded on top of the libcamera-meta to allow getting the id and names of the ControlId/PropertyId from the enum directly.

@SoZ0 SoZ0 changed the title Add support for iterating and getting information from ControlInfoMap and ControlInfo Expanded support Libcamera Controls (ControlInfoMap and ControlInfo) Dec 8, 2024
@SoZ0 SoZ0 changed the title Expanded support Libcamera Controls (ControlInfoMap and ControlInfo) Expanded support for Libcamera Controls (ControlInfoMap and ControlInfo) Dec 8, 2024
let libcamera_version = Version::new(
libcamera_sys::LIBCAMERA_VERSION_MAJOR as _,
libcamera_sys::LIBCAMERA_VERSION_MINOR as _,
libcamera_sys::LIBCAMERA_VERSION_PATCH as _,
);
let libcamera_version = Version::new(0, 3, 2);

Choose a reason for hiding this comment

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

hi if your doing this so you can cross compile i hope #48 should help, could you try it yourself to confirm?

Copy link
Author

Choose a reason for hiding this comment

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

Hey sorry for the hold up, yes it in fact did work! for cross and on my host machine.

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