v4l2: print known pixel/SDR formats

* xlat/v4l2_pix_fmts.in: New file.
* xlat/v4l2_sdr_fmts.in: Likewise.
* v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): New macro.
(print_pixelformat): Add xlat parameter, print constant name
as a comment if it has been found in xlat.
(print_v4l2_fmtdesc, print_v4l2_frmivalenum): Pass v4l2_pix_fmts
to print_pixelformat.
(print_v4l2_format_fmt) <case V4L2_BUF_TYPE_VIDEO_CAPTURE, case
V4L2_BUF_TYPE_VIDEO_OUTPUT, case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, case V4L2_BUF_TYPE_VBI_CAPTURE,
case V4L2_BUF_TYPE_VBI_OUTPUT>: Pass v4l2_pix_fmts to print_pixelformat.
(print_v4l2_format_fmt) <case V4L2_BUF_TYPE_SDR_OUTPUT, case
V4L2_BUF_TYPE_SDR_CAPTURE>: Pass v4l2_sdr_fmts to print_pixelformat.
* tests/v4l2.c: Test it, update expected output.
* NEWS: Mention it.
This commit is contained in:
Eugene Syromyatnikov 2018-02-15 21:16:15 +01:00 committed by Dmitry V. Levin
parent b82706f412
commit cfa55479c2
5 changed files with 276 additions and 37 deletions

2
NEWS
View File

@ -15,6 +15,8 @@ Noteworthy changes in release ?.?? (????-??-??)
* Updated lists of signal codes.
* Updated lists of INET_DIAG_BC_*, POLL*, RWF_*, and SCHED_FLAG_* constants.
* Implemented block/character device number printing in -yy mode.
* Known pixel/SDR format names are printed as comments for pixelformat fields
in v4l2 structures.
* Bug fixes
* Fixed build on m68k.

View File

