xref: /linux/Documentation/userspace-api/media/v4l/vidioc-g-jpegcomp.rst (revision 97884ca8c2925d14c32188e865069f21378b4b4f)
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/userspace-api/media/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******************************************
13ioctl VIDIOC_G_JPEGCOMP, VIDIOC_S_JPEGCOMP
14******************************************
15
16Name
17====
18
19VIDIOC_G_JPEGCOMP - VIDIOC_S_JPEGCOMP
20
21
22Synopsis
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
32Arguments
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
42Description
43===========
44
45These ioctls are **deprecated**. New drivers and applications should use
46:ref:`JPEG class controls <jpeg-controls>` for image quality and JPEG
47markers control.
48
49[to do]
50
51Ronald Bultje elaborates:
52
53APP is some application-specific information. The application can set it
54itself, and it'll be stored in the JPEG-encoded fields (eg; interlacing
55information for in an AVI or so). COM is the same, but it's comments,
56like 'encoded by me' or so.
57
58jpeg_markers describes whether the huffman tables, quantization tables
59and the restart interval information (all JPEG-specific stuff) should be
60stored in the JPEG-encoded fields. These define how the JPEG field is
61encoded. If you omit them, applications assume you've used standard
62encoding. 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
129Return Value
130============
131
132On success 0 is returned, on error -1 and the ``errno`` variable is set
133appropriately. The generic error codes are described at the
134:ref:`Generic Error Codes <gen-errors>` chapter.
135