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