@ -27,6 +27,7 @@
*/
#include "tests.h"
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
@ -44,6 +45,10 @@
((unsigned int)(a3) << 24))
static const unsigned int magic = 0xdeadbeef;
static const unsigned int pf_magic = fourcc('S', '5', '0', '8');
#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT
static const unsigned int sf_magic = fourcc('R', 'U', '1', '2');
#endif
static void
init_v4l2_format(struct v4l2_format *const f,
@ -56,7 +61,10 @@ init_v4l2_format(struct v4l2_format *const f,
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
f->fmt.pix.width = 0x657b8160;
f->fmt.pix.height = 0x951c0047;
f->fmt.pix.pixelformat = magic;
if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
f->fmt.pix.pixelformat = magic;
else
f->fmt.pix.pixelformat = pf_magic;
f->fmt.pix.field = V4L2_FIELD_NONE;
f->fmt.pix.bytesperline = 0xdf20d185;
f->fmt.pix.sizeimage = 0x0cf7be41;
@ -70,7 +78,10 @@ init_v4l2_format(struct v4l2_format *const f,
f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
f->fmt.pix_mp.width = 0x1f3b774b;
f->fmt.pix_mp.height = 0xab96a8d6;
f->fmt.pix_mp.pixelformat = magic;
if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
f->fmt.pix_mp.pixelformat = magic;
else
f->fmt.pix_mp.pixelformat = pf_magic;
f->fmt.pix_mp.field = V4L2_FIELD_NONE;
f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG;
struct v4l2_plane_pix_format *cur_pix =
@ -117,7 +128,10 @@ init_v4l2_format(struct v4l2_format *const f,
f->fmt.vbi.sampling_rate = 0x3d9b5b79;
f->fmt.vbi.offset = 0x055b3a09;
f->fmt.vbi.samples_per_line = 0xf176d436;
f->fmt.vbi.sample_format = magic;
if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE)
f->fmt.vbi.sample_format = magic;
else
f->fmt.vbi.sample_format = pf_magic;
f->fmt.vbi.start[0] = 0x9858e2eb;
f->fmt.vbi.start[1] = 0x8a4dc8c1;
f->fmt.vbi.count[0] = 0x4bcf36a3;
@ -142,10 +156,12 @@ init_v4l2_format(struct v4l2_format *const f,
#endif
#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT
case V4L2_BUF_TYPE_SDR_OUTPUT:
f->fmt.sdr.pixelformat = sf_magic;
#endif
#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE
case V4L2_BUF_TYPE_SDR_CAPTURE:
f->fmt.sdr.pixelformat = magic;
if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE)
f->fmt.sdr.pixelformat = magic;
#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
f->fmt.sdr.buffersize = 0x25afabfb;
#endif
@ -159,18 +175,30 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
const char *request, const unsigned int buf_type,
const char *buf_type_string)
{
int saved_errno;
switch (buf_type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
saved_errno = errno;
printf("ioctl(-1, %s, {type=%s"
", fmt.pix={width=%u, height=%u, pixelformat="
"v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')"
", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u"
", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n",
", fmt.pix={width=%u, height=%u, pixelformat=",
request,
buf_type_string,
f->fmt.pix.width, f->fmt.pix.height,
cc0(magic), cc1(magic), cc2(magic), cc3(magic),
f->fmt.pix.width, f->fmt.pix.height);
if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')",
cc0(magic), cc1(magic), cc2(magic), cc3(magic));
else
printf("v4l2_fourcc('%c', '%c', '%c', '%c') "
"/* V4L2_PIX_FMT_SPCA508 */",
cc0(pf_magic), cc1(pf_magic), cc2(pf_magic),
cc3(pf_magic));
errno = saved_errno;
printf(", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u"
", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n",
f->fmt.pix.bytesperline,
f->fmt.pix.sizeimage);
break;
@ -179,16 +207,25 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: {
unsigned int i;
saved_errno = errno;
printf("ioctl(-1, %s"
", {type=%s"
", fmt.pix_mp={width=%u, height=%u, pixelformat="
"v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')"
", field=V4L2_FIELD_NONE, colorspace="
"V4L2_COLORSPACE_JPEG, plane_fmt=[",
", fmt.pix_mp={width=%u, height=%u, pixelformat=",
request,
buf_type_string,
f->fmt.pix_mp.width, f->fmt.pix_mp.height,
cc0(magic), cc1(magic), cc2(magic), cc3(magic));
f->fmt.pix_mp.width, f->fmt.pix_mp.height);
if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')",
cc0(magic), cc1(magic), cc2(magic), cc3(magic));
else
printf("v4l2_fourcc('%c', '%c', '%c', '%c') "
"/* V4L2_PIX_FMT_SPCA508 */",
cc0(pf_magic), cc1(pf_magic), cc2(pf_magic),
cc3(pf_magic));
printf(", field=V4L2_FIELD_NONE, colorspace="
"V4L2_COLORSPACE_JPEG, plane_fmt=[");
for (i = 0;
i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt);
++i) {
@ -198,6 +235,7 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
f->fmt.pix_mp.plane_fmt[i].sizeimage,
f->fmt.pix_mp.plane_fmt[i].bytesperline);
}
errno = saved_errno;
printf("], num_planes=%u}}) = -1 EBADF (%m)\n",
f->fmt.pix_mp.num_planes);
break;
@ -238,18 +276,28 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
break;
case V4L2_BUF_TYPE_VBI_CAPTURE:
case V4L2_BUF_TYPE_VBI_OUTPUT:
saved_errno = errno;
printf("ioctl(-1, %s, {type=%s"
", fmt.vbi={sampling_rate=%u, offset=%u"
", samples_per_line=%u, sample_format="
"v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')"
", start=[%u, %u], count=[%u, %u]"
", flags=V4L2_VBI_INTERLACED}})"
" = -1 EBADF (%m)\n",
", samples_per_line=%u, sample_format=",
request,
buf_type_string,
f->fmt.vbi.sampling_rate, f->fmt.vbi.offset,
f->fmt.vbi.samples_per_line,
cc0(magic), cc1(magic), cc2(magic), cc3(magic),
f->fmt.vbi.samples_per_line);
if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE)
printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')",
cc0(magic), cc1(magic), cc2(magic), cc3(magic));
else
printf("v4l2_fourcc('%c', '%c', '%c', '%c') "
"/* V4L2_PIX_FMT_SPCA508 */",
cc0(pf_magic), cc1(pf_magic), cc2(pf_magic),
cc3(pf_magic));
errno = saved_errno;
printf(", start=[%u, %u], count=[%u, %u]"
", flags=V4L2_VBI_INTERLACED}})"
" = -1 EBADF (%m)\n",
f->fmt.vbi.start[0], f->fmt.vbi.start[1],
f->fmt.vbi.count[0], f->fmt.vbi.count[1]);
break;
@ -289,16 +337,29 @@ dprint_ioctl_v4l2(struct v4l2_format *const f,
#endif
#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE
case V4L2_BUF_TYPE_SDR_CAPTURE:
saved_errno = errno;
printf("ioctl(-1, %s, {type=%s"
", fmt.sdr={pixelformat=v4l2_fourcc('\\x%x', '\\x%x',"
" '\\x%x', '\\x%x')"
", fmt.sdr={pixelformat=",
request,
buf_type_string);
if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE)
printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')",
cc0(magic), cc1(magic), cc2(magic), cc3(magic));
# if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT
else
printf("v4l2_fourcc('%c', '%c', '%c', '%c') "
"/* V4L2_SDR_FMT_RU12LE */",
cc0(sf_magic), cc1(sf_magic), cc2(sf_magic),
cc3(sf_magic));
# endif
errno = saved_errno;
printf(
#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
", buffersize=%u"
#endif
"}}) = -1 EBADF (%m)\n",
request,
buf_type_string,
cc0(magic), cc1(magic), cc2(magic), cc3(magic)
"}}) = -1 EBADF (%m)\n"
#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
, f->fmt.sdr.buffersize
#endif

31
v4l2.c
View File

@ -75,14 +75,22 @@ typedef struct v4l2_standard struct_v4l2_standard;
#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
#endif
/* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */
#ifndef v4l2_fourcc_be
# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31))
#endif
#define FMT_FRACT "%u/%u"
#define ARGS_FRACT(x) ((x).numerator), ((x).denominator)
#define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}"
#define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height
#include "xlat/v4l2_pix_fmts.h"
#include "xlat/v4l2_sdr_fmts.h"
static void
print_pixelformat(uint32_t fourcc)
print_pixelformat(uint32_t fourcc, const struct xlat *xlat)
{
unsigned char a[] = {
(unsigned char) fourcc,
@ -129,6 +137,13 @@ print_pixelformat(uint32_t fourcc)
}
}
tprints(")");
if (xlat) {
const char *pixfmt_name = xlookup(xlat, fourcc);
if (pixfmt_name)
tprints_comment(pixfmt_name);
}
}
#include "xlat/v4l2_device_capabilities_flags.h"
@ -184,7 +199,7 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg)
"V4L2_FMT_FLAG_???");
PRINT_FIELD_CSTRING(", ", f, description);
tprints(", pixelformat=");
print_pixelformat(f.pixelformat);
print_pixelformat(f.pixelformat, v4l2_pix_fmts);
}
tprints("}");
return RVAL_IOCTL_DECODED;
@ -214,7 +229,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
tprints(prefix);
tprintf("fmt.pix={width=%u, height=%u, pixelformat=",
f->fmt.pix.width, f->fmt.pix.height);
print_pixelformat(f->fmt.pix.pixelformat);
print_pixelformat(f->fmt.pix.pixelformat, v4l2_pix_fmts);
tprints(", field=");
printxval(v4l2_fields, f->fmt.pix.field, "V4L2_FIELD_???");
tprintf(", bytesperline=%u, sizeimage=%u, colorspace=",
@ -231,7 +246,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
tprints(prefix);
tprintf("fmt.pix_mp={width=%u, height=%u, pixelformat=",
f->fmt.pix_mp.width, f->fmt.pix_mp.height);
print_pixelformat(f->fmt.pix_mp.pixelformat);
print_pixelformat(f->fmt.pix_mp.pixelformat, v4l2_pix_fmts);
tprints(", field=");
printxval(v4l2_fields, f->fmt.pix_mp.field, "V4L2_FIELD_???");
tprints(", colorspace=");
@ -282,7 +297,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
"samples_per_line=%u, sample_format=",
f->fmt.vbi.sampling_rate, f->fmt.vbi.offset,
f->fmt.vbi.samples_per_line);
print_pixelformat(f->fmt.vbi.sample_format);
print_pixelformat(f->fmt.vbi.sample_format, v4l2_pix_fmts);
tprintf(", start=[%u, %u], count=[%u, %u], ",
f->fmt.vbi.start[0], f->fmt.vbi.start[1],
f->fmt.vbi.count[0], f->fmt.vbi.count[1]);
@ -329,7 +344,7 @@ print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix,
case V4L2_BUF_TYPE_SDR_CAPTURE:
tprints(prefix);
tprints("fmt.sdr={pixelformat=");
print_pixelformat(f->fmt.sdr.pixelformat);
print_pixelformat(f->fmt.sdr.pixelformat, v4l2_sdr_fmts);
#ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE
tprintf(", buffersize=%u",
f->fmt.sdr.buffersize);
@ -873,7 +888,7 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg)
if (umove_or_printaddr(tcp, arg, &s))
return RVAL_IOCTL_DECODED;
tprintf("{index=%u, pixel_format=", s.index);
print_pixelformat(s.pixel_format);
print_pixelformat(s.pixel_format, v4l2_pix_fmts);
return 0;
}
@ -913,7 +928,7 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg)
if (umove_or_printaddr(tcp, arg, &f))
return RVAL_IOCTL_DECODED;
tprintf("{index=%u, pixel_format=", f.index);
print_pixelformat(f.pixel_format);
print_pixelformat(f.pixel_format, v4l2_pix_fmts);
tprintf(", width=%u, height=%u", f.width, f.height);
return 0;
}

