summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan-Lin Chen <hanlinchen@chromium.org>2021-12-03 17:44:25 +0800
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-12-03 10:23:26 +0000
commitad2bcbe5b55c8824288cd1752649f39f3a53af38 (patch)
treed4807b4cb4505a2f87a5bcf54804971dae894d57
parent6e80c1bcf410cca4b0c028dd337a749a50f9bb7a (diff)
libcamera: camera_lens: add CameraLens as a member of CameraSensor
Add CameraLens as a member of CameraSensor. The patch does not implement how to link the lens to the specific sensor yet. Only to provide an interface for pipeline handler's usage. Signed-off-by: Han-Lin Chen <hanlinchen@chromium.org> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/libcamera/internal/camera_sensor.h5
-rw-r--r--src/libcamera/camera_sensor.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
index 2facbf3c..788c2fa3 100644
--- a/include/libcamera/internal/camera_sensor.h
+++ b/include/libcamera/internal/camera_sensor.h
@@ -24,6 +24,7 @@
namespace libcamera {
class BayerFormat;
+class CameraLens;
class MediaEntity;
class CameraSensor : protected Loggable
@@ -60,6 +61,8 @@ public:
void updateControlInfo();
+ CameraLens *focusLens() { return focusLens_.get(); }
+
protected:
std::string logPrefix() const override;
@@ -91,6 +94,8 @@ private:
const BayerFormat *bayerFormat_;
ControlList properties_;
+
+ std::unique_ptr<CameraLens> focusLens_;
};
} /* namespace libcamera */
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 6151b32e..c89d39e1 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -20,6 +20,7 @@
#include <libcamera/base/utils.h>
#include "libcamera/internal/bayer_format.h"
+#include "libcamera/internal/camera_lens.h"
#include "libcamera/internal/camera_sensor_properties.h"
#include "libcamera/internal/formats.h"
#include "libcamera/internal/sysfs.h"
@@ -787,6 +788,14 @@ void CameraSensor::updateControlInfo()
subdev_->updateControlInfo();
}
+/**
+ * \fn CameraSensor::focusLens_()
+ * \brief Retrieve the focus lens controller
+ *
+ * \return The focus lens controller. nullptr if no focus lens controller is
+ * connected to the sensor
+ */
+
std::string CameraSensor::logPrefix() const
{
return "'" + entity_->name() + "'";