diff options
| author | Jiri Kosina <jkosina@suse.cz> | 2011-05-18 11:06:31 -0400 |
|---|---|---|
| committer | Jiri Kosina <jkosina@suse.cz> | 2011-05-18 11:06:49 -0400 |
| commit | 6b7b8e488bbdedeccabdd001a78ffcbe43bb8a3a (patch) | |
| tree | f2f77cc31b4548745778fca6a51b09e1d8a49804 /include/linux/videodev2.h | |
| parent | b50f315cbb865079a16a12fd9ae6083f98fd592c (diff) | |
| parent | c1d10d18c542278b7fbc413c289d3cb6219da6b3 (diff) | |
Merge branch 'master' into upstream.
This is sync with Linus' tree to receive KEY_IMAGES definition
that went in through input tree.
Diffstat (limited to 'include/linux/videodev2.h')
| -rw-r--r-- | include/linux/videodev2.h | 147 |
1 files changed, 135 insertions, 12 deletions
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5f6f47044abf..be82c8ead1af 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 | |||
| 163 | enum v4l2_tuner_type { | 178 | enum 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,6 +308,7 @@ 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 | ||
| 293 | /* Palette formats */ | 314 | /* Palette formats */ |
| @@ -319,6 +340,13 @@ struct v4l2_pix_format { | |||
| 319 | #define V4L2_PIX_FMT_NV16 v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | 340 | #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 */ | 341 | #define V4L2_PIX_FMT_NV61 v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ |
| 321 | 342 | ||
| 343 | /* two non contiguous planes - one Y, one Cr + Cb interleaved */ | ||
| 344 | #define V4L2_PIX_FMT_NV12M v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ | ||
| 345 | #define V4L2_PIX_FMT_NV12MT v4l2_fourcc('T', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 64x32 macroblocks */ | ||
| 346 | |||
| 347 | /* three non contiguous planes - Y, Cb, Cr */ | ||
| 348 | #define V4L2_PIX_FMT_YUV420M v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ | ||
| 349 | |||
| 322 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 350 | /* 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.. */ | 351 | #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.. */ | 352 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
| @@ -328,6 +356,10 @@ struct v4l2_pix_format { | |||
| 328 | #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10 GBGB.. RGRG.. */ | 356 | #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.. */ | 357 | #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.. */ | 358 | #define V4L2_PIX_FMT_SRGGB10 v4l2_fourcc('R', 'G', '1', '0') /* 10 RGRG.. GBGB.. */ |
| 359 | #define V4L2_PIX_FMT_SBGGR12 v4l2_fourcc('B', 'G', '1', '2') /* 12 BGBG.. GRGR.. */ | ||
| 360 | #define V4L2_PIX_FMT_SGBRG12 v4l2_fourcc('G', 'B', '1', '2') /* 12 GBGB.. RGRG.. */ | ||
| 361 | #define V4L2_PIX_FMT_SGRBG12 v4l2_fourcc('B', 'A', '1', '2') /* 12 GRGR.. BGBG.. */ | ||
| 362 | #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ | ||
| 331 | /* 10bit raw bayer DPCM compressed to 8 bits */ | 363 | /* 10bit raw bayer DPCM compressed to 8 bits */ |
| 332 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') | 364 | #define V4L2_PIX_FMT_SGRBG10DPCM8 v4l2_fourcc('B', 'D', '1', '0') |
| 333 | /* | 365 | /* |
| @@ -365,6 +397,7 @@ struct v4l2_pix_format { | |||
| 365 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ | 397 | #define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */ |
| 366 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ | 398 | #define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ |
| 367 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ | 399 | #define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ |
| 400 | #define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ | ||
| 368 | 401 | ||
| 369 | /* | 402 | /* |
| 370 | * F O R M A T E N U M E R A T I O N | 403 | * F O R M A T E N U M E R A T I O N |
| @@ -517,6 +550,62 @@ struct v4l2_requestbuffers { | |||
| 517 | __u32 reserved[2]; | 550 | __u32 reserved[2]; |
| 518 | }; | 551 | }; |
| 519 | 552 | ||
| 553 | /** | ||
| 554 | * struct v4l2_plane - plane info for multi-planar buffers | ||
| 555 | * @bytesused: number of bytes occupied by data in the plane (payload) | ||
| 556 | * @length: size of this plane (NOT the payload) in bytes | ||
| 557 | * @mem_offset: when memory in the associated struct v4l2_buffer is | ||
| 558 | * V4L2_MEMORY_MMAP, equals the offset from the start of | ||
| 559 | * the device memory for this plane (or is a "cookie" that | ||
| 560 | * should be passed to mmap() called on the video node) | ||
| 561 | * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer | ||
| 562 | * pointing to this plane | ||
| 563 | * @data_offset: offset in the plane to the start of data; usually 0, | ||
| 564 | * unless there is a header in front of the data | ||
| 565 | * | ||
| 566 | * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer | ||
| 567 | * with two planes can have one plane for Y, and another for interleaved CbCr | ||
| 568 | * components. Each plane can reside in a separate memory buffer, or even in | ||
| 569 | * a completely separate memory node (e.g. in embedded devices). | ||
| 570 | */ | ||
| 571 | struct v4l2_plane { | ||
| 572 | __u32 bytesused; | ||
| 573 | __u32 length; | ||
| 574 | union { | ||
| 575 | __u32 mem_offset; | ||
| 576 | unsigned long userptr; | ||
| 577 | } m; | ||
| 578 | __u32 data_offset; | ||
| 579 | __u32 reserved[11]; | ||
| 580 | }; | ||
| 581 | |||
| 582 | /** | ||
| 583 | * struct v4l2_buffer - video buffer info | ||
| 584 | * @index: id number of the buffer | ||
| 585 | * @type: buffer type (type == *_MPLANE for multiplanar buffers) | ||
| 586 | * @bytesused: number of bytes occupied by data in the buffer (payload); | ||
| 587 | * unused (set to 0) for multiplanar buffers | ||
| 588 | * @flags: buffer informational flags | ||
| 589 | * @field: field order of the image in the buffer | ||
| 590 | * @timestamp: frame timestamp | ||
| 591 | * @timecode: frame timecode | ||
| 592 | * @sequence: sequence count of this frame | ||
| 593 | * @memory: the method, in which the actual video data is passed | ||
| 594 | * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP; | ||
| 595 | * offset from the start of the device memory for this plane, | ||
| 596 | * (or a "cookie" that should be passed to mmap() as offset) | ||
| 597 | * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; | ||
| 598 | * a userspace pointer pointing to this buffer | ||
| 599 | * @planes: for multiplanar buffers; userspace pointer to the array of plane | ||
| 600 | * info structs for this buffer | ||
| 601 | * @length: size in bytes of the buffer (NOT its payload) for single-plane | ||
| 602 | * buffers (when type != *_MPLANE); number of elements in the | ||
| 603 | * planes array for multi-plane buffers | ||
| 604 | * @input: input number from which the video data has has been captured | ||
| 605 | * | ||
| 606 | * Contains data exchanged by application and driver using one of the Streaming | ||
| 607 | * I/O methods. | ||
| 608 | */ | ||
| 520 | struct v4l2_buffer { | 609 | struct v4l2_buffer { |
| 521 | __u32 index; | 610 | __u32 index; |
| 522 | enum v4l2_buf_type type; | 611 | enum v4l2_buf_type type; |
| @@ -532,6 +621,7 @@ struct v4l2_buffer { | |||
| 532 | union { | 621 | union { |
| 533 | __u32 offset; | 622 | __u32 offset; |
| 534 | unsigned long userptr; | 623 | unsigned long userptr; |
| 624 | struct v4l2_plane *planes; | ||
| 535 | } m; | 625 | } m; |
| 536 | __u32 length; | 626 | __u32 length; |
| 537 | __u32 input; | 627 | __u32 input; |
| @@ -1622,12 +1712,56 @@ struct v4l2_mpeg_vbi_fmt_ivtv { | |||
| 1622 | * A G G R E G A T E S T R U C T U R E S | 1712 | * A G G R E G A T E S T R U C T U R E S |
| 1623 | */ | 1713 | */ |
| 1624 | 1714 | ||
| 1625 | /* Stream data format | 1715 | /** |
| 1716 | * struct v4l2_plane_pix_format - additional, per-plane format definition | ||
| 1717 | * @sizeimage: maximum size in bytes required for data, for which | ||
| 1718 | * this plane will be used | ||
| 1719 | * @bytesperline: distance in bytes between the leftmost pixels in two | ||
| 1720 | * adjacent lines | ||
| 1721 | */ | ||
| 1722 | struct v4l2_plane_pix_format { | ||
| 1723 | __u32 sizeimage; | ||
| 1724 | __u16 bytesperline; | ||
| 1725 | __u16 reserved[7]; | ||
| 1726 | } __attribute__ ((packed)); | ||
| 1727 | |||
| 1728 | /** | ||
| 1729 | * struct v4l2_pix_format_mplane - multiplanar format definition | ||
| 1730 | * @width: image width in pixels | ||
| 1731 | * @height: image height in pixels | ||
| 1732 | * @pixelformat: little endian four character code (fourcc) | ||
| 1733 | * @field: field order (for interlaced video) | ||
| 1734 | * @colorspace: supplemental to pixelformat | ||
| 1735 | * @plane_fmt: per-plane information | ||
| 1736 | * @num_planes: number of planes for this format | ||
| 1737 | */ | ||
| 1738 | struct v4l2_pix_format_mplane { | ||
| 1739 | __u32 width; | ||
| 1740 | __u32 height; | ||
| 1741 | __u32 pixelformat; | ||
| 1742 | enum v4l2_field field; | ||
| 1743 | enum v4l2_colorspace colorspace; | ||
| 1744 | |||
| 1745 | struct v4l2_plane_pix_format plane_fmt[VIDEO_MAX_PLANES]; | ||
| 1746 | __u8 num_planes; | ||
| 1747 | __u8 reserved[11]; | ||
| 1748 | } __attribute__ ((packed)); | ||
| 1749 | |||
| 1750 | /** | ||
| 1751 | * struct v4l2_format - stream data format | ||
| 1752 | * @type: type of the data stream | ||
| 1753 | * @pix: definition of an image format | ||
| 1754 | * @pix_mp: definition of a multiplanar image format | ||
| 1755 | * @win: definition of an overlaid image | ||
| 1756 | * @vbi: raw VBI capture or output parameters | ||
| 1757 | * @sliced: sliced VBI capture or output parameters | ||
| 1758 | * @raw_data: placeholder for future extensions and custom formats | ||
| 1626 | */ | 1759 | */ |
| 1627 | struct v4l2_format { | 1760 | struct v4l2_format { |
| 1628 | enum v4l2_buf_type type; | 1761 | enum v4l2_buf_type type; |
| 1629 | union { | 1762 | union { |
| 1630 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ | 1763 | struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ |
| 1764 | struct v4l2_pix_format_mplane pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */ | ||
| 1631 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ | 1765 | struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
| 1632 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ | 1766 | struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
| 1633 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ | 1767 | struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
| @@ -1635,7 +1769,6 @@ struct v4l2_format { | |||
| 1635 | } fmt; | 1769 | } fmt; |
| 1636 | }; | 1770 | }; |
| 1637 | 1771 | ||
| 1638 | |||
| 1639 | /* Stream type-dependent parameters | 1772 | /* Stream type-dependent parameters |
| 1640 | */ | 1773 | */ |
| 1641 | struct v4l2_streamparm { | 1774 | struct v4l2_streamparm { |
| @@ -1808,16 +1941,6 @@ struct v4l2_dbg_chip_ident { | |||
| 1808 | /* Reminder: when adding new ioctls please add support for them to | 1941 | /* Reminder: when adding new ioctls please add support for them to |
| 1809 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1942 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
| 1810 | 1943 | ||
| 1811 | #ifdef __OLD_VIDIOC_ | ||
| 1812 | /* for compatibility, will go away some day */ | ||
| 1813 | #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) | ||
| 1814 | #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm) | ||
| 1815 | #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control) | ||
| 1816 | #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio) | ||
| 1817 | #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout) | ||
| 1818 | #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap) | ||
| 1819 | #endif | ||
| 1820 | |||
| 1821 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | 1944 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
| 1822 | 1945 | ||
| 1823 | #endif /* __LINUX_VIDEODEV2_H */ | 1946 | #endif /* __LINUX_VIDEODEV2_H */ |
