Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


v4l2-mediabus.h
001: /*
002:  * Media Bus API header
003:  *
004:  * Copyright (C) 2009, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
005:  *
006:  * This program is free software; you can redistribute it and/or modify
007:  * it under the terms of the GNU General Public License version 2 as
008:  * published by the Free Software Foundation.
009:  */
010: 
011: #ifndef __LINUX_V4L2_MEDIABUS_H
012: #define __LINUX_V4L2_MEDIABUS_H
013: 
014: #include <linux/types.h>
015: #include <linux/videodev2.h>
016: 
017: /*
018:  * These pixel codes uniquely identify data formats on the media bus. Mostly
019:  * they correspond to similarly named V4L2_PIX_FMT_* formats, format 0 is
020:  * reserved, V4L2_MBUS_FMT_FIXED shall be used by host-client pairs, where the
021:  * data format is fixed. Additionally, "2X8" means that one pixel is transferred
022:  * in two 8-bit samples, "BE" or "LE" specify in which order those samples are
023:  * transferred over the bus: "LE" means that the least significant bits are
024:  * transferred first, "BE" means that the most significant bits are transferred
025:  * first, and "PADHI" and "PADLO" define which bits - low or high, in the
026:  * incomplete high byte, are filled with padding bits.
027:  *
028:  * The pixel codes are grouped by type, bus_width, bits per component, samples
029:  * per pixel and order of subsamples. Numerical values are sorted using generic
030:  * numerical sort order (8 thus comes before 10).
031:  *
032:  * As their value can't change when a new pixel code is inserted in the
033:  * enumeration, the pixel codes are explicitly given a numerical value. The next
034:  * free values for each category are listed below, update them when inserting
035:  * new pixel codes.
036:  */
037: enum v4l2_mbus_pixelcode {
038:         V4L2_MBUS_FMT_FIXED = 0x0001,
039: 
040:         /* RGB - next is 0x1009 */
041:         V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE = 0x1001,
042:         V4L2_MBUS_FMT_RGB444_2X8_PADHI_LE = 0x1002,
043:         V4L2_MBUS_FMT_RGB555_2X8_PADHI_BE = 0x1003,
044:         V4L2_MBUS_FMT_RGB555_2X8_PADHI_LE = 0x1004,
045:         V4L2_MBUS_FMT_BGR565_2X8_BE = 0x1005,
046:         V4L2_MBUS_FMT_BGR565_2X8_LE = 0x1006,
047:         V4L2_MBUS_FMT_RGB565_2X8_BE = 0x1007,
048:         V4L2_MBUS_FMT_RGB565_2X8_LE = 0x1008,
049: 
050:         /* YUV (including grey) - next is 0x2014 */
051:         V4L2_MBUS_FMT_Y8_1X8 = 0x2001,
052:         V4L2_MBUS_FMT_UYVY8_1_5X8 = 0x2002,
053:         V4L2_MBUS_FMT_VYUY8_1_5X8 = 0x2003,
054:         V4L2_MBUS_FMT_YUYV8_1_5X8 = 0x2004,
055:         V4L2_MBUS_FMT_YVYU8_1_5X8 = 0x2005,
056:         V4L2_MBUS_FMT_UYVY8_2X8 = 0x2006,
057:         V4L2_MBUS_FMT_VYUY8_2X8 = 0x2007,
058:         V4L2_MBUS_FMT_YUYV8_2X8 = 0x2008,
059:         V4L2_MBUS_FMT_YVYU8_2X8 = 0x2009,
060:         V4L2_MBUS_FMT_Y10_1X10 = 0x200a,
061:         V4L2_MBUS_FMT_YUYV10_2X10 = 0x200b,
062:         V4L2_MBUS_FMT_YVYU10_2X10 = 0x200c,
063:         V4L2_MBUS_FMT_Y12_1X12 = 0x2013,
064:         V4L2_MBUS_FMT_UYVY8_1X16 = 0x200f,
065:         V4L2_MBUS_FMT_VYUY8_1X16 = 0x2010,
066:         V4L2_MBUS_FMT_YUYV8_1X16 = 0x2011,
067:         V4L2_MBUS_FMT_YVYU8_1X16 = 0x2012,
068:         V4L2_MBUS_FMT_YUYV10_1X20 = 0x200d,
069:         V4L2_MBUS_FMT_YVYU10_1X20 = 0x200e,
070: 
071:         /* Bayer - next is 0x3015 */
072:         V4L2_MBUS_FMT_SBGGR8_1X8 = 0x3001,
073:         V4L2_MBUS_FMT_SGBRG8_1X8 = 0x3013,
074:         V4L2_MBUS_FMT_SGRBG8_1X8 = 0x3002,
075:         V4L2_MBUS_FMT_SRGGB8_1X8 = 0x3014,
076:         V4L2_MBUS_FMT_SBGGR10_DPCM8_1X8 = 0x300b,
077:         V4L2_MBUS_FMT_SGBRG10_DPCM8_1X8 = 0x300c,
078:         V4L2_MBUS_FMT_SGRBG10_DPCM8_1X8 = 0x3009,
079:         V4L2_MBUS_FMT_SRGGB10_DPCM8_1X8 = 0x300d,
080:         V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_BE = 0x3003,
081:         V4L2_MBUS_FMT_SBGGR10_2X8_PADHI_LE = 0x3004,
082:         V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_BE = 0x3005,
083:         V4L2_MBUS_FMT_SBGGR10_2X8_PADLO_LE = 0x3006,
084:         V4L2_MBUS_FMT_SBGGR10_1X10 = 0x3007,
085:         V4L2_MBUS_FMT_SGBRG10_1X10 = 0x300e,
086:         V4L2_MBUS_FMT_SGRBG10_1X10 = 0x300a,
087:         V4L2_MBUS_FMT_SRGGB10_1X10 = 0x300f,
088:         V4L2_MBUS_FMT_SBGGR12_1X12 = 0x3008,
089:         V4L2_MBUS_FMT_SGBRG12_1X12 = 0x3010,
090:         V4L2_MBUS_FMT_SGRBG12_1X12 = 0x3011,
091:         V4L2_MBUS_FMT_SRGGB12_1X12 = 0x3012,
092: 
093:         /* JPEG compressed formats - next is 0x4002 */
094:         V4L2_MBUS_FMT_JPEG_1X8 = 0x4001,
095: };
096: 
097: /**
098:  * struct v4l2_mbus_framefmt - frame format on the media bus
099:  * @width:      frame width
100:  * @height:     frame height
101:  * @code:       data format code (from enum v4l2_mbus_pixelcode)
102:  * @field:      used interlacing type (from enum v4l2_field)
103:  * @colorspace: colorspace of the data (from enum v4l2_colorspace)
104:  */
105: struct v4l2_mbus_framefmt {
106:         __u32                   width;
107:         __u32                   height;
108:         __u32                   code;
109:         __u32                   field;
110:         __u32                   colorspace;
111:         __u32                   reserved[7];
112: };
113: 
114: #endif
115: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/