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