|
| 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 __LINUX_V4L2_MEDIABUS_H |
| 12 | +#define __LINUX_V4L2_MEDIABUS_H |
| 13 | + |
| 14 | +#include <linux/types.h> |
| 15 | +#include <linux/videodev2.h> |
| 16 | + |
| 17 | +/* |
| 18 | + * These pixel codes uniquely identify data formats on the media bus. Mostly |
| 19 | + * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is |
| 20 | + * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the |
| 21 | + * data format is fixed. Additionally, "2X8" means that one pixel is transferred |
| 22 | + * in two 8-bit samples, "BE" or "LE" specify in which order those samples are |
| 23 | + * transferred over the bus: "LE" means that the least significant bits are |
| 24 | + * transferred first, "BE" means that the most significant bits are transferred |
| 25 | + * first, and "PADHI" and "PADLO" define which bits - low or high, in the |
| 26 | + * incomplete high byte, are filled with padding bits. |
| 27 | + */ |
| 28 | +enum v4l2_mbus_pixelcode { |
| 29 | + V4L2_MBUS_FMT_FIXED = 1, |
| 30 | + V4L2_MBUS_FMT_YUYV8_2X8, |
| 31 | + V4L2_MBUS_FMT_YVYU8_2X8, |
| 32 | + V4L2_MBUS_FMT_UYVY8_2X8, |
| 33 | + V4L2_MBUS_FMT_VYUY8_2X8, |
| 34 | + V4L2_MBUS_FMT_YVYU10_2X10, |
| 35 | + V4L2_MBUS_FMT_YUYV10_2X10, |
| 36 | + V4L2_MBUS_FMT_YVYU10_1X20, |
| 37 | + V4L2_MBUS_FMT_YUYV10_1X20, |
| 38 | + V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE, |
| 39 | + V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE, |
| 40 | + V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE, |
| 41 | + V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE, |
| 42 | + V4L2_MBUS_FMT_RGB565_2X8_LE, |
| 43 | + V4L2_MBUS_FMT_RGB565_2X8_BE, |
| 44 | + V4L2_MBUS_FMT_BGR565_2X8_LE, |
| 45 | + V4L2_MBUS_FMT_BGR565_2X8_BE, |
| 46 | + V4L2_MBUS_FMT_SBGGR8_1X8, |
| 47 | + V4L2_MBUS_FMT_SBGGR10_1X10, |
| 48 | + V4L2_MBUS_FMT_GREY8_1X8, |
| 49 | + V4L2_MBUS_FMT_Y10_1X10, |
| 50 | + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE, |
| 51 | + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE, |
| 52 | + V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE, |
| 53 | + V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE, |
| 54 | + V4L2_MBUS_FMT_SGRBG8_1X8, |
| 55 | + V4L2_MBUS_FMT_SBGGR12_1X12, |
| 56 | + V4L2_MBUS_FMT_YUYV8_1_5X8, |
| 57 | + V4L2_MBUS_FMT_YVYU8_1_5X8, |
| 58 | + V4L2_MBUS_FMT_UYVY8_1_5X8, |
| 59 | + V4L2_MBUS_FMT_VYUY8_1_5X8, |
| 60 | +}; |
| 61 | + |
| 62 | +/** |
| 63 | + * struct v4l2_mbus_framefmt - frame format on the media bus |
| 64 | + * @width: frame width |
| 65 | + * @height: frame height |
| 66 | + * @code: data format code |
| 67 | + * @field: used interlacing type |
| 68 | + * @colorspace: colorspace of the data |
| 69 | + */ |
| 70 | +struct v4l2_mbus_framefmt { |
| 71 | + __u32 width; |
| 72 | + __u32 height; |
| 73 | + __u32 code; |
| 74 | + enum v4l2_field field; |
| 75 | + enum v4l2_colorspace colorspace; |
| 76 | +}; |
| 77 | + |
| 78 | +#endif |
0 commit comments