153
xlat/v4l2_pix_fmts.in Normal file
View File

@ -0,0 +1,153 @@
V4L2_PIX_FMT_RGB332 v4l2_fourcc('R', 'G', 'B', '1') /* 8 RGB-3-3-2 */
V4L2_PIX_FMT_RGB444 v4l2_fourcc('R', '4', '4', '4') /* 16 xxxxrrrr ggggbbbb */
V4L2_PIX_FMT_ARGB444 v4l2_fourcc('A', 'R', '1', '2') /* 16 aaaarrrr ggggbbbb */
V4L2_PIX_FMT_XRGB444 v4l2_fourcc('X', 'R', '1', '2') /* 16 xxxxrrrr ggggbbbb */
V4L2_PIX_FMT_RGB555 v4l2_fourcc('R', 'G', 'B', 'O') /* 16 RGB-5-5-5 */
V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16 ARGB-1-5-5-5 */
V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16 XRGB-1-5-5-5 */
V4L2_PIX_FMT_RGB565 v4l2_fourcc('R', 'G', 'B', 'P') /* 16 RGB-5-6-5 */
V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16 RGB-5-5-5 BE */
V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16 ARGB-5-5-5 BE */
V4L2_PIX_FMT_XRGB555X v4l2_fourcc_be('X', 'R', '1', '5') /* 16 XRGB-5-5-5 BE */
V4L2_PIX_FMT_RGB565X v4l2_fourcc('R', 'G', 'B', 'R') /* 16 RGB-5-6-5 BE */
V4L2_PIX_FMT_BGR666 v4l2_fourcc('B', 'G', 'R', 'H') /* 18 BGR-6-6-6 */
V4L2_PIX_FMT_BGR24 v4l2_fourcc('B', 'G', 'R', '3') /* 24 BGR-8-8-8 */
V4L2_PIX_FMT_RGB24 v4l2_fourcc('R', 'G', 'B', '3') /* 24 RGB-8-8-8 */
V4L2_PIX_FMT_BGR32 v4l2_fourcc('B', 'G', 'R', '4') /* 32 BGR-8-8-8-8 */
V4L2_PIX_FMT_ABGR32 v4l2_fourcc('A', 'R', '2', '4') /* 32 BGRA-8-8-8-8 */
V4L2_PIX_FMT_XBGR32 v4l2_fourcc('X', 'R', '2', '4') /* 32 BGRX-8-8-8-8 */
V4L2_PIX_FMT_RGB32 v4l2_fourcc('R', 'G', 'B', '4') /* 32 RGB-8-8-8-8 */
V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */
V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
V4L2_PIX_FMT_Y16_BE v4l2_fourcc_be('Y', '1', '6', ' ') /* 16 Greyscale BE */
V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
V4L2_PIX_FMT_UV8 v4l2_fourcc('U', 'V', '8', ' ') /* 8 UV 4:4 */
V4L2_PIX_FMT_YUYV v4l2_fourcc('Y', 'U', 'Y', 'V') /* 16 YUV 4:2:2 */
V4L2_PIX_FMT_YYUV v4l2_fourcc('Y', 'Y', 'U', 'V') /* 16 YUV 4:2:2 */
V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */
V4L2_PIX_FMT_UYVY v4l2_fourcc('U', 'Y', 'V', 'Y') /* 16 YUV 4:2:2 */
V4L2_PIX_FMT_VYUY v4l2_fourcc('V', 'Y', 'U', 'Y') /* 16 YUV 4:2:2 */
V4L2_PIX_FMT_Y41P v4l2_fourcc('Y', '4', '1', 'P') /* 12 YUV 4:1:1 */
V4L2_PIX_FMT_YUV444 v4l2_fourcc('Y', '4', '4', '4') /* 16 xxxxyyyy uuuuvvvv */
V4L2_PIX_FMT_YUV555 v4l2_fourcc('Y', 'U', 'V', 'O') /* 16 YUV-5-5-5 */
V4L2_PIX_FMT_YUV565 v4l2_fourcc('Y', 'U', 'V', 'P') /* 16 YUV-5-6-5 */
V4L2_PIX_FMT_YUV32 v4l2_fourcc('Y', 'U', 'V', '4') /* 32 YUV-8-8-8-8 */
V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
V4L2_PIX_FMT_NV21 v4l2_fourcc('N', 'V', '2', '1') /* 12 Y/CrCb 4:2:0 */
V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
V4L2_PIX_FMT_NV24 v4l2_fourcc('N', 'V', '2', '4') /* 24 Y/CbCr 4:4:4 */
V4L2_PIX_FMT_NV42 v4l2_fourcc('N', 'V', '4', '2') /* 24 Y/CrCb 4:4:4 */
V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
V4L2_PIX_FMT_NV21M v4l2_fourcc('N', 'M', '2', '1') /* 21 Y/CrCb 4:2:0 */
V4L2_PIX_FMT_NV16M v4l2_fourcc('N', 'M', '1', '6') /* 16 Y/CbCr 4:2:2 */
V4L2_PIX_FMT_NV61M v4l2_fourcc('N', 'M', '6', '1') /* 16 Y/CrCb 4:2:2 */
V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
V4L2_PIX_FMT_NV12MT_16X16 v4l2_fourcc('V', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 16x16 macroblocks */
V4L2_PIX_FMT_YUV410 v4l2_fourcc('Y', 'U', 'V', '9') /* 9 YUV 4:1:0 */
V4L2_PIX_FMT_YVU410 v4l2_fourcc('Y', 'V', 'U', '9') /* 9 YVU 4:1:0 */
V4L2_PIX_FMT_YUV411P v4l2_fourcc('4', '1', '1', 'P') /* 12 YVU411 planar */
V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
V4L2_PIX_FMT_YVU420 v4l2_fourcc('Y', 'V', '1', '2') /* 12 YVU 4:2:0 */
V4L2_PIX_FMT_YUV422P v4l2_fourcc('4', '2', '2', 'P') /* 16 YVU422 planar */
V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
V4L2_PIX_FMT_YVU420M v4l2_fourcc('Y', 'M', '2', '1') /* 12 YVU420 planar */
V4L2_PIX_FMT_YUV422M v4l2_fourcc('Y', 'M', '1', '6') /* 16 YUV422 planar */
V4L2_PIX_FMT_YVU422M v4l2_fourcc('Y', 'M', '6', '1') /* 16 YVU422 planar */
V4L2_PIX_FMT_YUV444M v4l2_fourcc('Y', 'M', '2', '4') /* 24 YUV444 planar */
V4L2_PIX_FMT_YVU444M v4l2_fourcc('Y', 'M', '4', '2') /* 24 YVU444 planar */
V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */
V4L2_PIX_FMT_SRGGB8 v4l2_fourcc('R', 'G', 'G', 'B') /* 8 RGRG.. GBGB.. */
V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10 BGBG.. GRGR.. */
V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
V4L2_PIX_FMT_SBGGR10P v4l2_fourcc('p', 'B', 'A', 'A')
V4L2_PIX_FMT_SGBRG10P v4l2_fourcc('p', 'G', 'A', 'A')
V4L2_PIX_FMT_SGRBG10P v4l2_fourcc('p', 'g', 'A', 'A')
V4L2_PIX_FMT_SRGGB10P v4l2_fourcc('p', 'R', 'A', 'A')
V4L2_PIX_FMT_SBGGR10ALAW8 v4l2_fourcc('a', 'B', 'A', '8')
V4L2_PIX_FMT_SGBRG10ALAW8 v4l2_fourcc('a', 'G', 'A', '8')
V4L2_PIX_FMT_SGRBG10ALAW8 v4l2_fourcc('a', 'g', 'A', '8')
V4L2_PIX_FMT_SRGGB10ALAW8 v4l2_fourcc('a', 'R', 'A', '8')
V4L2_PIX_FMT_SBGGR10DPCM8 v4l2_fourcc('b', 'B', 'A', '8')
V4L2_PIX_FMT_SGBRG10DPCM8 v4l2_fourcc('b', 'G', 'A', '8')
V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
V4L2_PIX_FMT_SRGGB10DPCM8 v4l2_fourcc('b', 'R', 'A', '8')
V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
V4L2_PIX_FMT_SBGGR12P v4l2_fourcc('p', 'B', 'C', 'C')
V4L2_PIX_FMT_SGBRG12P v4l2_fourcc('p', 'G', 'C', 'C')
V4L2_PIX_FMT_SGRBG12P v4l2_fourcc('p', 'g', 'C', 'C')
V4L2_PIX_FMT_SRGGB12P v4l2_fourcc('p', 'R', 'C', 'C')
V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */
V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16 GBGB.. RGRG.. */
V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16 GRGR.. BGBG.. */
V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16 RGRG.. GBGB.. */
V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')
V4L2_PIX_FMT_HSV32 v4l2_fourcc('H', 'S', 'V', '4')
V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
V4L2_PIX_FMT_H264_MVC v4l2_fourcc('M', '2', '6', '4') /* H264 MVC */
V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 part 2 ES */
V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
V4L2_PIX_FMT_VP8 v4l2_fourcc('V', 'P', '8', '0') /* VP8 */
V4L2_PIX_FMT_VP9 v4l2_fourcc('V', 'P', '9', '0') /* VP9 */
V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */
V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */
V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */
V4L2_PIX_FMT_PWC1 v4l2_fourcc('P', 'W', 'C', '1') /* pwc older webcam */
V4L2_PIX_FMT_PWC2 v4l2_fourcc('P', 'W', 'C', '2') /* pwc newer webcam */
V4L2_PIX_FMT_ET61X251 v4l2_fourcc('E', '6', '2', '5') /* ET61X251 compression */
V4L2_PIX_FMT_SPCA501 v4l2_fourcc('S', '5', '0', '1') /* YUYV per line */
V4L2_PIX_FMT_SPCA505 v4l2_fourcc('S', '5', '0', '5') /* YYUV per line */
V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */
V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */
V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */
V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */
V4L2_PIX_FMT_JL2005BCD v4l2_fourcc('J', 'L', '2', '0') /* compressed RGGB bayer */
V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */
V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */
V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */
V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
V4L2_PIX_FMT_S5C_UYVY_JPG v4l2_fourcc('S', '5', 'C', 'I') /* S5C73M3 interleaved UYVY/JPEG */
V4L2_PIX_FMT_Y8I v4l2_fourcc('Y', '8', 'I', ' ') /* Greyscale 8-bit L/R interleaved */
V4L2_PIX_FMT_Y12I v4l2_fourcc('Y', '1', '2', 'I') /* Greyscale 12-bit L/R interleaved */
V4L2_PIX_FMT_Z16 v4l2_fourcc('Z', '1', '6', ' ') /* Depth data 16-bit */
V4L2_PIX_FMT_MT21C v4l2_fourcc('M', 'T', '2', '1') /* Mediatek compressed block mode */
V4L2_PIX_FMT_INZI v4l2_fourcc('I', 'N', 'Z', 'I') /* Intel Planar Greyscale 10-bit and Depth 16-bit */
V4L2_PIX_FMT_IPU3_SBGGR10 v4l2_fourcc('i', 'p', '3', 'b') /* IPU3 packed 10-bit BGGR bayer */
V4L2_PIX_FMT_IPU3_SGBRG10 v4l2_fourcc('i', 'p', '3', 'g') /* IPU3 packed 10-bit GBRG bayer */
V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */

8
xlat/v4l2_sdr_fmts.in Normal file
View File

@ -0,0 +1,8 @@
V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
V4L2_SDR_FMT_CS8 v4l2_fourcc('C', 'S', '0', '8') /* complex s8 */
V4L2_SDR_FMT_CS14LE v4l2_fourcc('C', 'S', '1', '4') /* complex s14le */
V4L2_SDR_FMT_RU12LE v4l2_fourcc('R', 'U', '1', '2') /* real u12le */
V4L2_SDR_FMT_PCU16BE v4l2_fourcc('P', 'C', '1', '6') /* planar complex u16be */
V4L2_SDR_FMT_PCU18BE v4l2_fourcc('P', 'C', '1', '8') /* planar complex u18be */
V4L2_SDR_FMT_PCU20BE v4l2_fourcc('P', 'C', '2', '0') /* planar complex u20be */