From: Luis de Bethencourt Date: Fri, 8 Jul 2016 17:28:19 +0000 (+0000) Subject: v4l2: fix multiplanar capture X-Git-Tag: 1.10.4~267 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eaa01071e0f5eea915edfd3510f6f3b71930576c;p=platform%2Fupstream%2Fgst-plugins-good.git 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 --- diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 8d8337e..da3daa4 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 } /******************************************************