@@ -19,6 +19,8 @@ namespace libcamera {
class MediaEntity;
class V4L2Subdevice;
+struct CameraLensProperties;
+
class CameraLens : protected Loggable
{
public:
@@ -44,6 +46,8 @@ private:
std::unique_ptr<V4L2Subdevice> subdev_;
std::string model_;
+
+ const CameraLensProperties *staticProps_;
};
} /* namespace libcamera */
@@ -9,6 +9,7 @@
#include <libcamera/base/utils.h>
+#include "libcamera/internal/camera_lens_properties.h"
#include "libcamera/internal/v4l2_subdevice.h"
/**
@@ -36,7 +37,7 @@ LOG_DEFINE_CATEGORY(CameraLens)
* Once constructed the instance must be initialized with init().
*/
CameraLens::CameraLens(const MediaEntity *entity)
- : entity_(entity)
+ : entity_(entity), staticProps_(nullptr)
{
}
@@ -73,6 +74,8 @@ int CameraLens::init()
return ret;
model_ = subdev_->model();
+ staticProps_ = CameraLensProperties::get(model_);
+
return 0;
}
When the CameraLens is created in the pipeline handler, it will offer various functions to access the lens properties. Add a call to get the static properties at init time. Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com> --- include/libcamera/internal/camera_lens.h | 4 ++++ src/libcamera/camera_lens.cpp | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-)