diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-01 07:48:27 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-21 19:32:38 -0400 |
commit | f6a373fb0569c98d6a44108f5e879f06abd46df3 (patch) | |
tree | ba5bf4f09f0cbb9100ea44f6eae1074ecc9291b3 /Documentation | |
parent | d4c9adb742abd1e8025b6f2e3bb24e3efab86da9 (diff) |
[media] videodev2.h.xml: Update to reflect videodev2.h changes
A few changes happened at videodev2.h:
- Addition of multiplane API;
- removal of VIDIOC_*_OLD ioctls;
- a few more video standards.
Update the file to reflect the latest changes.
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/DocBook/v4l/videodev2.h.xml | 141 |
1 files changed, 129 insertions, 12 deletions
diff --git a/Documentation/DocBook/v4l/videodev2.h.xml b/Documentation/DocBook/v4l/videodev2.h.xml index 325b23b6964c..2b796a2ee98a 100644 --- a/Documentation/DocBook/v4l/videodev2.h.xml +++ b/Documentation/DocBook/v4l/videodev2.h.xml | |||
@@ -71,6 +71,7 @@ | |||
71 | * Moved from videodev.h | 71 | * Moved from videodev.h |
72 | */ | 72 | */ |
73 | #define VIDEO_MAX_FRAME 32 | 73 | #define VIDEO_MAX_FRAME 32 |
74 | #define VIDEO_MAX_PLANES 8 | ||
74 | 75 | ||
75 | #ifndef __KERNEL__ | 76 | #ifndef __KERNEL__ |
76 | 77 | ||
@@ -158,9 +159,23 @@ enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> { | |||
158 | /* Experimental */ | 159 | /* Experimental */ |
159 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, | 160 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, |
160 | #endif | 161 | #endif |
162 | V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE = 9, | ||
163 | V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE = 10, | ||
161 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 164 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
162 | }; | 165 | }; |
163 | 166 | ||
167 | #define V4L2_TYPE_IS_MULTIPLANAR(type) \ | ||
168 | ((type) == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE \ | ||
169 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE) | ||
170 | |||
171 | #define V4L2_TYPE_IS_OUTPUT(type) \ | ||
172 | ((type) == V4L2_BUF_TYPE_VIDEO_OUTPUT \ | ||
173 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE \ | ||
174 | || (type) == V4L2_BUF_TYPE_VIDEO_OVERLAY \ | ||
175 | || (type) == V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY \ | ||
176 | || (type) == V4L2_BUF_TYPE_VBI_OUTPUT \ | ||
177 | || (type) == V4L2_BUF_TYPE_SLICED_VBI_OUTPUT) | ||
178 | |||
164 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { | 179 | enum <link linkend="v4l2-tuner-type">v4l2_tuner_type</link> { |
165 | V4L2_TUNER_RADIO = 1, | 180 | V4L2_TUNER_RADIO = 1, |
166 | V4L2_TUNER_ANALOG_TV = 2, | 181 | V4L2_TUNER_ANALOG_TV = 2, |
@@ -246,6 +261,11 @@ struct <link linkend="v4l2-capability">v4l2_capability</link> { | |||
246 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ | 261 | #define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */ |
247 | #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ | 262 | #define V4L2_CAP_RDS_OUTPUT 0x00000800 /* Is an RDS encoder */ |
248 | 263 | ||
264 | /* Is a video capture device that supports multiplanar formats */ | ||
265 | #define V4L2_CAP_VIDEO_CAPTURE_MPLANE 0x00001000 | ||
266 | /* Is a video output device that supports multiplanar formats */ | ||
267 | #define V4L2_CAP_VIDEO_OUTPUT_MPLANE 0x00002000 | ||
268 | |||
249 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 269 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
250 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 270 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
251 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ | 271 | #define V4L2_CAP_RADIO 0x00040000 /* is a radio device */ |
@@ -320,6 +340,13 @@ struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> { | |||
320 | #define <link linkend="V4L2-PIX-FMT-NV16">V4L2_PIX_FMT_NV16</link> v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ | 340 | #define <link linkend="V4L2-PIX-FMT-NV16">V4L2_PIX_FMT_NV16</link> v4l2_fourcc('N', 'V', '1', '6') /* 16 Y/CbCr 4:2:2 */ |
321 | #define <link linkend="V4L2-PIX-FMT-NV61">V4L2_PIX_FMT_NV61</link> v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ | 341 | #define <link linkend="V4L2-PIX-FMT-NV61">V4L2_PIX_FMT_NV61</link> v4l2_fourcc('N', 'V', '6', '1') /* 16 Y/CrCb 4:2:2 */ |
322 | 342 | ||
343 | /* two non contiguous planes - one Y, one Cr + Cb interleaved */ | ||
344 | #define <link linkend="V4L2-PIX-FMT-NV12M">V4L2_PIX_FMT_NV12M</link> v4l2_fourcc('N', 'M', '1', '2') /* 12 Y/CbCr 4:2:0 */ | ||
345 | #define <link linkend="V4L2-PIX-FMT-NV12MT">V4L2_PIX_FMT_NV12MT</link> 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 <link linkend="V4L2-PIX-FMT-YUV420M">V4L2_PIX_FMT_YUV420M</link> v4l2_fourcc('Y', 'M', '1', '2') /* 12 YUV420 planar */ | ||
349 | |||
323 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 350 | /* Bayer formats - see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
324 | #define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 351 | #define <link linkend="V4L2-PIX-FMT-SBGGR8">V4L2_PIX_FMT_SBGGR8</link> v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
325 | #define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 352 | #define <link linkend="V4L2-PIX-FMT-SGBRG8">V4L2_PIX_FMT_SGBRG8</link> v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
@@ -518,6 +545,62 @@ struct <link linkend="v4l2-requestbuffers">v4l2_requestbuffers</link> { | |||
518 | __u32 reserved[2]; | 545 | __u32 reserved[2]; |
519 | }; | 546 | }; |
520 | 547 | ||
548 | /** | ||
549 | * struct <link linkend="v4l2-plane">v4l2_plane</link> - plane info for multi-planar buffers | ||
550 | * @bytesused: number of bytes occupied by data in the plane (payload) | ||
551 | * @length: size of this plane (NOT the payload) in bytes | ||
552 | * @mem_offset: when memory in the associated struct <link linkend="v4l2-buffer">v4l2_buffer</link> is | ||
553 | * V4L2_MEMORY_MMAP, equals the offset from the start of | ||
554 | * the device memory for this plane (or is a "cookie" that | ||
555 | * should be passed to mmap() called on the video node) | ||
556 | * @userptr: when memory is V4L2_MEMORY_USERPTR, a userspace pointer | ||
557 | * pointing to this plane | ||
558 | * @data_offset: offset in the plane to the start of data; usually 0, | ||
559 | * unless there is a header in front of the data | ||
560 | * | ||
561 | * Multi-planar buffers consist of one or more planes, e.g. an YCbCr buffer | ||
562 | * with two planes can have one plane for Y, and another for interleaved CbCr | ||
563 | * components. Each plane can reside in a separate memory buffer, or even in | ||
564 | * a completely separate memory node (e.g. in embedded devices). | ||
565 | */ | ||
566 | struct <link linkend="v4l2-plane">v4l2_plane</link> { | ||
567 | __u32 bytesused; | ||
568 | __u32 length; | ||
569 | union { | ||
570 | __u32 mem_offset; | ||
571 | unsigned long userptr; | ||
572 | } m; | ||
573 | __u32 data_offset; | ||
574 | __u32 reserved[11]; | ||
575 | }; | ||
576 | |||
577 | /** | ||
578 | * struct <link linkend="v4l2-buffer">v4l2_buffer</link> - video buffer info | ||
579 | * @index: id number of the buffer | ||
580 | * @type: buffer type (type == *_MPLANE for multiplanar buffers) | ||
581 | * @bytesused: number of bytes occupied by data in the buffer (payload); | ||
582 | * unused (set to 0) for multiplanar buffers | ||
583 | * @flags: buffer informational flags | ||
584 | * @field: field order of the image in the buffer | ||
585 | * @timestamp: frame timestamp | ||
586 | * @timecode: frame timecode | ||
587 | * @sequence: sequence count of this frame | ||
588 | * @memory: the method, in which the actual video data is passed | ||
589 | * @offset: for non-multiplanar buffers with memory == V4L2_MEMORY_MMAP; | ||
590 | * offset from the start of the device memory for this plane, | ||
591 | * (or a "cookie" that should be passed to mmap() as offset) | ||
592 | * @userptr: for non-multiplanar buffers with memory == V4L2_MEMORY_USERPTR; | ||
593 | * a userspace pointer pointing to this buffer | ||
594 | * @planes: for multiplanar buffers; userspace pointer to the array of plane | ||
595 | * info structs for this buffer | ||
596 | * @length: size in bytes of the buffer (NOT its payload) for single-plane | ||
597 | * buffers (when type != *_MPLANE); number of elements in the | ||
598 | * planes array for multi-plane buffers | ||
599 | * @input: input number from which the video data has has been captured | ||
600 | * | ||
601 | * Contains data exchanged by application and driver using one of the Streaming | ||
602 | * I/O methods. | ||
603 | */ | ||
521 | struct <link linkend="v4l2-buffer">v4l2_buffer</link> { | 604 | struct <link linkend="v4l2-buffer">v4l2_buffer</link> { |
522 | __u32 index; | 605 | __u32 index; |
523 | enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; | 606 | enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; |
@@ -533,6 +616,7 @@ struct <link linkend="v4l2-buffer">v4l2_buffer</link> { | |||
533 | union { | 616 | union { |
534 | __u32 offset; | 617 | __u32 offset; |
535 | unsigned long userptr; | 618 | unsigned long userptr; |
619 | struct <link linkend="v4l2-plane">v4l2_plane</link> *planes; | ||
536 | } m; | 620 | } m; |
537 | __u32 length; | 621 | __u32 length; |
538 | __u32 input; | 622 | __u32 input; |
@@ -1623,12 +1707,56 @@ struct <link linkend="v4l2-mpeg-vbi-fmt-ivtv">v4l2_mpeg_vbi_fmt_ivtv</link> { | |||
1623 | * A G G R E G A T E S T R U C T U R E S | 1707 | * A G G R E G A T E S T R U C T U R E S |
1624 | */ | 1708 | */ |
1625 | 1709 | ||
1626 | /* Stream data format | 1710 | /** |
1711 | * struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> - additional, per-plane format definition | ||
1712 | * @sizeimage: maximum size in bytes required for data, for which | ||
1713 | * this plane will be used | ||
1714 | * @bytesperline: distance in bytes between the leftmost pixels in two | ||
1715 | * adjacent lines | ||
1716 | */ | ||
1717 | struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> { | ||
1718 | __u32 sizeimage; | ||
1719 | __u16 bytesperline; | ||
1720 | __u16 reserved[7]; | ||
1721 | } __attribute__ ((packed)); | ||
1722 | |||
1723 | /** | ||
1724 | * struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> - multiplanar format definition | ||
1725 | * @width: image width in pixels | ||
1726 | * @height: image height in pixels | ||
1727 | * @pixelformat: little endian four character code (fourcc) | ||
1728 | * @field: field order (for interlaced video) | ||
1729 | * @colorspace: supplemental to pixelformat | ||
1730 | * @plane_fmt: per-plane information | ||
1731 | * @num_planes: number of planes for this format | ||
1732 | */ | ||
1733 | struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> { | ||
1734 | __u32 width; | ||
1735 | __u32 height; | ||
1736 | __u32 pixelformat; | ||
1737 | enum <link linkend="v4l2-field">v4l2_field</link> field; | ||
1738 | enum <link linkend="v4l2-colorspace">v4l2_colorspace</link> colorspace; | ||
1739 | |||
1740 | struct <link linkend="v4l2-plane-pix-format">v4l2_plane_pix_format</link> plane_fmt[VIDEO_MAX_PLANES]; | ||
1741 | __u8 num_planes; | ||
1742 | __u8 reserved[11]; | ||
1743 | } __attribute__ ((packed)); | ||
1744 | |||
1745 | /** | ||
1746 | * struct <link linkend="v4l2-format">v4l2_format</link> - stream data format | ||
1747 | * @type: type of the data stream | ||
1748 | * @pix: definition of an image format | ||
1749 | * @pix_mp: definition of a multiplanar image format | ||
1750 | * @win: definition of an overlaid image | ||
1751 | * @vbi: raw VBI capture or output parameters | ||
1752 | * @sliced: sliced VBI capture or output parameters | ||
1753 | * @raw_data: placeholder for future extensions and custom formats | ||
1627 | */ | 1754 | */ |
1628 | struct <link linkend="v4l2-format">v4l2_format</link> { | 1755 | struct <link linkend="v4l2-format">v4l2_format</link> { |
1629 | enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; | 1756 | enum <link linkend="v4l2-buf-type">v4l2_buf_type</link> type; |
1630 | union { | 1757 | union { |
1631 | struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ | 1758 | struct <link linkend="v4l2-pix-format">v4l2_pix_format</link> pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */ |
1759 | struct <link linkend="v4l2-pix-format-mplane">v4l2_pix_format_mplane</link> pix_mp; /* V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE */ | ||
1632 | struct <link linkend="v4l2-window">v4l2_window</link> win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ | 1760 | struct <link linkend="v4l2-window">v4l2_window</link> win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */ |
1633 | struct <link linkend="v4l2-vbi-format">v4l2_vbi_format</link> vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ | 1761 | struct <link linkend="v4l2-vbi-format">v4l2_vbi_format</link> vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */ |
1634 | struct <link linkend="v4l2-sliced-vbi-format">v4l2_sliced_vbi_format</link> sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ | 1762 | struct <link linkend="v4l2-sliced-vbi-format">v4l2_sliced_vbi_format</link> sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */ |
@@ -1636,7 +1764,6 @@ struct <link linkend="v4l2-format">v4l2_format</link> { | |||
1636 | } fmt; | 1764 | } fmt; |
1637 | }; | 1765 | }; |
1638 | 1766 | ||
1639 | |||
1640 | /* Stream type-dependent parameters | 1767 | /* Stream type-dependent parameters |
1641 | */ | 1768 | */ |
1642 | struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> { | 1769 | struct <link linkend="v4l2-streamparm">v4l2_streamparm</link> { |
@@ -1809,16 +1936,6 @@ struct <link linkend="v4l2-dbg-chip-ident">v4l2_dbg_chip_ident</link> { | |||
1809 | /* Reminder: when adding new ioctls please add support for them to | 1936 | /* Reminder: when adding new ioctls please add support for them to |
1810 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ | 1937 | drivers/media/video/v4l2-compat-ioctl32.c as well! */ |
1811 | 1938 | ||
1812 | #ifdef __OLD_VIDIOC_ | ||
1813 | /* for compatibility, will go away some day */ | ||
1814 | #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int) | ||
1815 | #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct <link linkend="v4l2-streamparm">v4l2_streamparm</link>) | ||
1816 | #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct <link linkend="v4l2-control">v4l2_control</link>) | ||
1817 | #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct <link linkend="v4l2-audio">v4l2_audio</link>) | ||
1818 | #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct <link linkend="v4l2-audioout">v4l2_audioout</link>) | ||
1819 | #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct <link linkend="v4l2-cropcap">v4l2_cropcap</link>) | ||
1820 | #endif | ||
1821 | |||
1822 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ | 1939 | #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ |
1823 | 1940 | ||
1824 | #endif /* __LINUX_VIDEODEV2_H */ | 1941 | #endif /* __LINUX_VIDEODEV2_H */ |