[libcamera-devel] [PATCH v7 4/5] libcamera: camera_lens: add CameraLens as a member of CameraSensor
Han-Lin Chen
hanlinchen at chromium.org
Thu Dec 2 15:03:16 CET 2021
Add CameraLens as a member of CameraSenosr. 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 at chromium.org>
---
include/libcamera/internal/camera_sensor.h | 5 +++++
src/libcamera/camera_sensor.cpp | 8 ++++++++
2 files changed, 13 insertions(+)
diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
index d25a1165..8e97a80e 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 *lens() { return lens_.get(); }
+
protected:
std::string logPrefix() const override;
@@ -91,6 +94,8 @@ private:
const BayerFormat *bayerFormat_;
ControlList properties_;
+
+ std::unique_ptr<CameraLens> lens_;
};
} /* namespace libcamera */
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 6151b32e..b386e7b0 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,13 @@ void CameraSensor::updateControlInfo()
subdev_->updateControlInfo();
}
+/**
+ * \fn CameraSensor::lens()
+ * \brief Retrieve the lens controller
+ *
+ * \return The lens controller. nullptr if no lens is connected to the sensor
+ */
+
std::string CameraSensor::logPrefix() const
{
return "'" + entity_->name() + "'";
--
2.34.1.400.ga245620fadb-goog
More information about the libcamera-devel
mailing list