aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-18 16:15:37 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-01-18 16:15:37 +0100
commit2a368db7af32b1812a68c104810f3fa0213298f2 (patch)
treeaea9247744167e6f5c5d6fccfca0f1b7b23ed495
parentd076dbe5e1d1fc58898bb86a5c8dd6f3a9819ce9 (diff)
v4l2-info: add v4l2_info_subdev_capability
Add support for struct v4l2_subdev_capability. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/common/v4l2-info.cpp19
-rw-r--r--utils/common/v4l2-info.h1
2 files changed, 20 insertions, 0 deletions
diff --git a/utils/common/v4l2-info.cpp b/utils/common/v4l2-info.cpp
index 274caa89..fe4defd9 100644
--- a/utils/common/v4l2-info.cpp
+++ b/utils/common/v4l2-info.cpp
@@ -105,6 +105,15 @@ static std::string cap2s(unsigned cap)
return s;
}
+static std::string subdevcap2s(unsigned cap)
+{
+ std::string s;
+
+ if (cap & V4L2_SUBDEV_CAP_RO_SUBDEV)
+ s += "\t\tRead-Only Sub-Device\n";
+ return s;
+}
+
void v4l2_info_capability(const v4l2_capability &vcap)
{
printf("\tDriver name : %s\n", vcap.driver);
@@ -122,6 +131,16 @@ void v4l2_info_capability(const v4l2_capability &vcap)
}
}
+void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap)
+{
+ printf("\tDriver version : %d.%d.%d\n",
+ subdevcap.version >> 16,
+ (subdevcap.version >> 8) & 0xff,
+ subdevcap.version & 0xff);
+ printf("\tCapabilities : 0x%08x\n", subdevcap.capabilities);
+ printf("%s", subdevcap2s(subdevcap.capabilities).c_str());
+}
+
std::string fcc2s(__u32 val)
{
std::string s;
diff --git a/utils/common/v4l2-info.h b/utils/common/v4l2-info.h
index 789b1f43..6ddd2ee5 100644
--- a/utils/common/v4l2-info.h
+++ b/utils/common/v4l2-info.h
@@ -13,6 +13,7 @@
/* Print capability information */
void v4l2_info_capability(const v4l2_capability &cap);
+void v4l2_info_subdev_capability(const v4l2_subdev_capability &subdevcap);
/* Return fourcc pixelformat string */
std::string fcc2s(__u32 val);

Privacy Policy