Merge tag 'linux-watchdog-4.21-rc1' of git://www.linux-watchdog.org/linux-watchdog
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / vidioc-g-jpegcomp.rst
1 .. Permission is granted to copy, distribute and/or modify this
2 .. document under the terms of the GNU Free Documentation License,
3 .. Version 1.1 or any later version published by the Free Software
4 .. Foundation, with no Invariant Sections, no Front-Cover Texts
5 .. and no Back-Cover Texts. A copy of the license is included at
6 .. Documentation/media/uapi/fdl-appendix.rst.
7 ..
8 .. TODO: replace it to GFDL-1.1-or-later WITH no-invariant-sections
9
10 .. _VIDIOC_G_JPEGCOMP:
11
12 ******************************************
13 ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
14 ******************************************
15
16 Name
17 ====
18
19 VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP
20
21
22 Synopsis
23 ========
24
25 .. c:function:: int ioctl( int fd, VIDIOC_G_JPEGCOMP, v4l2_jpegcompression *argp )
26     :name: VIDIOC_G_JPEGCOMP
27
28 .. c:function:: int ioctl( int fd, VIDIOC_S_JPEGCOMP, const v4l2_jpegcompression *argp )
29     :name: VIDIOC_S_JPEGCOMP
30
31
32 Arguments
33 =========
34
35 ``fd``
36     File descriptor returned by :ref:`open() <func-open>`.
37
38 ``argp``
39     Pointer to struct :c:type:`v4l2_jpegcompression`.
40
41
42 Description
43 ===========
44
45 These ioctls are **deprecated**. New drivers and applications should use
46 :ref:`JPEG class controls <jpeg-controls>` for image quality and JPEG
47 markers control.
48
49 [to do]
50
51 Ronald Bultje elaborates:
52
53 APP is some application-specific information. The application can set it
54 itself, and it'll be stored in the JPEG-encoded fields (eg; interlacing
55 information for in an AVI or so). COM is the same, but it's comments,
56 like 'encoded by me' or so.
57
58 jpeg_markers describes whether the huffman tables, quantization tables
59 and the restart interval information (all JPEG-specific stuff) should be
60 stored in the JPEG-encoded fields. These define how the JPEG field is
61 encoded. If you omit them, applications assume you've used standard
62 encoding. You usually do want to add them.
63
64
65 .. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
66
67 .. c:type:: v4l2_jpegcompression
68
69 .. flat-table:: struct v4l2_jpegcompression
70     :header-rows:  0
71     :stub-columns: 0
72     :widths:       1 1 2
73
74     * - int
75       - ``quality``
76       - Deprecated. If
77         :ref:`V4L2_CID_JPEG_COMPRESSION_QUALITY <jpeg-quality-control>`
78         control is exposed by a driver applications should use it instead
79         and ignore this field.
80     * - int
81       - ``APPn``
82       -
83     * - int
84       - ``APP_len``
85       -
86     * - char
87       - ``APP_data``\ [60]
88       -
89     * - int
90       - ``COM_len``
91       -
92     * - char
93       - ``COM_data``\ [60]
94       -
95     * - __u32
96       - ``jpeg_markers``
97       - See :ref:`jpeg-markers`. Deprecated. If
98         :ref:`V4L2_CID_JPEG_ACTIVE_MARKER <jpeg-active-marker-control>`
99         control is exposed by a driver applications should use it instead
100         and ignore this field.
101
102
103 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
104
105 .. _jpeg-markers:
106
107 .. flat-table:: JPEG Markers Flags
108     :header-rows:  0
109     :stub-columns: 0
110     :widths:       3 1 4
111
112     * - ``V4L2_JPEG_MARKER_DHT``
113       - (1<<3)
114       - Define Huffman Tables
115     * - ``V4L2_JPEG_MARKER_DQT``
116       - (1<<4)
117       - Define Quantization Tables
118     * - ``V4L2_JPEG_MARKER_DRI``
119       - (1<<5)
120       - Define Restart Interval
121     * - ``V4L2_JPEG_MARKER_COM``
122       - (1<<6)
123       - Comment segment
124     * - ``V4L2_JPEG_MARKER_APP``
125       - (1<<7)
126       - App segment, driver will always use APP0
127
128
129 Return Value
130 ============
131
132 On success 0 is returned, on error -1 and the ``errno`` variable is set
133 appropriately. The generic error codes are described at the
134 :ref:`Generic Error Codes <gen-errors>` chapter.