aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-05 09:10:06 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-05 09:10:06 (GMT)
commita614bc591110b21b4efb0b42a0ec48a2230babc2 (patch)
treed8dc852ecdc106e094f58d8178e83a8d2d4a770e
parent604e01c8cedbc0e26ccb5a27522ed072bb39cf6f (diff)
v4l2-ctl: also list media device with --list-devices
When combining -z with --list-devices all devices belonging to the given platform device are shown, except for the media device itself. Show the media device as well. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-common.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 09901f1..388c57b 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -206,10 +206,12 @@ static void list_media_devices(const std::string &media_bus_info)
struct media_device_info mdi;
if (!ioctl(fd, MEDIA_IOC_DEVICE_INFO, &mdi) &&
- media_bus_info == mdi.bus_info)
+ media_bus_info == mdi.bus_info) {
media_fd = fd;
- else
+ printf("%s\n", s.c_str());
+ } else {
close(fd);
+ }
}
closedir(dp);
if (media_fd < 0)

Privacy Policy