From eaa01071e0f5eea915edfd3510f6f3b71930576c Mon Sep 17 00:00:00 2001 From: Luis de Bethencourt Date: Fri, 8 Jul 2016 17:28:19 +0000 Subject: [PATCH] v4l2: fix multiplanar capture After switching to using V4L2_CAP_DEVICE_CAPS we lost support for multiplanar device types. After some research, it looks like vcap.capabilities treated the multiplanar flag of output and capture devices equally, but not the new device_caps. https://bugzilla.gnome.org/show_bug.cgi?id=768195 --- sys/v4l2/v4l2_calls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 8d8337e6eb..da3daa4999 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -489,16 +489,17 @@ gst_v4l2_adjust_buf_type (GstV4l2Object * v4l2object) * in a contiguous manner. In this case the first v4l2 plane * contains all the gst planes. */ -#define CHECK_CAPS (V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE) switch (v4l2object->type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (v4l2object->device_caps & CHECK_CAPS) { + if (v4l2object->device_caps & + (V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE)) { GST_DEBUG ("adjust type to multi-planar output"); v4l2object->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; } break; case V4L2_BUF_TYPE_VIDEO_CAPTURE: - if (v4l2object->device_caps & CHECK_CAPS) { + if (v4l2object->device_caps & + (V4L2_CAP_VIDEO_CAPTURE_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE)) { GST_DEBUG ("adjust type to multi-planar capture"); v4l2object->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; } @@ -506,7 +507,6 @@ gst_v4l2_adjust_buf_type (GstV4l2Object * v4l2object) default: break; } -#undef CHECK_CAPS } /******************************************************