From bbe738f9a29d240c6cc0b4f17e463193b719aa7e Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 16 Mar 2015 17:27:13 +0200 Subject: 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 Acked-by: Sakari Ailus --- yavta.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'yavta.c') diff --git a/yavta.c b/yavta.c index eedf889..930645d 100644 --- a/yavta.c +++ b/yavta.c @@ -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; } -- cgit v1.2.3