diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-03-16 17:27:13 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-03-20 18:11:20 +0200 |
commit | bbe738f9a29d240c6cc0b4f17e463193b719aa7e (patch) | |
tree | 49684f6227526fe9ff9b42708d3aec073f59dc4b | |
parent | 6fc99ac59e7c5173e646de4285681dd0e63d6924 (diff) |
yavta: Fix printing of device capabilities
Commit d029d1d5bba831b9 ("Separate querying capabilities and determining
buffer queue type") broke capabilities printing. Fix it.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
-rw-r--r-- | yavta.c | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -358,6 +358,7 @@ static int video_open(struct device *dev, const char *devname) static int video_querycap(struct device *dev, unsigned int *capabilities) { struct v4l2_capability cap; + unsigned int caps; int ret; memset(&cap, 0, sizeof cap); @@ -365,13 +366,16 @@ static int video_querycap(struct device *dev, unsigned int *capabilities) if (ret < 0) return 0; - *capabilities = cap.capabilities & V4L2_CAP_DEVICE_CAPS - ? cap.device_caps : cap.capabilities; + caps = cap.capabilities & V4L2_CAP_DEVICE_CAPS + ? cap.device_caps : cap.capabilities; printf("Device `%s' on `%s' is a video %s (%s mplanes) device.\n", cap.card, cap.bus_info, - video_is_capture(dev) ? "capture" : "output", - video_is_mplane(dev) ? "with" : "without"); + caps & (V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_CAPTURE) ? "capture" : "output", + caps & (V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_OUTPUT_MPLANE) ? "with" : "without"); + + *capabilities = caps; + return 0; } |