summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/v4l2-ctl.cpp51
1 files changed, 50 insertions, 1 deletions
diff --git a/test/v4l2-ctl.cpp b/test/v4l2-ctl.cpp
index a9604e650..9604dcc96 100644
--- a/test/v4l2-ctl.cpp
+++ b/test/v4l2-ctl.cpp
@@ -640,6 +640,24 @@ static void parse_next_subopt(char **subs, char **value)
}
}
+static void print_std(const char *prefix, const char *stds[], unsigned long long std)
+{
+ int first = 1;
+
+ printf("\t%s-", prefix);
+ while (*stds) {
+ if (std & 1) {
+ if (!first)
+ printf("/");
+ first = 0;
+ printf("%s", *stds);
+ }
+ stds++;
+ std >>= 1;
+ }
+ printf("\n");
+}
+
int main(int argc, char **argv)
{
char *value, *subs;
@@ -1130,8 +1148,39 @@ int main(int argc, char **argv)
}
if (options[OptGetStandard]) {
- if (doioctl(fd, VIDIOC_G_STD, &std, "VIDIOC_G_STD") == 0)
+ if (doioctl(fd, VIDIOC_G_STD, &std, "VIDIOC_G_STD") == 0) {
+ static const char *pal[] = {
+ "B", "B1", "G", "H", "I", "D", "D1", "K",
+ "M", "N", "Nc", "60",
+ NULL
+ };
+ static const char *ntsc[] = {
+ "M", "M-JP", "443", "M-KR",
+ NULL
+ };
+ static const char *secam[] = {
+ "B", "D", "G", "H", "K", "K1", "L", "Lc",
+ NULL
+ };
+ static const char *atsc[] = {
+ "ATSC-8-VSB", "ATSC-16-VSB",
+ NULL
+ };
+
printf("Video standard = 0x%08llx\n", (unsigned long long)std);
+ if (std & 0xfff) {
+ print_std("PAL", pal, std);
+ }
+ if (std & 0xf000) {
+ print_std("NTSC", ntsc, std >> 12);
+ }
+ if (std & 0xff0000) {
+ print_std("SECAM", secam, std >> 16);
+ }
+ if (std & 0xf000000) {
+ print_std("ATSC/HDTV", atsc, std >> 24);
+ }
+ }
}
if (options[OptListCtrlsMenus]) {