[libcamera-devel,v5,5/8] libcamera: camera_sensor: Expose the camera device
diff mbox series

Message ID 20210116114805.905397-6-niklas.soderlund@ragnatech.se
State Accepted
Delegated to: Niklas Söderlund
Headers show
Series
  • libcamera: Add helper for controls that take effect with a delay
Related show

Commit Message

Niklas Söderlund Jan. 16, 2021, 11:48 a.m. UTC
Expose the device backing the CameraSensor instance.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
* Changes since v4
- Add a \todo

* Changes since v3
- New, needed to be able to move the DelayedControls handling out of
  CameraSensor.
---
 include/libcamera/internal/camera_sensor.h | 2 ++
 src/libcamera/camera_sensor.cpp            | 7 +++++++
 2 files changed, 9 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h
index f80d836161a564e7..a70e024aa327f69b 100644
--- a/include/libcamera/internal/camera_sensor.h
+++ b/include/libcamera/internal/camera_sensor.h
@@ -61,6 +61,8 @@  public:
 	ControlList getControls(const std::vector<uint32_t> &ids);
 	int setControls(ControlList *ctrls);
 
+	V4L2Subdevice *device() { return subdev_.get(); }
+
 	const ControlList &properties() const { return properties_; }
 	int sensorInfo(CameraSensorInfo *info) const;
 
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index e786821d4ba22fb8..8c00e1f8289b88fe 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -514,6 +514,13 @@  ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
 	return subdev_->getControls(ids);
 }
 
+/**
+ * \fn CameraSensor::device()
+ * \brief Retrieve the camera sensor device
+ * \todo Remove this function by integrating DelayedControl with CameraSensor
+ * \return The camera sensor device
+ */
+
 /**
  * \fn CameraSensor::properties()
  * \brief Retrieve the camera sensor properties