blob: 971c7fa29614092cc35fd4cf736ece5c54df5d3e [file] [log] [blame]
Guennadi Liakhovetski9a742512009-12-11 11:41:28 -03001/*
2 * Media Bus API header
3 *
4 * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef V4L2_MEDIABUS_H
12#define V4L2_MEDIABUS_H
13
Laurent Pinchart2ef2d5a2010-03-15 19:33:31 -030014#include <linux/v4l2-mediabus.h>
Guennadi Liakhovetski9a742512009-12-11 11:41:28 -030015
Hans Verkuil3a21cee2010-05-08 17:08:58 -030016static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
17 const struct v4l2_mbus_framefmt *mbus_fmt)
18{
19 pix_fmt->width = mbus_fmt->width;
20 pix_fmt->height = mbus_fmt->height;
21 pix_fmt->field = mbus_fmt->field;
22 pix_fmt->colorspace = mbus_fmt->colorspace;
23}
24
25static inline void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt,
26 const struct v4l2_pix_format *pix_fmt,
27 enum v4l2_mbus_pixelcode code)
28{
29 mbus_fmt->width = pix_fmt->width;
30 mbus_fmt->height = pix_fmt->height;
31 mbus_fmt->field = pix_fmt->field;
32 mbus_fmt->colorspace = pix_fmt->colorspace;
33 mbus_fmt->code = code;
34}
35
Guennadi Liakhovetski9a742512009-12-11 11:41:28 -030036#endif