[libcamera-devel] [PATCH] libcamera: v4l2_device: Fix control enumeration bug

Kieran Bingham kieran.bingham at ideasonboard.com
Wed Jun 26 12:17:23 CEST 2019


Hi Jacopo,

On 26/06/2019 11:13, Jacopo Mondi wrote:
> When enumerating the available V4L2 controls at video device open
> time set the V4L2_CTRL_FLAG_NEXT_CTRL flag when hitting an unsupported
> control type not to loop forever.

"set the V4L2_CTRL_FLAG_NEXT_CTRL flag if an unsupported control type is
encountered to prevent infinite loops."


> While at it, downgrade the message reporting the control type in not

"reporting the unsupported control type to Debug"


> supported to Debug, as it is not an error worth being reported
> unconditionally.
> 
> Fixes: 030ce6491ed3 ("libcamera: v4l2_device: List valid controls at open")
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>

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

> ---
>  src/libcamera/v4l2_device.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
> index 84758a811c27..13d4bce5c013 100644
> --- a/src/libcamera/v4l2_device.cpp
> +++ b/src/libcamera/v4l2_device.cpp
> @@ -341,8 +341,9 @@ void V4L2Device::listControls()
>  			break;
>  		/* \todo Support compound controls. */
>  		default:
> -			LOG(V4L2, Error) << "Control type '" << info.type()
> +			LOG(V4L2, Debug) << "Control type '" << info.type()
>  					 << "' not supported";
> +			ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
>  			continue;
>  		}
>  
> 

-- 
Regards
--
Kieran


More information about the libcamera-devel mailing list