[libcamera-devel,01/12] libcamera: CameraSensor: Mention V4L2 in get/setControls()
diff mbox series

Message ID 20210105190522.682324-2-jacopo@jmondi.org
State Accepted
Delegated to: Jacopo Mondi
Headers show
Series
  • android: Exposure times + scaler crop + android metadata
Related show

Commit Message

Jacopo Mondi Jan. 5, 2021, 7:05 p.m. UTC
The current CameraSensor interface for reading and writing controls
is currently based on V4L2 controls.

Mention that more clearly in the documentation and, while at it, re-sort
the documentation to match the methods declaration order.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/camera_sensor.cpp | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

Comments

Laurent Pinchart Jan. 10, 2021, 9:54 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Tue, Jan 05, 2021 at 08:05:11PM +0100, Jacopo Mondi wrote:
> The current CameraSensor interface for reading and writing controls
> is currently based on V4L2 controls.
> 
> Mention that more clearly in the documentation and, while at it, re-sort
> the documentation to match the methods declaration order.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera/camera_sensor.cpp | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index 046474c03f4a..05a1d7c22e97 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -593,11 +593,12 @@ const ControlInfoMap &CameraSensor::controls() const
>  }
>  
>  /**
> - * \brief Read controls from the sensor
> + * \brief Read V4L2 controls from the sensor
>   * \param[in] ids The list of controls to read, specified by their ID
>   *
>   * This method reads the value of all controls contained in \a ids, and returns
> - * their values as a ControlList.
> + * their values as a ControlList. The control identifiers are defined by the
> + * V4L2 specification (V4L2_CID_*).
>   *
>   * If any control in \a ids is not supported by the device, is disabled (i.e.
>   * has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
> @@ -615,18 +616,13 @@ ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
>  }
>  
>  /**
> - * \fn CameraSensor::properties()
> - * \brief Retrieve the camera sensor properties
> - * \return The list of camera sensor properties
> - */
> -
> -/**
> - * \brief Write controls to the sensor
> + * \brief Write V4L2 controls to the sensor
>   * \param[in] ctrls The list of controls to write
>   *
>   * This method writes the value of all controls contained in \a ctrls, and
> - * stores the values actually applied to the device in the corresponding
> - * \a ctrls entry.
> + * stores the values actually applied to the device in the corresponding \a
> + * ctrls entry. The control identifiers are defined by the V4L2 specification
> + * (V4L2_CID_*).
>   *
>   * If any control in \a ctrls is not supported by the device, is disabled (i.e.
>   * has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, or if any other
> @@ -649,6 +645,12 @@ int CameraSensor::setControls(ControlList *ctrls)
>  	return subdev_->setControls(ctrls);
>  }
>  
> +/**
> + * \fn CameraSensor::properties()
> + * \brief Retrieve the camera sensor properties
> + * \return The list of camera sensor properties
> + */
> +
>  /**
>   * \brief Assemble and return the camera sensor info
>   * \param[out] info The camera sensor info
Niklas Söderlund Jan. 18, 2021, 2:51 p.m. UTC | #2
Hi Jacopo,

Thanks for your work.

On 2021-01-05 20:05:11 +0100, Jacopo Mondi wrote:
> The current CameraSensor interface for reading and writing controls
> is currently based on V4L2 controls.
> 
> Mention that more clearly in the documentation and, while at it, re-sort
> the documentation to match the methods declaration order.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/camera_sensor.cpp | 24 +++++++++++++-----------
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
> index 046474c03f4a..05a1d7c22e97 100644
> --- a/src/libcamera/camera_sensor.cpp
> +++ b/src/libcamera/camera_sensor.cpp
> @@ -593,11 +593,12 @@ const ControlInfoMap &CameraSensor::controls() const
>  }
>  
>  /**
> - * \brief Read controls from the sensor
> + * \brief Read V4L2 controls from the sensor
>   * \param[in] ids The list of controls to read, specified by their ID
>   *
>   * This method reads the value of all controls contained in \a ids, and returns
> - * their values as a ControlList.
> + * their values as a ControlList. The control identifiers are defined by the
> + * V4L2 specification (V4L2_CID_*).
>   *
>   * If any control in \a ids is not supported by the device, is disabled (i.e.
>   * has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
> @@ -615,18 +616,13 @@ ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
>  }
>  
>  /**
> - * \fn CameraSensor::properties()
> - * \brief Retrieve the camera sensor properties
> - * \return The list of camera sensor properties
> - */
> -
> -/**
> - * \brief Write controls to the sensor
> + * \brief Write V4L2 controls to the sensor
>   * \param[in] ctrls The list of controls to write
>   *
>   * This method writes the value of all controls contained in \a ctrls, and
> - * stores the values actually applied to the device in the corresponding
> - * \a ctrls entry.
> + * stores the values actually applied to the device in the corresponding \a
> + * ctrls entry. The control identifiers are defined by the V4L2 specification
> + * (V4L2_CID_*).
>   *
>   * If any control in \a ctrls is not supported by the device, is disabled (i.e.
>   * has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, or if any other
> @@ -649,6 +645,12 @@ int CameraSensor::setControls(ControlList *ctrls)
>  	return subdev_->setControls(ctrls);
>  }
>  
> +/**
> + * \fn CameraSensor::properties()
> + * \brief Retrieve the camera sensor properties
> + * \return The list of camera sensor properties
> + */
> +
>  /**
>   * \brief Assemble and return the camera sensor info
>   * \param[out] info The camera sensor info
> -- 
> 2.29.2
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 046474c03f4a..05a1d7c22e97 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -593,11 +593,12 @@  const ControlInfoMap &CameraSensor::controls() const
 }
 
 /**
- * \brief Read controls from the sensor
+ * \brief Read V4L2 controls from the sensor
  * \param[in] ids The list of controls to read, specified by their ID
  *
  * This method reads the value of all controls contained in \a ids, and returns
- * their values as a ControlList.
+ * their values as a ControlList. The control identifiers are defined by the
+ * V4L2 specification (V4L2_CID_*).
  *
  * If any control in \a ids is not supported by the device, is disabled (i.e.
  * has the V4L2_CTRL_FLAG_DISABLED flag set), or if any other error occurs
@@ -615,18 +616,13 @@  ControlList CameraSensor::getControls(const std::vector<uint32_t> &ids)
 }
 
 /**
- * \fn CameraSensor::properties()
- * \brief Retrieve the camera sensor properties
- * \return The list of camera sensor properties
- */
-
-/**
- * \brief Write controls to the sensor
+ * \brief Write V4L2 controls to the sensor
  * \param[in] ctrls The list of controls to write
  *
  * This method writes the value of all controls contained in \a ctrls, and
- * stores the values actually applied to the device in the corresponding
- * \a ctrls entry.
+ * stores the values actually applied to the device in the corresponding \a
+ * ctrls entry. The control identifiers are defined by the V4L2 specification
+ * (V4L2_CID_*).
  *
  * If any control in \a ctrls is not supported by the device, is disabled (i.e.
  * has the V4L2_CTRL_FLAG_DISABLED flag set), is read-only, or if any other
@@ -649,6 +645,12 @@  int CameraSensor::setControls(ControlList *ctrls)
 	return subdev_->setControls(ctrls);
 }
 
+/**
+ * \fn CameraSensor::properties()
+ * \brief Retrieve the camera sensor properties
+ * \return The list of camera sensor properties
+ */
+
 /**
  * \brief Assemble and return the camera sensor info
  * \param[out] info The camera sensor info