v4l_id: check mplane video capture and output capailities (#8464)
authorJui-Chi Ricky Liang <juichi.liang@gmail.com>
Tue, 20 Mar 2018 08:54:18 +0000 (16:54 +0800)
committerLennart Poettering <lennart@poettering.net>
Tue, 20 Mar 2018 08:54:18 +0000 (09:54 +0100)
Video devices using mplane buffer API declare capture and output
capabilities with V4L2_CAP_VIDEO_CAPTURE_MPLANE and
V4L2_CAP_VIDEO_OUTPUT_MPLANE.

src/udev/v4l_id/v4l_id.c

index 05f31d4..8c525c1 100644 (file)
@@ -68,9 +68,11 @@ int main(int argc, char *argv[]) {
                 printf("ID_V4L_VERSION=2\n");
                 printf("ID_V4L_PRODUCT=%s\n", v2cap.card);
                 printf("ID_V4L_CAPABILITIES=:");
-                if ((v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0)
+                if ((v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) > 0 ||
+                    (v2cap.capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) > 0)
                         printf("capture:");
-                if ((v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) > 0)
+                if ((v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT) > 0 ||
+                    (v2cap.capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE) > 0)
                         printf("video_output:");
                 if ((v2cap.capabilities & V4L2_CAP_VIDEO_OVERLAY) > 0)
                         printf("video_overlay:");