[libcamera-devel] libcamera: device_enumerator: extend documentation of DeviceMatch

Message ID 20190117230636.16176-1-niklas.soderlund@ragnatech.se
State Superseded
Headers show
Series
  • [libcamera-devel] libcamera: device_enumerator: extend documentation of DeviceMatch
Related show

Commit Message

Niklas Söderlund Jan. 17, 2019, 11:06 p.m. UTC
Extend the document of the intended usage of DeviceMatch need for
information to correctly function to find a uniquely identifiable media
device.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/device_enumerator.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Laurent Pinchart Jan. 18, 2019, 12:12 a.m. UTC | #1
Hi Niklas,

Thank you for the patch.

On Fri, Jan 18, 2019 at 12:06:36AM +0100, Niklas Söderlund wrote:
> Extend the document of the intended usage of DeviceMatch need for
> information to correctly function to find a uniquely identifiable media
> device.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
> ---
>  src/libcamera/device_enumerator.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
> index 55c510e3b79a415b..e0b19313552f6aa5 100644
> --- a/src/libcamera/device_enumerator.cpp
> +++ b/src/libcamera/device_enumerator.cpp
> @@ -52,6 +52,15 @@ namespace libcamera {
>   *
>   * The description is meant to be filled by pipeline managers and passed to a
>   * device enumerator to find matching media devices.
> + *
> + * A DeviceMatch is created with a specific Linux device driver in mind, therefor

s/therefor/therefore/

(The spelling therefor exists but is archaic)

> + * the name of the driver is a required property. One or more Entity names can
> + * be added the matching with \a add().

Maybe "can be added as match criteria" ?

> + *
> + * A pipeline handler should add as many entities to a DeviceMatch so that the
> + * media device can be uniquely identified in case a Linux device driver is
> + * capable of producing different media graphs as a result of different hardware
> + * versions or other circumstances.

How about phrasing that as a recommended usage ?

Pipeline handlers are recommended to add entities to DeviceMatch as
appropriare to ensure that the media device they need can be uniquely
identified. This is useful  when the corresponding kernel driver can
produce different graphs, for instance as a result of different driver
versions or hardware configurations, and not all those graphs are
suitable for a pipeline handler.
different hardware versions

>   */

Patch

diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp
index 55c510e3b79a415b..e0b19313552f6aa5 100644
--- a/src/libcamera/device_enumerator.cpp
+++ b/src/libcamera/device_enumerator.cpp
@@ -52,6 +52,15 @@  namespace libcamera {
  *
  * The description is meant to be filled by pipeline managers and passed to a
  * device enumerator to find matching media devices.
+ *
+ * A DeviceMatch is created with a specific Linux device driver in mind, therefor
+ * the name of the driver is a required property. One or more Entity names can
+ * be added the matching with \a add().
+ *
+ * A pipeline handler should add as many entities to a DeviceMatch so that the
+ * media device can be uniquely identified in case a Linux device driver is
+ * capable of producing different media graphs as a result of different hardware
+ * versions or other circumstances.
  */
 
 /**