From: paul.elder@ideasonboard.com
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH 1/2] v4l2-compliance: Add version command
Date: Fri, 10 Jul 2020 22:44:16 +0900 [thread overview]
Message-ID: <20200710134416.GG66701@pyrite.rasen.tech> (raw)
In-Reply-To: <3b0dd8f8-00b0-2a94-f040-c9619a99e201@xs4all.nl>
On Fri, Jul 10, 2020 at 03:33:25PM +0200, Hans Verkuil wrote:
> On 10/07/2020 15:25, Laurent Pinchart wrote:
> > Hi Paul,
> >
> > Thank you for the patch.
> >
> > On Fri, Jul 10, 2020 at 10:18:12PM +0900, Paul Elder wrote:
> >> Add a --version option to v4l2-compliance to retrieve the version of
> >> v4l2-compliance.
> >>
> >> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> >> ---
> >> utils/v4l2-compliance/v4l2-compliance.cpp | 11 +++++++++++
> >> 1 file changed, 11 insertions(+)
> >>
> >> diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp
> >> index 4b45f110..72b9768f 100644
> >> --- a/utils/v4l2-compliance/v4l2-compliance.cpp
> >> +++ b/utils/v4l2-compliance/v4l2-compliance.cpp
> >> @@ -79,6 +79,7 @@ enum Option {
> >> OptMediaBusInfo = 'z',
> >> OptStreamFrom = 128,
> >> OptStreamFromHdr,
> >> + OptVersion,
> >> OptLast = 256
> >> };
> >>
> >> @@ -153,9 +154,15 @@ static struct option long_options[] = {
> >> {"stream-all-formats", optional_argument, 0, OptStreamAllFormats},
> >> {"stream-all-io", no_argument, 0, OptStreamAllIO},
> >> {"stream-all-color", required_argument, 0, OptStreamAllColorTest},
> >> + {"version", no_argument, 0, OptVersion},
> >> {0, 0, 0, 0}
> >> };
> >>
> >> +static void version()
> >> +{
> >> + printf("v4l2-compliance " PACKAGE_VERSION "\n");
> >
> > Is it enough to rely on the v4l-utils package version, or should we add
> > a git commit count as well ? The traditional version number will make it
> > difficult to test for features added between two released versions.
Yeah, it might be useful.
> If you add a version option, then v4l2-compliance should also show the SHA.
> It's already available (grep for SHA), so easy enough to add here.
Oh yeah we could use that.
> Also, if you add --version here, then it really should be added to most
> other utils as well (certainly media-ctl and cec-follower/ctl/compliance).
Okay, I can add that.
For v4l2-ctl and the other tools, would it be better like:
v4l2-ctl 1.21.0-deadbeef
Or like what v4l2-compliance has:
v4l2-compliance SHA: 3b22ab02b960e4d1e90618e9fce9b7c8a80d814a, 64 bits, 64-bit time_t
v4l2-compliance 1.21.0
Thanks,
Paul
> >> +}
> >> +
> >> static void usage()
> >> {
> >> printf("Usage:\n");
> >> @@ -244,6 +251,7 @@ static void usage()
> >> printf(" -P, --no-progress Turn off progress messages.\n");
> >> printf(" -T, --trace Trace all called ioctls.\n");
> >> printf(" -v, --verbose Turn on verbose reporting.\n");
> >> + printf(" --version Show version information.\n");
> >> #ifndef NO_LIBV4L2
> >> printf(" -w, --wrapper Use the libv4l2 wrapper library.\n");
> >> #endif
> >> @@ -1664,6 +1672,9 @@ int main(int argc, char **argv)
> >> case OptNoProgress:
> >> no_progress = true;
> >> break;
> >> + case OptVersion:
> >> + version();
> >> + std::exit(EXIT_SUCCESS);
> >> case ':':
> >> fprintf(stderr, "Option `%s' requires a value\n",
> >> argv[optind]);
> >
>
next prev parent reply other threads:[~2020-07-10 13:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-10 13:18 [PATCH 1/2] v4l2-compliance: Add version command Paul Elder
2020-07-10 13:18 ` [PATCH 2/2] v4l2-ctl: " Paul Elder
2020-07-10 13:25 ` [PATCH 1/2] v4l2-compliance: " Laurent Pinchart
2020-07-10 13:33 ` Hans Verkuil
2020-07-10 13:44 ` paul.elder [this message]
2020-07-10 13:50 ` Hans Verkuil
2020-07-10 13:51 ` Laurent Pinchart
2020-07-10 14:03 ` 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=20200710134416.GG66701@pyrite.rasen.tech \
--to=paul.elder@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=laurent.pinchart@ideasonboard.com \
--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