From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Paul Elder <paul.elder@ideasonboard.com>, linux-media@vger.kernel.org
Subject: Re: [PATCH 1/2] v4l2-compliance: Add version command
Date: Fri, 10 Jul 2020 16:51:42 +0300 [thread overview]
Message-ID: <20200710135142.GZ5964@pendragon.ideasonboard.com> (raw)
In-Reply-To: <3b0dd8f8-00b0-2a94-f040-c9619a99e201@xs4all.nl>
Hi Hans,
On Fri, Jul 10, 2020 at 03:33:25PM +0200, Hans Verkuil wrote:
> On 10/07/2020 15:25, Laurent Pinchart wrote:
> > 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.
>
> 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.
The issue with the SHA is that, while it identifies the exact commit, it
is useless to compare versions. We are using v4l2-compliance to test the
libcamera V4L2 compatibility layer, and this depends on recent features
merged in the master branch but not available in a release yet. We would
like the test to be skipped if the v4l2-compliance is too old. Printing
the package version is a good step forward, but would require waiting
for the next release before the test can be enabled. That's probably OK
overall, but it's a bit annoying during development. That's why I was
wondering if a commit count (as output by git rev-list --count HEAD)
would be useful too. In our case, the fact that v4l2-compliance supports
the --version option will be enough to know it's recent enough, but I'm
thinking about the future (for libcamera and other users).
> 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).
>
> >> +}
> >> +
> >> 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]);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-07-10 13:51 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
2020-07-10 13:50 ` Hans Verkuil
2020-07-10 13:51 ` Laurent Pinchart [this message]
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=20200710135142.GZ5964@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=paul.elder@ideasonboard.com \
/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