From: Antonio Ospite <ao2@ao2.it>
To: linux-media@vger.kernel.org
Cc: Antonio Ospite <ao2@ao2.it>
Subject: [RFC PATCH 2/5] v4l2-ctl: list once when both OptListCtrls and OptListCtrlsMenus are there
Date: Thu, 3 Jan 2019 19:00:59 +0100 [thread overview]
Message-ID: <20190103180102.12282-3-ao2@ao2.it> (raw)
In-Reply-To: <20190103180102.12282-1-ao2@ao2.it>
When both --list-ctrls and --list-ctrls-menus are passed, controls are
listed twice which is accurate but can be confusing.
Treat --list-ctrls-menus as an option modifier when also --list-ctrls is
passed, in order to have the controls listed only once.
Signed-off-by: Antonio Ospite <ao2@ao2.it>
---
utils/v4l2-ctl/v4l2-ctl-common.cpp | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 8256cbd9..e2710335 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -1091,11 +1091,7 @@ void common_get(cv4l_fd &_fd)
void common_list(cv4l_fd &fd)
{
- if (options[OptListCtrlsMenus]) {
- list_controls(fd.g_fd(), 1);
- }
-
- if (options[OptListCtrls]) {
- list_controls(fd.g_fd(), 0);
+ if (options[OptListCtrls] || options[OptListCtrlsMenus]) {
+ list_controls(fd.g_fd(), options[OptListCtrlsMenus]);
}
}
--
2.20.1
next prev parent reply other threads:[~2019-01-03 18:40 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 ` Antonio Ospite [this message]
2019-01-03 18:01 ` [RFC PATCH 3/5] v4l2-ctl: use a dedicated function to print the control class name Antonio Ospite
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-3-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).