V4L/DVB: v4l2-mediabus.h: add two helper functions
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 8 May 2010 20:08:58 +0000 (17:08 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 1 Jun 2010 04:21:24 +0000 (01:21 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
include/media/v4l2-mediabus.h

index 0dbe02a..d8e1608 100644 (file)
@@ -58,4 +58,24 @@ struct v4l2_mbus_framefmt {
        enum v4l2_colorspace            colorspace;
 };
 
+static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
+                               const struct v4l2_mbus_framefmt *mbus_fmt)
+{
+       pix_fmt->width = mbus_fmt->width;
+       pix_fmt->height = mbus_fmt->height;
+       pix_fmt->field = mbus_fmt->field;
+       pix_fmt->colorspace = mbus_fmt->colorspace;
+}
+
+static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
+                          const struct v4l2_pix_format *pix_fmt,
+                          enum v4l2_mbus_pixelcode code)
+{
+       mbus_fmt->width = pix_fmt->width;
+       mbus_fmt->height = pix_fmt->height;
+       mbus_fmt->field = pix_fmt->field;
+       mbus_fmt->colorspace = pix_fmt->colorspace;
+       mbus_fmt->code = code;
+}
+
 #endif