aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/videodev2.h
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /include/linux/videodev2.h
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'include/linux/videodev2.h')
-rw-r--r--include/linux/videodev2.h163
1 files changed, 149 insertions, 14 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 61490c6dcdbd..8a4c309d2344 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -70,6 +70,7 @@
70 * Moved from videodev.h 70 * Moved from videodev.h
71 */ 71 */
72#define VIDEO_MAX_FRAME 32 72#define VIDEO_MAX_FRAME 32
73#define VIDEO_MAX_PLANES 8
73 74
74#ifndef __KERNEL__ 75#ifndef __KERNEL__
75 76
@@ -157,9 +158,23 @@ enum v4l2_buf_type {
157 /* Experimental */ 158 /* Experimental */
158 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, 159 V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
159#endif 160#endif
161 V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9,
162 V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10,
160 V4L2_BUF_TYPE_PRIVATE = 0x80, 163 V4L2_BUF_TYPE_PRIVATE = 0x80,
161}; 164};
162 165
166#define V4L2_TYPE_IS_MULTIPLANAR(type) \
167 ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \
168 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
169
170#define V4L2_TYPE_IS_OUTPUT(type) \
171 ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \
172 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \
173 || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \
174 || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \
175 || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \
176 || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
177
163enum v4l2_tuner_type { 178enum v4l2_tuner_type {
164 V4L2_TUNER_RADIO = 1, 179 V4L2_TUNER_RADIO = 1,
165 V4L2_TUNER_ANALOG_TV = 2, 180 V4L2_TUNER_ANALOG_TV = 2,
@@ -245,6 +260,11 @@ struct v4l2_capability {
245#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ 260#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
246#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ 261#define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */
247 262
263/* Is a video capture device that supports multiplanar formats */
264#define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000
265/* Is a video output device that supports multiplanar formats */
266#define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000
267
248#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ 268#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
249#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ 269#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
250#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ 270#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
@@ -288,8 +308,12 @@ struct v4l2_pix_format {
288#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */ 308#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
289#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */ 309#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
290#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ 310#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
311#define V4L2_PIX_FMT_Y12 v4l2_fourcc('Y', '1', '2', ' ') /* 12 Greyscale */
291#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 312#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
292 313
314/* Grey bit-packed formats */
315#define V4L2_PIX_FMT_Y10BPACK v4l2_fourcc('Y', '1', '0', 'B') /* 10 Greyscale bit-packed */
316
293/* Palette formats */ 317/* Palette formats */
294#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */ 318#define V4L2_PIX_FMT_PAL8 v4l2_fourcc('P', 'A', 'L', '8') /* 8 8-bit palette */
295 319
@@ -312,6 +336,7 @@ struct v4l2_pix_format {
312#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */ 336#define V4L2_PIX_FMT_YUV420 v4l2_fourcc('Y', 'U', '1', '2') /* 12 YUV 4:2:0 */
313#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */ 337#define V4L2_PIX_FMT_HI240 v4l2_fourcc('H', 'I', '2', '4') /* 8 8-bit color */
314#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */ 338#define V4L2_PIX_FMT_HM12 v4l2_fourcc('H', 'M', '1', '2') /* 8 YUV 4:2:0 16x16 macroblocks */
339#define V4L2_PIX_FMT_M420 v4l2_fourcc('M', '4', '2', '0') /* 12 YUV 4:2:0 2 lines y, 1 line uv interleaved */
315 340
316/* two planes -- one Y, one Cr + Cb interleaved */ 341/* two planes -- one Y, one Cr + Cb interleaved */
317#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */ 342#define V4L2_PIX_FMT_NV12 v4l2_fourcc('N', 'V', '1', '2') /* 12 Y/CbCr 4:2:0 */
@@ -319,6 +344,13 @@ struct v4l2_pix_format {
319#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ 344#define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */
320#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ 345#define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */
321 346
347/* two non contiguous planes - one Y, one Cr + Cb interleaved */
348#define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */
349#define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */
350
351/* three non contiguous planes - Y, Cb, Cr */
352#define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */
353
322/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ 354/* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */
323#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ 355#define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */
324#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ 356#define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */
@@ -328,6 +360,10 @@ struct v4l2_pix_format {
328#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ 360#define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */
329#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */ 361#define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10 GRGR.. BGBG.. */
330#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ 362#define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */
363#define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */
364#define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */
365#define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */
366#define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */
331 /* 10bit raw bayer DPCM compressed to 8 bits */ 367 /* 10bit raw bayer DPCM compressed to 8 bits */
332#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') 368#define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0')
333 /* 369 /*
@@ -363,6 +399,9 @@ struct v4l2_pix_format {
363#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 399#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
364#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ 400#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
365#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ 401#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
402#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
403#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
404#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
366 405
367/* 406/*
368 * F O R M A T E N U M E R A T I O N 407 * F O R M A T E N U M E R A T I O N
@@ -515,6 +554,62 @@ struct v4l2_requestbuffers {
515 __u32 reserved[2]; 554 __u32 reserved[2];
516}; 555};
517 556
557/**
558 * struct v4l2_plane - plane info for multi-planar buffers
559 * @bytesused: number of bytes occupied by data in the plane (payload)
560 * @length: size of this plane (NOT the payload) in bytes
561 * @mem_offset: when memory in the associated struct v4l2_buffer is
562 * V4L2_MEMORY_MMAP, equals the offset from the start of
563 * the device memory for this plane (or is a "cookie" that
564 * should be passed to mmap() called on the video node)
565 * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer
566 * pointing to this plane
567 * @data_offset: offset in the plane to the start of data; usually 0,
568 * unless there is a header in front of the data
569 *
570 * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer
571 * with two planes can have one plane for Y, and another for interleaved CbCr
572 * components. Each plane can reside in a separate memory buffer, or even in
573 * a completely separate memory node (e.g. in embedded devices).
574 */
575struct v4l2_plane {
576 __u32 bytesused;
577 __u32 length;
578 union {
579 __u32 mem_offset;
580 unsigned long userptr;
581 } m;
582 __u32 data_offset;
583 __u32 reserved[11];
584};
585
586/**
587 * struct v4l2_buffer - video buffer info
588 * @index: id number of the buffer
589 * @type: buffer type (type == *_MPLANE for multiplanar buffers)
590 * @bytesused: number of bytes occupied by data in the buffer (payload);
591 * unused (set to 0) for multiplanar buffers
592 * @flags: buffer informational flags
593 * @field: field order of the image in the buffer
594 * @timestamp: frame timestamp
595 * @timecode: frame timecode
596 * @sequence: sequence count of this frame
597 * @memory: the method, in which the actual video data is passed
598 * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP;
599 * offset from the start of the device memory for this plane,
600 * (or a "cookie" that should be passed to mmap() as offset)
601 * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR;
602 * a userspace pointer pointing to this buffer
603 * @planes: for multiplanar buffers; userspace pointer to the array of plane
604 * info structs for this buffer
605 * @length: size in bytes of the buffer (NOT its payload) for single-plane
606 * buffers (when type != *_MPLANE); number of elements in the
607 * planes array for multi-plane buffers
608 * @input: input number from which the video data has has been captured
609 *
610 * Contains data exchanged by application and driver using one of the Streaming
611 * I/O methods.
612 */
518struct v4l2_buffer { 613struct v4l2_buffer {
519 __u32 index; 614 __u32 index;
520 enum v4l2_buf_type type; 615 enum v4l2_buf_type type;
@@ -530,6 +625,7 @@ struct v4l2_buffer {
530 union { 625 union {
531 __u32 offset; 626 __u32 offset;
532 unsigned long userptr; 627 unsigned long userptr;
628 struct v4l2_plane *planes;
533 } m; 629 } m;
534 __u32 length; 630 __u32 length;
535 __u32 input; 631 __u32 input;
@@ -1045,8 +1141,11 @@ enum v4l2_colorfx {
1045 1141
1046#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36) 1142#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1047 1143
1144#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1145#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1146
1048/* last CID + 1 */ 1147/* last CID + 1 */
1049#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37) 1148#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39)
1050 1149
1051/* MPEG-class control IDs defined by V4L2 */ 1150/* MPEG-class control IDs defined by V4L2 */
1052#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1151#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1363,6 +1462,8 @@ struct v4l2_modulator {
1363#define V4L2_TUNER_CAP_SAP 0x0020 1462#define V4L2_TUNER_CAP_SAP 0x0020
1364#define V4L2_TUNER_CAP_LANG1 0x0040 1463#define V4L2_TUNER_CAP_LANG1 0x0040
1365#define V4L2_TUNER_CAP_RDS 0x0080 1464#define V4L2_TUNER_CAP_RDS 0x0080
1465#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
1466#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
1366 1467
1367/* Flags for the 'rxsubchans' field */ 1468/* Flags for the 'rxsubchans' field */
1368#define V4L2_TUNER_SUB_MONO 0x0001 1469#define V4L2_TUNER_SUB_MONO 0x0001
@@ -1392,7 +1493,8 @@ struct v4l2_hw_freq_seek {
1392 enum v4l2_tuner_type type; 1493 enum v4l2_tuner_type type;
1393 __u32 seek_upward; 1494 __u32 seek_upward;
1394 __u32 wrap_around; 1495 __u32 wrap_around;
1395 __u32 reserved[8]; 1496 __u32 spacing;
1497 __u32 reserved[7];
1396}; 1498};
1397 1499
1398/* 1500/*
@@ -1614,12 +1716,56 @@ struct v4l2_mpeg_vbi_fmt_ivtv {
1614 * A G G R E G A T E S T R U C T U R E S 1716 * A G G R E G A T E S T R U C T U R E S
1615 */ 1717 */
1616 1718
1617/* Stream data format 1719/**
1720 * struct v4l2_plane_pix_format - additional, per-plane format definition
1721 * @sizeimage: maximum size in bytes required for data, for which
1722 * this plane will be used
1723 * @bytesperline: distance in bytes between the leftmost pixels in two
1724 * adjacent lines
1725 */
1726struct v4l2_plane_pix_format {
1727 __u32 sizeimage;
1728 __u16 bytesperline;
1729 __u16 reserved[7];
1730} __attribute__ ((packed));
1731
1732/**
1733 * struct v4l2_pix_format_mplane - multiplanar format definition
1734 * @width: image width in pixels
1735 * @height: image height in pixels
1736 * @pixelformat: little endian four character code (fourcc)
1737 * @field: field order (for interlaced video)
1738 * @colorspace: supplemental to pixelformat
1739 * @plane_fmt: per-plane information
1740 * @num_planes: number of planes for this format
1741 */
1742struct v4l2_pix_format_mplane {
1743 __u32 width;
1744 __u32 height;
1745 __u32 pixelformat;
1746 enum v4l2_field field;
1747 enum v4l2_colorspace colorspace;
1748
1749 struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES];
1750 __u8 num_planes;
1751 __u8 reserved[11];
1752} __attribute__ ((packed));
1753
1754/**
1755 * struct v4l2_format - stream data format
1756 * @type: type of the data stream
1757 * @pix: definition of an image format
1758 * @pix_mp: definition of a multiplanar image format
1759 * @win: definition of an overlaid image
1760 * @vbi: raw VBI capture or output parameters
1761 * @sliced: sliced VBI capture or output parameters
1762 * @raw_data: placeholder for future extensions and custom formats
1618 */ 1763 */
1619struct v4l2_format { 1764struct v4l2_format {
1620 enum v4l2_buf_type type; 1765 enum v4l2_buf_type type;
1621 union { 1766 union {
1622 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ 1767 struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
1768 struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */
1623 struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ 1769 struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
1624 struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ 1770 struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
1625 struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ 1771 struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
@@ -1627,7 +1773,6 @@ struct v4l2_format {
1627 } fmt; 1773 } fmt;
1628}; 1774};
1629 1775
1630
1631/* Stream type-dependent parameters 1776/* Stream type-dependent parameters
1632 */ 1777 */
1633struct v4l2_streamparm { 1778struct v4l2_streamparm {
@@ -1800,16 +1945,6 @@ struct v4l2_dbg_chip_ident {
1800/* Reminder: when adding new ioctls please add support for them to 1945/* Reminder: when adding new ioctls please add support for them to
1801 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1946 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1802 1947
1803#ifdef __OLD_VIDIOC_
1804/* for compatibility, will go away some day */
1805#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
1806#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
1807#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
1808#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
1809#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
1810#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
1811#endif
1812
1813#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ 1948#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1814 1949
1815#endif /* __LINUX_VIDEODEV2_H */ 1950#endif /* __LINUX_VIDEODEV2_H */