-
Notifications
You must be signed in to change notification settings - Fork 236
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
API to get at CameraManager or Camera list #527
Comments
Hi, unfortunately it's a bit hard for me to guess exactly what API changes you need here without more context. If you are able to create a basic PR with the desired changes, we would be happy to discuss this in more detail and merge the appropriate changes. |
Hi, let me jump in with probable guess, anjok may confirm if my suspicions are true. In INDI we do not know what is the camera is used as many may be used, and INDI is. made as universal driver so we need to get info what model of camera is connected and its properties before we Open the camera, and in current api we need to know Camera before we can start it and use GetCameraList. |
The only way to enumerate cameras in libcamera is through the camera manager. Again, I am a bit unclear on how you want to do things in your INDI framework - I've never used it before. If you could create a PR with some proposed API changes that would work for you we can get something suitable merged for your. The PR does not have to be functionally complete to start with. |
Here you go: https://github.com/raspberrypi/libcamera-apps/pull/528/files I have no idea if this is how std:unique_ptr is supposed to get used, though. Since we have an instance of LibcameraApp in the driver, we might as well add an instance method
which calls the static method with it's CameraManager, but my std:: C++ skills aren't that up to speed. |
The PR above is what I added to our local copy of the source files. If you'd add something like this, we don't have to maintain that copy anymore (provided the user has whatever version of the libcamera-apps lib then contains it) |
What timing, I was just going to create an Issue to request a way to query capabilities of the attached cameras. Our Allsky software calls We have a front end where users enter those values which our program then adds to the We currently have that data hard-coded for every RPi or RPi-compatible camera, which is a nightmare and very prone to error. It also means we can't support new cameras until we add that data. What I'm requesting is some way to query all that information and have it returned in either a "txt" or "json" format, as is done with the metadata. I can provide all the info we'd need. |
@anjok #528 should now be merged. @EricClaeys there is a way to get this information (with a caveat). The output of
The code that retrieves the properties can be found here: The caveat here is that the settings above are strictly mode specific and not necessarily global for all modes. So you might have to configure each mode and retrieve the properties individually one-by-one if you need to. |
@EricClaeys if you need more help with this feel free to open a new issue. I'll close this one down now as the original problem is resolved. |
For the INDI libcamera driver, we need to get at the camera list before actually opening a camera. Also, we need to be able to Open and Close the camera on a regular basis. Unfortunately, the API that is present needs the camera manager as input.
Can you add a means for that to get the list? Currently, I cloned the code into the driver and added a method to get a pointer to CameraManager and run the same code that you run for discovering cameras:
https://github.com/indilib/indi-3rdparty/blob/master/indi-libcamera/libcamera-apps/core/libcamera_app.hpp#L118
https://github.com/indilib/indi-3rdparty/blob/master/indi-libcamera/indi_libcamera.cpp#L595C22-L595C22
I can't reuse the one you added to LibCameraApp::GetCameraList() as it takes a std::unique_pointer argument and I can't return the one you created for the instance.
This is of course not very usable, as you'll need to recompile this each time something changes.
The text was updated successfully, but these errors were encountered: