387c71c209bcc09c141b2d792b3a6515ba8c4757
[cascardo/linux.git] / Documentation / media / uapi / v4l / vidioc-g-jpegcomp.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _VIDIOC_G_JPEGCOMP:
4
5 ******************************************
6 ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
7 ******************************************
8
9 Name
10 ====
11
12 VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP
13
14
15 Synopsis
16 ========
17
18 .. c:function:: int ioctl( int fd, VIDIOC_G_JPEGCOMP, v4l2_jpegcompression *argp )
19     :name: VIDIOC_G_JPEGCOMP
20
21 .. c:function:: int ioctl( int fd, VIDIOC_S_JPEGCOMP, const v4l2_jpegcompression *argp )
22     :name: VIDIOC_S_JPEGCOMP
23
24
25 Arguments
26 =========
27
28 ``fd``
29     File descriptor returned by :ref:`open() <func-open>`.
30
31 ``argp``
32
33
34 Description
35 ===========
36
37 These ioctls are **deprecated**. New drivers and applications should use
38 :ref:`JPEG class controls <jpeg-controls>` for image quality and JPEG
39 markers control.
40
41 [to do]
42
43 Ronald Bultje elaborates:
44
45 APP is some application-specific information. The application can set it
46 itself, and it'll be stored in the JPEG-encoded fields (eg; interlacing
47 information for in an AVI or so). COM is the same, but it's comments,
48 like 'encoded by me' or so.
49
50 jpeg_markers describes whether the huffman tables, quantization tables
51 and the restart interval information (all JPEG-specific stuff) should be
52 stored in the JPEG-encoded fields. These define how the JPEG field is
53 encoded. If you omit them, applications assume you've used standard
54 encoding. You usually do want to add them.
55
56
57 .. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
58
59 .. _v4l2-jpegcompression:
60
61 .. flat-table:: struct v4l2_jpegcompression
62     :header-rows:  0
63     :stub-columns: 0
64     :widths:       1 1 2
65
66
67     -  .. row 1
68
69        -  int
70
71        -  ``quality``
72
73        -  Deprecated. If
74           :ref:`V4L2_CID_JPEG_COMPRESSION_QUALITY <jpeg-quality-control>`
75           control is exposed by a driver applications should use it instead
76           and ignore this field.
77
78     -  .. row 2
79
80        -  int
81
82        -  ``APPn``
83
84        -
85
86     -  .. row 3
87
88        -  int
89
90        -  ``APP_len``
91
92        -
93
94     -  .. row 4
95
96        -  char
97
98        -  ``APP_data``\ [60]
99
100        -
101
102     -  .. row 5
103
104        -  int
105
106        -  ``COM_len``
107
108        -
109
110     -  .. row 6
111
112        -  char
113
114        -  ``COM_data``\ [60]
115
116        -
117
118     -  .. row 7
119
120        -  __u32
121
122        -  ``jpeg_markers``
123
124        -  See :ref:`jpeg-markers`. Deprecated. If
125           :ref:`V4L2_CID_JPEG_ACTIVE_MARKER <jpeg-active-marker-control>`
126           control is exposed by a driver applications should use it instead
127           and ignore this field.
128
129
130 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
131
132 .. _jpeg-markers:
133
134 .. flat-table:: JPEG Markers Flags
135     :header-rows:  0
136     :stub-columns: 0
137     :widths:       3 1 4
138
139
140     -  .. row 1
141
142        -  ``V4L2_JPEG_MARKER_DHT``
143
144        -  (1<<3)
145
146        -  Define Huffman Tables
147
148     -  .. row 2
149
150        -  ``V4L2_JPEG_MARKER_DQT``
151
152        -  (1<<4)
153
154        -  Define Quantization Tables
155
156     -  .. row 3
157
158        -  ``V4L2_JPEG_MARKER_DRI``
159
160        -  (1<<5)
161
162        -  Define Restart Interval
163
164     -  .. row 4
165
166        -  ``V4L2_JPEG_MARKER_COM``
167
168        -  (1<<6)
169
170        -  Comment segment
171
172     -  .. row 5
173
174        -  ``V4L2_JPEG_MARKER_APP``
175
176        -  (1<<7)
177
178        -  App segment, driver will always use APP0
179
180
181 Return Value
182 ============
183
184 On success 0 is returned, on error -1 and the ``errno`` variable is set
185 appropriately. The generic error codes are described at the
186 :ref:`Generic Error Codes <gen-errors>` chapter.