[libcamera-devel,1/2] py: gen-py-controls: Remove SceneFlicker workaround
diff mbox series

Message ID 20230725125641.1557350-2-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: pipeline: AeFlickerMode support
Related show

Commit Message

Kieran Bingham July 25, 2023, 12:56 p.m. UTC
The python bindings layer has to parse the libcamera controls to ensure
that they are converted to suitable names for the python layer.

Part of this strips out common prefixes from control names, however the
SceneFlicker control would end up using an illegal name if processed in
the same way as the other controls.

The SceneFlicker control has now been removed as part of the
introduction of the AeFlickerMode and AeFlickerPeriod controls.

Remove the workaround in the python layer.

Fixes: 6fdbf3f38c31 ("libcamera: controls: Add controls for AEC/AGC flicker avoidance")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/py/libcamera/gen-py-controls.py | 3 ---
 1 file changed, 3 deletions(-)

Comments

David Plowman July 25, 2023, 1:03 p.m. UTC | #1
Hi Kieran

Thanks for the patch.

On Tue, 25 Jul 2023 at 13:56, Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> The python bindings layer has to parse the libcamera controls to ensure
> that they are converted to suitable names for the python layer.
>
> Part of this strips out common prefixes from control names, however the
> SceneFlicker control would end up using an illegal name if processed in
> the same way as the other controls.
>
> The SceneFlicker control has now been removed as part of the
> introduction of the AeFlickerMode and AeFlickerPeriod controls.
>
> Remove the workaround in the python layer.
>
> Fixes: 6fdbf3f38c31 ("libcamera: controls: Add controls for AEC/AGC flicker avoidance")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> ---
>  src/py/libcamera/gen-py-controls.py | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py
> index 99f3bbcf5b80..9948c41e42b1 100755
> --- a/src/py/libcamera/gen-py-controls.py
> +++ b/src/py/libcamera/gen-py-controls.py
> @@ -48,9 +48,6 @@ def generate_py(controls, mode):
>              # Adjustments for controls
>              if name == 'LensShadingMapMode':
>                  prefix = 'LensShadingMapMode'
> -            elif name == 'SceneFlicker':
> -                # If we strip the prefix, we would get '50Hz', which is illegal name
> -                prefix = ''

The two single quotes look weirdly like a single double quote in a
proportional font...!

Reviewed-by: David Plowman <david.plowman@raspberrypi.com>

Thanks!
David

>              else:
>                  prefix = find_common_prefix([e['name'] for e in enum])
>          else:
> --
> 2.34.1
>
Laurent Pinchart July 25, 2023, 1:28 p.m. UTC | #2
Hi Kieran,

Thank you for the patch.

On Tue, Jul 25, 2023 at 01:56:40PM +0100, Kieran Bingham via libcamera-devel wrote:
> The python bindings layer has to parse the libcamera controls to ensure
> that they are converted to suitable names for the python layer.
> 
> Part of this strips out common prefixes from control names, however the
> SceneFlicker control would end up using an illegal name if processed in
> the same way as the other controls.
> 
> The SceneFlicker control has now been removed as part of the
> introduction of the AeFlickerMode and AeFlickerPeriod controls.
> 
> Remove the workaround in the python layer.
> 
> Fixes: 6fdbf3f38c31 ("libcamera: controls: Add controls for AEC/AGC flicker avoidance")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  src/py/libcamera/gen-py-controls.py | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py
> index 99f3bbcf5b80..9948c41e42b1 100755
> --- a/src/py/libcamera/gen-py-controls.py
> +++ b/src/py/libcamera/gen-py-controls.py
> @@ -48,9 +48,6 @@ def generate_py(controls, mode):
>              # Adjustments for controls
>              if name == 'LensShadingMapMode':
>                  prefix = 'LensShadingMapMode'
> -            elif name == 'SceneFlicker':
> -                # If we strip the prefix, we would get '50Hz', which is illegal name
> -                prefix = ''
>              else:
>                  prefix = find_common_prefix([e['name'] for e in enum])
>          else:

Patch
diff mbox series

diff --git a/src/py/libcamera/gen-py-controls.py b/src/py/libcamera/gen-py-controls.py
index 99f3bbcf5b80..9948c41e42b1 100755
--- a/src/py/libcamera/gen-py-controls.py
+++ b/src/py/libcamera/gen-py-controls.py
@@ -48,9 +48,6 @@  def generate_py(controls, mode):
             # Adjustments for controls
             if name == 'LensShadingMapMode':
                 prefix = 'LensShadingMapMode'
-            elif name == 'SceneFlicker':
-                # If we strip the prefix, we would get '50Hz', which is illegal name
-                prefix = ''
             else:
                 prefix = find_common_prefix([e['name'] for e in enum])
         else: