diff options
Diffstat (limited to 'Documentation/DocBook/v4l/pixfmt.xml')
-rw-r--r-- | Documentation/DocBook/v4l/pixfmt.xml | 151 |
1 files changed, 142 insertions, 9 deletions
diff --git a/Documentation/DocBook/v4l/pixfmt.xml b/Documentation/DocBook/v4l/pixfmt.xml index c4ad0a8e42dc..deb660207f94 100644 --- a/Documentation/DocBook/v4l/pixfmt.xml +++ b/Documentation/DocBook/v4l/pixfmt.xml | |||
@@ -2,12 +2,16 @@ | |||
2 | 2 | ||
3 | <para>The V4L2 API was primarily designed for devices exchanging | 3 | <para>The V4L2 API was primarily designed for devices exchanging |
4 | image data with applications. The | 4 | image data with applications. The |
5 | <structname>v4l2_pix_format</structname> structure defines the format | 5 | <structname>v4l2_pix_format</structname> and <structname>v4l2_pix_format_mplane |
6 | and layout of an image in memory. Image formats are negotiated with | 6 | </structname> structures define the format and layout of an image in memory. |
7 | the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video | 7 | The former is used with the single-planar API, while the latter is used with the |
8 | multi-planar version (see <xref linkend="planar-apis"/>). Image formats are | ||
9 | negotiated with the &VIDIOC-S-FMT; ioctl. (The explanations here focus on video | ||
8 | capturing and output, for overlay frame buffer formats see also | 10 | capturing and output, for overlay frame buffer formats see also |
9 | &VIDIOC-G-FBUF;.)</para> | 11 | &VIDIOC-G-FBUF;.)</para> |
10 | 12 | ||
13 | <section> | ||
14 | <title>Single-planar format structure</title> | ||
11 | <table pgwide="1" frame="none" id="v4l2-pix-format"> | 15 | <table pgwide="1" frame="none" id="v4l2-pix-format"> |
12 | <title>struct <structname>v4l2_pix_format</structname></title> | 16 | <title>struct <structname>v4l2_pix_format</structname></title> |
13 | <tgroup cols="3"> | 17 | <tgroup cols="3"> |
@@ -106,6 +110,98 @@ set this field to zero.</entry> | |||
106 | </tbody> | 110 | </tbody> |
107 | </tgroup> | 111 | </tgroup> |
108 | </table> | 112 | </table> |
113 | </section> | ||
114 | |||
115 | <section> | ||
116 | <title>Multi-planar format structures</title> | ||
117 | <para>The <structname>v4l2_plane_pix_format</structname> structures define | ||
118 | size and layout for each of the planes in a multi-planar format. | ||
119 | The <structname>v4l2_pix_format_mplane</structname> structure contains | ||
120 | information common to all planes (such as image width and height) and | ||
121 | an array of <structname>v4l2_plane_pix_format</structname> structures, | ||
122 | describing all planes of that format.</para> | ||
123 | <table pgwide="1" frame="none" id="v4l2-plane-pix-format"> | ||
124 | <title>struct <structname>vl42_plane_pix_format</structname></title> | ||
125 | <tgroup cols="3"> | ||
126 | &cs-str; | ||
127 | <tbody valign="top"> | ||
128 | <row> | ||
129 | <entry>__u32</entry> | ||
130 | <entry><structfield>sizeimage</structfield></entry> | ||
131 | <entry>Maximum size in bytes required for image data in this plane. | ||
132 | </entry> | ||
133 | </row> | ||
134 | <row> | ||
135 | <entry>__u16</entry> | ||
136 | <entry><structfield>bytesperline</structfield></entry> | ||
137 | <entry>Distance in bytes between the leftmost pixels in two adjacent | ||
138 | lines.</entry> | ||
139 | </row> | ||
140 | <row> | ||
141 | <entry>__u16</entry> | ||
142 | <entry><structfield>reserved[7]</structfield></entry> | ||
143 | <entry>Reserved for future extensions. Should be zeroed by the | ||
144 | application.</entry> | ||
145 | </row> | ||
146 | </tbody> | ||
147 | </tgroup> | ||
148 | </table> | ||
149 | <table pgwide="1" frame="none" id="v4l2-pix-format-mplane"> | ||
150 | <title>struct <structname>v4l2_pix_format_mplane</structname></title> | ||
151 | <tgroup cols="3"> | ||
152 | &cs-str; | ||
153 | <tbody valign="top"> | ||
154 | <row> | ||
155 | <entry>__u32</entry> | ||
156 | <entry><structfield>width</structfield></entry> | ||
157 | <entry>Image width in pixels.</entry> | ||
158 | </row> | ||
159 | <row> | ||
160 | <entry>__u32</entry> | ||
161 | <entry><structfield>height</structfield></entry> | ||
162 | <entry>Image height in pixels.</entry> | ||
163 | </row> | ||
164 | <row> | ||
165 | <entry>__u32</entry> | ||
166 | <entry><structfield>pixelformat</structfield></entry> | ||
167 | <entry>The pixel format. Both single- and multi-planar four character | ||
168 | codes can be used.</entry> | ||
169 | </row> | ||
170 | <row> | ||
171 | <entry>&v4l2-field;</entry> | ||
172 | <entry><structfield>field</structfield></entry> | ||
173 | <entry>See &v4l2-pix-format;.</entry> | ||
174 | </row> | ||
175 | <row> | ||
176 | <entry>&v4l2-colorspace;</entry> | ||
177 | <entry><structfield>colorspace</structfield></entry> | ||
178 | <entry>See &v4l2-pix-format;.</entry> | ||
179 | </row> | ||
180 | <row> | ||
181 | <entry>&v4l2-plane-pix-format;</entry> | ||
182 | <entry><structfield>plane_fmt[VIDEO_MAX_PLANES]</structfield></entry> | ||
183 | <entry>An array of structures describing format of each plane this | ||
184 | pixel format consists of. The number of valid entries in this array | ||
185 | has to be put in the <structfield>num_planes</structfield> | ||
186 | field.</entry> | ||
187 | </row> | ||
188 | <row> | ||
189 | <entry>__u8</entry> | ||
190 | <entry><structfield>num_planes</structfield></entry> | ||
191 | <entry>Number of planes (i.e. separate memory buffers) for this format | ||
192 | and the number of valid entries in the | ||
193 | <structfield>plane_fmt</structfield> array.</entry> | ||
194 | </row> | ||
195 | <row> | ||
196 | <entry>__u8</entry> | ||
197 | <entry><structfield>reserved[11]</structfield></entry> | ||
198 | <entry>Reserved for future extensions. Should be zeroed by the | ||
199 | application.</entry> | ||
200 | </row> | ||
201 | </tbody> | ||
202 | </tgroup> | ||
203 | </table> | ||
204 | </section> | ||
109 | 205 | ||
110 | <section> | 206 | <section> |
111 | <title>Standard Image Formats</title> | 207 | <title>Standard Image Formats</title> |
@@ -144,9 +240,17 @@ has just as many pad bytes after it as the other rows.</para> | |||
144 | <para>In V4L2 each format has an identifier which looks like | 240 | <para>In V4L2 each format has an identifier which looks like |
145 | <constant>PIX_FMT_XXX</constant>, defined in the <link | 241 | <constant>PIX_FMT_XXX</constant>, defined in the <link |
146 | linkend="videodev">videodev.h</link> header file. These identifiers | 242 | linkend="videodev">videodev.h</link> header file. These identifiers |
147 | represent <link linkend="v4l2-fourcc">four character codes</link> | 243 | represent <link linkend="v4l2-fourcc">four character (FourCC) codes</link> |
148 | which are also listed below, however they are not the same as those | 244 | which are also listed below, however they are not the same as those |
149 | used in the Windows world.</para> | 245 | used in the Windows world.</para> |
246 | |||
247 | <para>For some formats, data is stored in separate, discontiguous | ||
248 | memory buffers. Those formats are identified by a separate set of FourCC codes | ||
249 | and are referred to as "multi-planar formats". For example, a YUV422 frame is | ||
250 | normally stored in one memory buffer, but it can also be placed in two or three | ||
251 | separate buffers, with Y component in one buffer and CbCr components in another | ||
252 | in the 2-planar version or with each component in its own buffer in the | ||
253 | 3-planar case. Those sub-buffers are referred to as "planes".</para> | ||
150 | </section> | 254 | </section> |
151 | 255 | ||
152 | <section id="colorspaces"> | 256 | <section id="colorspaces"> |
@@ -566,7 +670,10 @@ access the palette, this must be done with ioctls of the Linux framebuffer API.< | |||
566 | &sub-sbggr8; | 670 | &sub-sbggr8; |
567 | &sub-sgbrg8; | 671 | &sub-sgbrg8; |
568 | &sub-sgrbg8; | 672 | &sub-sgrbg8; |
673 | &sub-srggb8; | ||
569 | &sub-sbggr16; | 674 | &sub-sbggr16; |
675 | &sub-srggb10; | ||
676 | &sub-srggb12; | ||
570 | </section> | 677 | </section> |
571 | 678 | ||
572 | <section id="yuv-formats"> | 679 | <section id="yuv-formats"> |
@@ -589,6 +696,9 @@ information.</para> | |||
589 | 696 | ||
590 | &sub-packed-yuv; | 697 | &sub-packed-yuv; |
591 | &sub-grey; | 698 | &sub-grey; |
699 | &sub-y10; | ||
700 | &sub-y12; | ||
701 | &sub-y10b; | ||
592 | &sub-y16; | 702 | &sub-y16; |
593 | &sub-yuyv; | 703 | &sub-yuyv; |
594 | &sub-uyvy; | 704 | &sub-uyvy; |
@@ -596,11 +706,15 @@ information.</para> | |||
596 | &sub-vyuy; | 706 | &sub-vyuy; |
597 | &sub-y41p; | 707 | &sub-y41p; |
598 | &sub-yuv420; | 708 | &sub-yuv420; |
709 | &sub-yuv420m; | ||
599 | &sub-yuv410; | 710 | &sub-yuv410; |
600 | &sub-yuv422p; | 711 | &sub-yuv422p; |
601 | &sub-yuv411p; | 712 | &sub-yuv411p; |
602 | &sub-nv12; | 713 | &sub-nv12; |
714 | &sub-nv12m; | ||
715 | &sub-nv12mt; | ||
603 | &sub-nv16; | 716 | &sub-nv16; |
717 | &sub-m420; | ||
604 | </section> | 718 | </section> |
605 | 719 | ||
606 | <section> | 720 | <section> |
@@ -685,6 +799,11 @@ http://www.ivtvdriver.org/</ulink></para><para>The format is documented in the | |||
685 | kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> | 799 | kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm12</filename> |
686 | </para></entry> | 800 | </para></entry> |
687 | </row> | 801 | </row> |
802 | <row id="V4L2-PIX-FMT-CPIA1"> | ||
803 | <entry><constant>V4L2_PIX_FMT_CPIA1</constant></entry> | ||
804 | <entry>'CPIA'</entry> | ||
805 | <entry>YUV format used by the gspca cpia1 driver.</entry> | ||
806 | </row> | ||
688 | <row id="V4L2-PIX-FMT-SPCA501"> | 807 | <row id="V4L2-PIX-FMT-SPCA501"> |
689 | <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> | 808 | <entry><constant>V4L2_PIX_FMT_SPCA501</constant></entry> |
690 | <entry>'S501'</entry> | 809 | <entry>'S501'</entry> |
@@ -705,11 +824,6 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
705 | <entry>'S561'</entry> | 824 | <entry>'S561'</entry> |
706 | <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> | 825 | <entry>Compressed GBRG Bayer format used by the gspca driver.</entry> |
707 | </row> | 826 | </row> |
708 | <row id="V4L2-PIX-FMT-SGRBG10"> | ||
709 | <entry><constant>V4L2_PIX_FMT_SGRBG10</constant></entry> | ||
710 | <entry>'DA10'</entry> | ||
711 | <entry>10 bit raw Bayer, expanded to 16 bits.</entry> | ||
712 | </row> | ||
713 | <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> | 827 | <row id="V4L2-PIX-FMT-SGRBG10DPCM8"> |
714 | <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> | 828 | <entry><constant>V4L2_PIX_FMT_SGRBG10DPCM8</constant></entry> |
715 | <entry>'DB10'</entry> | 829 | <entry>'DB10'</entry> |
@@ -770,6 +884,11 @@ kernel sources in the file <filename>Documentation/video4linux/cx2341x/README.hm | |||
770 | <entry>'S920'</entry> | 884 | <entry>'S920'</entry> |
771 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> | 885 | <entry>YUV 4:2:0 format of the gspca sn9c20x driver.</entry> |
772 | </row> | 886 | </row> |
887 | <row id="V4L2-PIX-FMT-SN9C2028"> | ||
888 | <entry><constant>V4L2_PIX_FMT_SN9C2028</constant></entry> | ||
889 | <entry>'SONX'</entry> | ||
890 | <entry>Compressed GBRG bayer format of the gspca sn9c2028 driver.</entry> | ||
891 | </row> | ||
773 | <row id="V4L2-PIX-FMT-STV0680"> | 892 | <row id="V4L2-PIX-FMT-STV0680"> |
774 | <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> | 893 | <entry><constant>V4L2_PIX_FMT_STV0680</constant></entry> |
775 | <entry>'S680'</entry> | 894 | <entry>'S680'</entry> |
@@ -787,6 +906,20 @@ http://www.thedirks.org/winnov/</ulink></para></entry> | |||
787 | <entry>'TM60'</entry> | 906 | <entry>'TM60'</entry> |
788 | <entry><para>Used by Trident tm6000</para></entry> | 907 | <entry><para>Used by Trident tm6000</para></entry> |
789 | </row> | 908 | </row> |
909 | <row id="V4L2-PIX-FMT-CIT-YYVYUY"> | ||
910 | <entry><constant>V4L2_PIX_FMT_CIT_YYVYUY</constant></entry> | ||
911 | <entry>'CITV'</entry> | ||
912 | <entry><para>Used by xirlink CIT, found at IBM webcams.</para> | ||
913 | <para>Uses one line of Y then 1 line of VYUY</para> | ||
914 | </entry> | ||
915 | </row> | ||
916 | <row id="V4L2-PIX-FMT-KONICA420"> | ||
917 | <entry><constant>V4L2_PIX_FMT_KONICA420</constant></entry> | ||
918 | <entry>'KONI'</entry> | ||
919 | <entry><para>Used by Konica webcams.</para> | ||
920 | <para>YUV420 planar in blocks of 256 pixels.</para> | ||
921 | </entry> | ||
922 | </row> | ||
790 | <row id="V4L2-PIX-FMT-YYUV"> | 923 | <row id="V4L2-PIX-FMT-YYUV"> |
791 | <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> | 924 | <entry><constant>V4L2_PIX_FMT_YYUV</constant></entry> |
792 | <entry>'YYUV'</entry> | 925 | <entry>'YYUV'</entry> |