diff options
Diffstat (limited to 'include/uapi/linux/videodev2.h')
| -rw-r--r-- | include/uapi/linux/videodev2.h | 114 |
1 files changed, 99 insertions, 15 deletions
diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 778a3298fb34..d279c1b75cf7 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h | |||
| @@ -79,6 +79,7 @@ | |||
| 79 | /* Four-character-code (FOURCC) */ | 79 | /* Four-character-code (FOURCC) */ |
| 80 | #define v4l2_fourcc(a, b, c, d)\ | 80 | #define v4l2_fourcc(a, b, c, d)\ |
| 81 | ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) | 81 | ((__u32)(a) | ((__u32)(b) << 8) | ((__u32)(c) << 16) | ((__u32)(d) << 24)) |
| 82 | #define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31)) | ||
| 82 | 83 | ||
| 83 | /* | 84 | /* |
| 84 | * E N U M S | 85 | * E N U M S |
| @@ -177,30 +178,103 @@ enum v4l2_memory { | |||
| 177 | 178 | ||
| 178 | /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ | 179 | /* see also http://vektor.theorem.ca/graphics/ycbcr/ */ |
| 179 | enum v4l2_colorspace { | 180 | enum v4l2_colorspace { |
| 180 | /* ITU-R 601 -- broadcast NTSC/PAL */ | 181 | /* SMPTE 170M: used for broadcast NTSC/PAL SDTV */ |
| 181 | V4L2_COLORSPACE_SMPTE170M = 1, | 182 | V4L2_COLORSPACE_SMPTE170M = 1, |
| 182 | 183 | ||
| 183 | /* 1125-Line (US) HDTV */ | 184 | /* Obsolete pre-1998 SMPTE 240M HDTV standard, superseded by Rec 709 */ |
| 184 | V4L2_COLORSPACE_SMPTE240M = 2, | 185 | V4L2_COLORSPACE_SMPTE240M = 2, |
| 185 | 186 | ||
| 186 | /* HD and modern captures. */ | 187 | /* Rec.709: used for HDTV */ |
| 187 | V4L2_COLORSPACE_REC709 = 3, | 188 | V4L2_COLORSPACE_REC709 = 3, |
| 188 | 189 | ||
| 189 | /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */ | 190 | /* |
| 191 | * Deprecated, do not use. No driver will ever return this. This was | ||
| 192 | * based on a misunderstanding of the bt878 datasheet. | ||
| 193 | */ | ||
| 190 | V4L2_COLORSPACE_BT878 = 4, | 194 | V4L2_COLORSPACE_BT878 = 4, |
| 191 | 195 | ||
| 192 | /* These should be useful. Assume 601 extents. */ | 196 | /* |
| 197 | * NTSC 1953 colorspace. This only makes sense when dealing with | ||
| 198 | * really, really old NTSC recordings. Superseded by SMPTE 170M. | ||
| 199 | */ | ||
| 193 | V4L2_COLORSPACE_470_SYSTEM_M = 5, | 200 | V4L2_COLORSPACE_470_SYSTEM_M = 5, |
| 201 | |||
| 202 | /* | ||
| 203 | * EBU Tech 3213 PAL/SECAM colorspace. This only makes sense when | ||
| 204 | * dealing with really old PAL/SECAM recordings. Superseded by | ||
| 205 | * SMPTE 170M. | ||
| 206 | */ | ||
| 194 | V4L2_COLORSPACE_470_SYSTEM_BG = 6, | 207 | V4L2_COLORSPACE_470_SYSTEM_BG = 6, |
| 195 | 208 | ||
| 196 | /* I know there will be cameras that send this. So, this is | 209 | /* |
| 197 | * unspecified chromaticities and full 0-255 on each of the | 210 | * Effectively shorthand for V4L2_COLORSPACE_SRGB, V4L2_YCBCR_ENC_601 |
| 198 | * Y'CbCr components | 211 | * and V4L2_QUANTIZATION_FULL_RANGE. To be used for (Motion-)JPEG. |
| 199 | */ | 212 | */ |
| 200 | V4L2_COLORSPACE_JPEG = 7, | 213 | V4L2_COLORSPACE_JPEG = 7, |
| 201 | 214 | ||
| 202 | /* For RGB colourspaces, this is probably a good start. */ | 215 | /* For RGB colorspaces such as produces by most webcams. */ |
| 203 | V4L2_COLORSPACE_SRGB = 8, | 216 | V4L2_COLORSPACE_SRGB = 8, |
| 217 | |||
| 218 | /* AdobeRGB colorspace */ | ||
| 219 | V4L2_COLORSPACE_ADOBERGB = 9, | ||
| 220 | |||
| 221 | /* BT.2020 colorspace, used for UHDTV. */ | ||
| 222 | V4L2_COLORSPACE_BT2020 = 10, | ||
| 223 | }; | ||
| 224 | |||
| 225 | enum v4l2_ycbcr_encoding { | ||
| 226 | /* | ||
| 227 | * Mapping of V4L2_YCBCR_ENC_DEFAULT to actual encodings for the | ||
| 228 | * various colorspaces: | ||
| 229 | * | ||
| 230 | * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, | ||
| 231 | * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_ADOBERGB and | ||
| 232 | * V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 | ||
| 233 | * | ||
| 234 | * V4L2_COLORSPACE_REC709: V4L2_YCBCR_ENC_709 | ||
| 235 | * | ||
| 236 | * V4L2_COLORSPACE_SRGB: V4L2_YCBCR_ENC_SYCC | ||
| 237 | * | ||
| 238 | * V4L2_COLORSPACE_BT2020: V4L2_YCBCR_ENC_BT2020 | ||
| 239 | * | ||
| 240 | * V4L2_COLORSPACE_SMPTE240M: V4L2_YCBCR_ENC_SMPTE240M | ||
| 241 | */ | ||
| 242 | V4L2_YCBCR_ENC_DEFAULT = 0, | ||
| 243 | |||
| 244 | /* ITU-R 601 -- SDTV */ | ||
| 245 | V4L2_YCBCR_ENC_601 = 1, | ||
| 246 | |||
| 247 | /* Rec. 709 -- HDTV */ | ||
| 248 | V4L2_YCBCR_ENC_709 = 2, | ||
| 249 | |||
| 250 | /* ITU-R 601/EN 61966-2-4 Extended Gamut -- SDTV */ | ||
| 251 | V4L2_YCBCR_ENC_XV601 = 3, | ||
| 252 | |||
| 253 | /* Rec. 709/EN 61966-2-4 Extended Gamut -- HDTV */ | ||
| 254 | V4L2_YCBCR_ENC_XV709 = 4, | ||
| 255 | |||
| 256 | /* sYCC (Y'CbCr encoding of sRGB) */ | ||
| 257 | V4L2_YCBCR_ENC_SYCC = 5, | ||
| 258 | |||
| 259 | /* BT.2020 Non-constant Luminance Y'CbCr */ | ||
| 260 | V4L2_YCBCR_ENC_BT2020 = 6, | ||
| 261 | |||
| 262 | /* BT.2020 Constant Luminance Y'CbcCrc */ | ||
| 263 | V4L2_YCBCR_ENC_BT2020_CONST_LUM = 7, | ||
| 264 | |||
| 265 | /* SMPTE 240M -- Obsolete HDTV */ | ||
| 266 | V4L2_YCBCR_ENC_SMPTE240M = 8, | ||
| 267 | }; | ||
| 268 | |||
| 269 | enum v4l2_quantization { | ||
| 270 | /* | ||
| 271 | * The default for R'G'B' quantization is always full range. For | ||
| 272 | * Y'CbCr the quantization is always limited range, except for | ||
| 273 | * SYCC, XV601, XV709 or JPEG: those are full range. | ||
| 274 | */ | ||
| 275 | V4L2_QUANTIZATION_DEFAULT = 0, | ||
| 276 | V4L2_QUANTIZATION_FULL_RANGE = 1, | ||
| 277 | V4L2_QUANTIZATION_LIM_RANGE = 2, | ||
| 204 | }; | 278 | }; |
| 205 | 279 | ||
| 206 | enum v4l2_priority { | 280 | enum v4l2_priority { |
| @@ -293,6 +367,8 @@ struct v4l2_pix_format { | |||
| 293 | __u32 colorspace; /* enum v4l2_colorspace */ | 367 | __u32 colorspace; /* enum v4l2_colorspace */ |
| 294 | __u32 priv; /* private data, depends on pixelformat */ | 368 | __u32 priv; /* private data, depends on pixelformat */ |
| 295 | __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ | 369 | __u32 flags; /* format flags (V4L2_PIX_FMT_FLAG_*) */ |
| 370 | __u32 ycbcr_enc; /* enum v4l2_ycbcr_encoding */ | ||
| 371 | __u32 quantization; /* enum v4l2_quantization */ | ||
| 296 | }; | 372 | }; |
| 297 | 373 | ||
| 298 | /* Pixel format FOURCC depth Description */ | 374 | /* Pixel format FOURCC depth Description */ |
| @@ -307,6 +383,8 @@ struct v4l2_pix_format { | |||
| 307 | #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */ | 383 | #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */ |
| 308 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ | 384 | #define V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */ |
| 309 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ | 385 | #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */ |
| 386 | #define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */ | ||
| 387 | #define V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5') /* 16 XRGB-5-5-5 BE */ | ||
| 310 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ | 388 | #define V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */ |
| 311 | #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */ | 389 | #define V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */ |
| 312 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ | 390 | #define V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */ |
| @@ -1246,6 +1324,7 @@ struct v4l2_input { | |||
| 1246 | #define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | 1324 | #define V4L2_IN_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ |
| 1247 | #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */ | 1325 | #define V4L2_IN_CAP_CUSTOM_TIMINGS V4L2_IN_CAP_DV_TIMINGS /* For compatibility */ |
| 1248 | #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ | 1326 | #define V4L2_IN_CAP_STD 0x00000004 /* Supports S_STD */ |
| 1327 | #define V4L2_IN_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */ | ||
| 1249 | 1328 | ||
| 1250 | /* | 1329 | /* |
| 1251 | * V I D E O O U T P U T S | 1330 | * V I D E O O U T P U T S |
| @@ -1269,6 +1348,7 @@ struct v4l2_output { | |||
| 1269 | #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ | 1348 | #define V4L2_OUT_CAP_DV_TIMINGS 0x00000002 /* Supports S_DV_TIMINGS */ |
| 1270 | #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */ | 1349 | #define V4L2_OUT_CAP_CUSTOM_TIMINGS V4L2_OUT_CAP_DV_TIMINGS /* For compatibility */ |
| 1271 | #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ | 1350 | #define V4L2_OUT_CAP_STD 0x00000004 /* Supports S_STD */ |
| 1351 | #define V4L2_OUT_CAP_NATIVE_SIZE 0x00000008 /* Supports setting native size */ | ||
| 1272 | 1352 | ||
| 1273 | /* | 1353 | /* |
| 1274 | * C O N T R O L S | 1354 | * C O N T R O L S |
| @@ -1285,11 +1365,11 @@ struct v4l2_ext_control { | |||
| 1285 | union { | 1365 | union { |
| 1286 | __s32 value; | 1366 | __s32 value; |
| 1287 | __s64 value64; | 1367 | __s64 value64; |
| 1288 | char *string; | 1368 | char __user *string; |
| 1289 | __u8 *p_u8; | 1369 | __u8 __user *p_u8; |
| 1290 | __u16 *p_u16; | 1370 | __u16 __user *p_u16; |
| 1291 | __u32 *p_u32; | 1371 | __u32 __user *p_u32; |
| 1292 | void *ptr; | 1372 | void __user *ptr; |
| 1293 | }; | 1373 | }; |
| 1294 | } __attribute__ ((packed)); | 1374 | } __attribute__ ((packed)); |
| 1295 | 1375 | ||
| @@ -1774,6 +1854,8 @@ struct v4l2_plane_pix_format { | |||
| 1774 | * @plane_fmt: per-plane information | 1854 | * @plane_fmt: per-plane information |
| 1775 | * @num_planes: number of planes for this format | 1855 | * @num_planes: number of planes for this format |
| 1776 | * @flags: format flags (V4L2_PIX_FMT_FLAG_*) | 1856 | * @flags: format flags (V4L2_PIX_FMT_FLAG_*) |
| 1857 | * @ycbcr_enc: enum v4l2_ycbcr_encoding, Y'CbCr encoding | ||
| 1858 | * @quantization: enum v4l2_quantization, colorspace quantization | ||
| 1777 | */ | 1859 | */ |
| 1778 | struct v4l2_pix_format_mplane { | 1860 | struct v4l2_pix_format_mplane { |
| 1779 | __u32 width; | 1861 | __u32 width; |
| @@ -1785,7 +1867,9 @@ struct v4l2_pix_format_mplane { | |||
| 1785 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; | 1867 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; |
| 1786 | __u8 num_planes; | 1868 | __u8 num_planes; |
| 1787 | __u8 flags; | 1869 | __u8 flags; |
| 1788 | __u8 reserved[10]; | 1870 | __u8 ycbcr_enc; |
| 1871 | __u8 quantization; | ||
| 1872 | __u8 reserved[8]; | ||
| 1789 | } __attribute__ ((packed)); | 1873 | } __attribute__ ((packed)); |
| 1790 | 1874 | ||
| 1791 | /** | 1875 | /** |
