v4l2: fix build break using V4L2_CAP_VIDEO_M2M_MPLANE

This may not be defined. Since the previous version used
only the other define (V4L2_CAP_VIDEO_OUTPUT_MPLANE), fall
back on this only when not available.
This commit is contained in:
Vincent Penquerc'h 2014-01-13 09:14:00 +00:00
parent 8eb4b032be
commit b80e3a4690

View file

@ -481,17 +481,21 @@ gst_v4l2_adjust_buf_type (GstV4l2Object * v4l2object)
* in a contiguous manner. In this case the first v4l2 plane * in a contiguous manner. In this case the first v4l2 plane
* contains all the gst planes. * 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) { switch (v4l2object->type) {
case V4L2_BUF_TYPE_VIDEO_OUTPUT: case V4L2_BUF_TYPE_VIDEO_OUTPUT:
if (v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE if (v4l2object->vcap.capabilities & CHECK_CAPS) {
|| v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE) {
GST_DEBUG ("adjust type to multi-planar output"); GST_DEBUG ("adjust type to multi-planar output");
v4l2object->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; v4l2object->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
} }
break; break;
case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_CAPTURE:
if (v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE if (v4l2object->vcap.capabilities & CHECK_CAPS) {
|| v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_M2M_MPLANE) {
/* FIXME: for now it's an untested case so just put a warning */ /* FIXME: for now it's an untested case so just put a warning */
GST_WARNING ("untested V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE"); GST_WARNING ("untested V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE");