xref: /linux/include/media/v4l2-mediabus.h (revision e9e8bcb8178e197d889ec31e79fa1ddc1732c8f9)
1 /*
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 
14 #include <linux/v4l2-mediabus.h>
15 
16 static 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 
25 static 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 
36 #endif
37