Merge branch 'kvm-ppc-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus...
[sfrench/cifs-2.6.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     Pointer to struct :c:type:`v4l2_jpegcompression`.
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 .. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
59
60 .. c:type:: v4l2_jpegcompression
61
62 .. flat-table:: struct v4l2_jpegcompression
63     :header-rows:  0
64     :stub-columns: 0
65     :widths:       1 1 2
66
67     * - int
68       - ``quality``
69       - Deprecated. If
70         :ref:`V4L2_CID_JPEG_COMPRESSION_QUALITY <jpeg-quality-control>`
71         control is exposed by a driver applications should use it instead
72         and ignore this field.
73     * - int
74       - ``APPn``
75       -
76     * - int
77       - ``APP_len``
78       -
79     * - char
80       - ``APP_data``\ [60]
81       -
82     * - int
83       - ``COM_len``
84       -
85     * - char
86       - ``COM_data``\ [60]
87       -
88     * - __u32
89       - ``jpeg_markers``
90       - See :ref:`jpeg-markers`. Deprecated. If
91         :ref:`V4L2_CID_JPEG_ACTIVE_MARKER <jpeg-active-marker-control>`
92         control is exposed by a driver applications should use it instead
93         and ignore this field.
94
95
96 .. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
97
98 .. _jpeg-markers:
99
100 .. flat-table:: JPEG Markers Flags
101     :header-rows:  0
102     :stub-columns: 0
103     :widths:       3 1 4
104
105     * - ``V4L2_JPEG_MARKER_DHT``
106       - (1<<3)
107       - Define Huffman Tables
108     * - ``V4L2_JPEG_MARKER_DQT``
109       - (1<<4)
110       - Define Quantization Tables
111     * - ``V4L2_JPEG_MARKER_DRI``
112       - (1<<5)
113       - Define Restart Interval
114     * - ``V4L2_JPEG_MARKER_COM``
115       - (1<<6)
116       - Comment segment
117     * - ``V4L2_JPEG_MARKER_APP``
118       - (1<<7)
119       - App segment, driver will always use APP0
120
121
122 Return Value
123 ============
124
125 On success 0 is returned, on error -1 and the ``errno`` variable is set
126 appropriately. The generic error codes are described at the
127 :ref:`Generic Error Codes <gen-errors>` chapter.