[libcamera-devel] libcamera: camera_sensor: Add OV5640 sensor properties
diff mbox series

Message ID 20220316081658.3103994-1-paul.elder@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel] libcamera: camera_sensor: Add OV5640 sensor properties
Related show

Commit Message

Paul Elder March 16, 2022, 8:16 a.m. UTC
Add an entry to the sensor properties for the ov5640. Only the first
test pattern is included as the others that are exposed by the kernel
don't correspond to any that are defined in the libcamera control.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
---
 src/libcamera/camera_sensor_properties.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Nicolas Dufresne via libcamera-devel March 16, 2022, 9:52 a.m. UTC | #1
Quoting Paul Elder via libcamera-devel (2022-03-16 08:16:58)
> Add an entry to the sensor properties for the ov5640. Only the first
> test pattern is included as the others that are exposed by the kernel
> don't correspond to any that are defined in the libcamera control.

Indeed, I see: 
 static const char * const test_pattern_menu[] = {
        "Disabled",
        "Color bars",
        "Color bars w/ rolling bar",
        "Color squares",
        "Color squares w/ rolling bar",
 };

I think this patch is fine so 

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

But I wonder how we're going to map so many potential combinations of
test pattern.

A test pattern with motion is probably useful to be able to enable but
how do we then define the motion etc...

I almost wish we could just represent test patterns as a string menu and
report the underlying V4L2 strings directly to applications ... then the
users could choose directly.

> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> ---
>  src/libcamera/camera_sensor_properties.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> index 48305ac4..027d74e1 100644
> --- a/src/libcamera/camera_sensor_properties.cpp
> +++ b/src/libcamera/camera_sensor_properties.cpp
> @@ -90,6 +90,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>                                 { controls::draft::TestPatternModePn9, 4 },
>                         },
>                 } },
> +               { "ov5640", {
> +                       .unitCellSize = { 1400, 1400 },
> +                       .testPatternModes = {
> +                               { controls::draft::TestPatternModeOff, 0 },
> +                               { controls::draft::TestPatternModeColorBars, 1 },
> +                       },
> +               } },
>                 { "ov5647", {
>                         .unitCellSize = { 1400, 1400 },
>                         .testPatternModes = {},
> -- 
> 2.30.2
>
Laurent Pinchart March 23, 2022, 12:42 a.m. UTC | #2
Hi Paul,

Thank you for the patch.

On Wed, Mar 16, 2022 at 05:16:58PM +0900, Paul Elder via libcamera-devel wrote:
> Add an entry to the sensor properties for the ov5640. Only the first
> test pattern is included as the others that are exposed by the kernel
> don't correspond to any that are defined in the libcamera control.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

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

> ---
>  src/libcamera/camera_sensor_properties.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
> index 48305ac4..027d74e1 100644
> --- a/src/libcamera/camera_sensor_properties.cpp
> +++ b/src/libcamera/camera_sensor_properties.cpp
> @@ -90,6 +90,13 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
>  				{ controls::draft::TestPatternModePn9, 4 },
>  			},
>  		} },
> +		{ "ov5640", {
> +			.unitCellSize = { 1400, 1400 },
> +			.testPatternModes = {
> +				{ controls::draft::TestPatternModeOff, 0 },
> +				{ controls::draft::TestPatternModeColorBars, 1 },
> +			},
> +		} },
>  		{ "ov5647", {
>  			.unitCellSize = { 1400, 1400 },
>  			.testPatternModes = {},

Patch
diff mbox series

diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp
index 48305ac4..027d74e1 100644
--- a/src/libcamera/camera_sensor_properties.cpp
+++ b/src/libcamera/camera_sensor_properties.cpp
@@ -90,6 +90,13 @@  const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen
 				{ controls::draft::TestPatternModePn9, 4 },
 			},
 		} },
+		{ "ov5640", {
+			.unitCellSize = { 1400, 1400 },
+			.testPatternModes = {
+				{ controls::draft::TestPatternModeOff, 0 },
+				{ controls::draft::TestPatternModeColorBars, 1 },
+			},
+		} },
 		{ "ov5647", {
 			.unitCellSize = { 1400, 1400 },
 			.testPatternModes = {},