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

Jacopo Mondi jacopo at jmondi.org
Wed Jun 26 12:13:08 CEST 2019


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.

While at it, downgrade the message reporting the control type in not
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>
---
 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;
 		}
 
-- 
2.21.0



More information about the libcamera-devel mailing list