All the details about the controls are printed in the dedicated function
print_qctrl(), use a new dedicated function named print_class_name() to
print the control class name as well, this is for symmetry but it is
also in preparation for a change which aims to abstract how the controls
are printed.

Signed-off-by: Antonio Ospite <a...@ao2.it>
---
 utils/v4l2-ctl/v4l2-ctl-common.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp 
b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index e2710335..5d41d720 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -403,6 +403,11 @@ static void print_qctrl(int fd, struct v4l2_query_ext_ctrl 
*queryctrl,
        }
 }
 
+static void print_class_name(const char *name)
+{
+       printf("\n%s\n\n", name);
+}
+
 static int print_control(int fd, struct v4l2_query_ext_ctrl &qctrl, int 
show_menus)
 {
        struct v4l2_control ctrl;
@@ -415,7 +420,7 @@ static int print_control(int fd, struct v4l2_query_ext_ctrl 
&qctrl, int show_men
        if (qctrl.flags & V4L2_CTRL_FLAG_DISABLED)
                return 1;
        if (qctrl.type == V4L2_CTRL_TYPE_CTRL_CLASS) {
-               printf("\n%s\n\n", qctrl.name);
+               print_class_name(qctrl.name);
                return 1;
        }
        ext_ctrl.id = qctrl.id;
-- 
2.20.1

Reply via email to