If the requested field order is not supported default to progressive as
we can't guess how the user will configure the pipeline later on.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Enrico Butera <ebutera@users.sourceforge.net>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
if (format->type != video->type)
return -EINVAL;
+ /* Default to the progressive field order if the requested value is not
+ * supported (or set to ANY). The only supported orders are progressive
+ * (available on all video nodes) and alternate (available on capture
+ * nodes only).
+ */
+ if (format->fmt.pix.field != V4L2_FIELD_ALTERNATE ||
+ video->type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
+ format->fmt.pix.field = V4L2_FIELD_NONE;
+
/* Fill the bytesperline and sizeimage fields by converting to media bus
* format and back to pixel format.
*/