@@ -14,7 +14,7 @@ v4l2_ctl_SOURCES = v4l2-ctl.cpp v4l2-ctl.h v4l2-ctl-common.cpp v4l2-ctl-tuner.cp
v4l2-ctl-streaming.cpp v4l2-ctl-sdr.cpp v4l2-ctl-edid.cpp v4l2-ctl-modes.cpp \
v4l2-ctl-subdev.cpp v4l2-tpg-colors.c v4l2-tpg-core.c v4l-stream.c v4l2-ctl-meta.cpp \
media-info.cpp v4l2-info.cpp codec-fwht.c codec-v4l2-fwht.c
-v4l2_ctl_CPPFLAGS = -I$(top_srcdir)/utils/common
+v4l2_ctl_CPPFLAGS = -I$(top_srcdir)/utils/common $(GIT_COMMIT_CNT)
media-bus-format-names.h: $(top_srcdir)/include/linux/media-bus-format.h
sed -e '/#define MEDIA_BUS_FMT/ ! d; s/.*FMT_//; /FIXED/ d; s/\t.*//; s/.*/{ \"&\", MEDIA_BUS_FMT_& },/;' \
@@ -121,6 +121,7 @@ void common_usage()
" --silent only set the result code, do not print any messages\n"
" --sleep <secs> sleep <secs>, call QUERYCAP and close the file handle\n"
" --verbose turn on verbose ioctl status reporting\n"
+ " --version show version information\n"
);
}
@@ -284,6 +284,7 @@ static struct option long_options[] = {
{"stream-out-user", optional_argument, 0, OptStreamOutUser},
{"stream-out-dmabuf", no_argument, 0, OptStreamOutDmaBuf},
{"list-patterns", no_argument, 0, OptListPatterns},
+ {"version", no_argument, 0, OptVersion},
{0, 0, 0, 0}
};
@@ -306,6 +307,13 @@ static void usage_all()
edid_usage();
}
+static void print_version()
+{
+#define STR(x) #x
+#define STRING(x) STR(x)
+ printf("v4l2-ctl %s%s\n", PACKAGE_VERSION, STRING(GIT_COMMIT_CNT));
+}
+
int test_ioctl(int fd, unsigned long cmd, void *arg)
{
return options[OptUseWrapper] ? v4l2_ioctl(fd, cmd, arg) : ioctl(fd, cmd, arg);
@@ -1245,6 +1253,9 @@ int main(int argc, char **argv)
case OptSleep:
secs = strtoul(optarg, 0L, 0);
break;
+ case OptVersion:
+ print_version();
+ return 0;
case ':':
fprintf(stderr, "Option '%s' requires a value\n",
argv[optind]);
@@ -263,6 +263,7 @@ enum Option {
OptHelpStreaming,
OptHelpEdid,
OptHelpAll,
+ OptVersion,
OptLast = 512
};