linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Antonio Ospite <ao2@ao2.it>
To: linux-media@vger.kernel.org
Cc: Antonio Ospite <ao2@ao2.it>
Subject: [RFC PATCH 3/5] v4l2-ctl: use a dedicated function to print the control class name
Date: Thu,  3 Jan 2019 19:01:00 +0100	[thread overview]
Message-ID: <20190103180102.12282-4-ao2@ao2.it> (raw)
In-Reply-To: <20190103180102.12282-1-ao2@ao2.it>

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 <ao2@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


  parent reply	other threads:[~2019-01-03 18:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-24 17:52 [v4l-utils] Add options to v4l2-ctrl to save/load settings to/from a file Antonio Ospite
2019-01-03 18:00 ` [RFC PATCH 0/5] v4l2-ctl: list controls values in a machine-readable format Antonio Ospite
2019-01-03 18:00   ` [RFC PATCH 1/5] v4l2-ctl: list controls with menus when OptAll is specified Antonio Ospite
2019-01-03 18:00   ` [RFC PATCH 2/5] v4l2-ctl: list once when both OptListCtrls and OptListCtrlsMenus are there Antonio Ospite
2019-01-03 18:01   ` Antonio Ospite [this message]
2019-01-03 18:01   ` [RFC PATCH 4/5] v4l2-ctl: abstract the mechanism used to print the list of controls Antonio Ospite
2019-01-03 18:01   ` [RFC PATCH 5/5] v4l2-ctl: add an option to list controls in a machine-readable format Antonio Ospite
2019-01-07 10:18     ` Hans Verkuil
2019-01-09 21:15       ` Antonio Ospite
2019-01-10 12:05         ` Hans Verkuil
2019-01-07 10:21   ` [RFC PATCH 0/5] v4l2-ctl: list controls values " Hans Verkuil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190103180102.12282-4-ao2@ao2.it \
    --to=ao2@ao2.it \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).