diff --git a/sys/v4l2/v4l2_calls.c b/sys/v4l2/v4l2_calls.c index 01c0e49d6f..7b2a4e4610 100644 --- a/sys/v4l2/v4l2_calls.c +++ b/sys/v4l2/v4l2_calls.c @@ -481,17 +481,21 @@ gst_v4l2_adjust_buf_type (GstV4l2Object * v4l2object) * in a contiguous manner. In this case the first v4l2 plane * contains all the gst planes. */ +#ifdef V4L2_CAP_VIDEO_M2M_MPLANE +#define CHECK_CAPS (V4L2_CAP_VIDEO_OUTPUT_MPLANE | V4L2_CAP_VIDEO_M2M_MPLANE) +#else +#define CHECK_CAPS (V4L2_CAP_VIDEO_OUTPUT_MPLANE) +#endif + switch (v4l2object->type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT: - if (v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE - || v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE) { + if (v4l2object->vcap.capabilities & CHECK_CAPS) { 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->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE - || v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE) { + if (v4l2object->vcap.capabilities & CHECK_CAPS) { /* FIXME: for now it's an untested case so just put a warning */ GST_WARNING ("untested V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE");