2020-08-26 10:03:09 +03:00
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
2020-09-24 15:04:26 +03:00
.. c:namespace :: V4L
2018-08-30 17:15:26 +03:00
2016-07-01 19:42:29 +03:00
.. _VIDIOC_G_EXT_CTRLS:
2016-06-30 16:18:56 +03:00
***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *
ioctl VIDIOC_G_EXT_CTRLS, VIDIOC_S_EXT_CTRLS, VIDIOC_TRY_EXT_CTRLS
***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** ***** *
2016-07-05 21:14:35 +03:00
Name
2016-07-05 13:58:48 +03:00
====
2016-06-30 16:18:56 +03:00
2016-07-05 13:58:48 +03:00
VIDIOC_G_EXT_CTRLS - VIDIOC_S_EXT_CTRLS - VIDIOC_TRY_EXT_CTRLS - Get or set the value of several controls, try control values
2016-06-30 16:18:56 +03:00
2016-07-05 21:14:35 +03:00
Synopsis
2016-06-30 16:18:56 +03:00
========
2020-09-24 15:04:26 +03:00
.. c:macro :: VIDIOC_G_EXT_CTRLS
2016-08-19 22:53:38 +03:00
2020-09-24 15:04:26 +03:00
`` int ioctl(int fd, VIDIOC_G_EXT_CTRLS, struct v4l2_ext_controls *argp) ``
2016-08-19 22:53:38 +03:00
2020-09-24 15:04:26 +03:00
.. c:macro :: VIDIOC_S_EXT_CTRLS
2016-08-19 22:53:38 +03:00
2020-09-24 15:04:26 +03:00
`` int ioctl(int fd, VIDIOC_S_EXT_CTRLS, struct v4l2_ext_controls *argp) ``
2016-08-19 22:53:38 +03:00
2020-09-24 15:04:26 +03:00
.. c:macro :: VIDIOC_TRY_EXT_CTRLS
2016-06-30 16:18:56 +03:00
2020-09-24 15:04:26 +03:00
`` int ioctl(int fd, VIDIOC_TRY_EXT_CTRLS, struct v4l2_ext_controls *argp) ``
2016-07-05 13:58:48 +03:00
2016-07-05 21:14:35 +03:00
Arguments
2016-06-30 16:18:56 +03:00
=========
`` fd ``
2020-09-24 15:04:26 +03:00
File descriptor returned by :c:func: `open()` .
2016-06-30 16:18:56 +03:00
`` argp ``
2017-09-02 16:54:48 +03:00
Pointer to struct :c:type: `v4l2_ext_controls` .
2016-06-30 16:18:56 +03:00
2016-07-05 21:14:35 +03:00
Description
2016-06-30 16:18:56 +03:00
===========
These ioctls allow the caller to get or set multiple controls
atomically. Control IDs are grouped into control classes (see
:ref: `ctrl-class` ) and all controls in the control array must belong
to the same control class.
Applications must always fill in the `` count `` , `` which `` , `` controls ``
and `` reserved `` fields of struct
2016-08-29 23:37:59 +03:00
:c:type: `v4l2_ext_controls` , and initialize the
struct :c:type: `v4l2_ext_control` array pointed to
2016-06-30 16:18:56 +03:00
by the `` controls `` fields.
To get the current value of a set of controls applications initialize
the `` id `` , `` size `` and `` reserved2 `` fields of each struct
2016-08-29 23:37:59 +03:00
:c:type: `v4l2_ext_control` and call the
2020-07-04 02:55:34 +03:00
:ref: `VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. String controls must also set the
2016-06-30 16:18:56 +03:00
`` string `` field. Controls of compound types
(`` V4L2_CTRL_FLAG_HAS_PAYLOAD `` is set) must set the `` ptr `` field.
If the `` size `` is too small to receive the control result (only
relevant for pointer-type controls like strings), then the driver will
2016-07-03 17:53:09 +03:00
set `` size `` to a valid value and return an `` ENOSPC `` error code. You
2016-06-30 16:18:56 +03:00
should re-allocate the memory to this new size and try again. For the
string type it is possible that the same issue occurs again if the
string has grown in the meantime. It is recommended to call
2016-07-01 19:58:44 +03:00
:ref: `VIDIOC_QUERYCTRL` first and use
2016-06-30 16:18:56 +03:00
`` maximum ` ` \ +1 as the new ` ` size `` value. It is guaranteed that that is
sufficient memory.
N-dimensional arrays are set and retrieved row-by-row. You cannot set a
partial array, all elements have to be set or retrieved. The total size
is calculated as `` elems `` * `` elem_size `` . These values can be obtained
2016-07-01 19:42:29 +03:00
by calling :ref: `VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>` .
2016-06-30 16:18:56 +03:00
To change the value of a set of controls applications initialize the
`` id `` , `` size `` , `` reserved2 `` and `` value/value64/string/ptr `` fields
2016-08-29 23:37:59 +03:00
of each struct :c:type: `v4l2_ext_control` and call
2016-07-01 20:33:56 +03:00
the :ref: `VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. The controls will only be set if *all*
2016-06-30 16:18:56 +03:00
control values are valid.
To check if a set of controls have correct values applications
initialize the `` id `` , `` size `` , `` reserved2 `` and
`` value/value64/string/ptr `` fields of each struct
2016-08-29 23:37:59 +03:00
:c:type: `v4l2_ext_control` and call the
2016-07-01 20:33:56 +03:00
:ref: `VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctl. It is up to the driver whether wrong
2016-06-30 16:18:56 +03:00
values are automatically adjusted to a valid value or if an error is
returned.
2016-07-03 17:53:09 +03:00
When the `` id `` or `` which `` is invalid drivers return an `` EINVAL `` error
2016-06-30 16:18:56 +03:00
code. When the value is out of bounds drivers can choose to take the
2016-07-03 17:53:09 +03:00
closest valid value or return an `` ERANGE `` error code, whatever seems more
2016-06-30 16:18:56 +03:00
appropriate. In the first case the new value is set in struct
2016-08-29 23:37:59 +03:00
:c:type: `v4l2_ext_control` . If the new control value
2016-06-30 16:18:56 +03:00
is inappropriate (e.g. the given menu index is not supported by the menu
2016-07-03 17:53:09 +03:00
control), then this will also result in an `` EINVAL `` error code error.
2016-06-30 16:18:56 +03:00
2018-05-21 11:54:54 +03:00
If `` request_fd `` is set to a not-yet-queued :ref: `request <media-request-api>`
file descriptor and `` which `` is set to `` V4L2_CTRL_WHICH_REQUEST_VAL `` ,
then the controls are not applied immediately when calling
:ref: `VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` , but instead are applied by
the driver for the buffer associated with the same request.
2018-09-01 14:29:14 +03:00
If the device does not support requests, then `` EACCES `` will be returned.
2018-08-23 13:14:12 +03:00
If requests are supported but an invalid request file descriptor is given,
then `` EINVAL `` will be returned.
2018-05-21 11:54:54 +03:00
An attempt to call :ref: `VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` for a
request that has already been queued will result in an `` EBUSY `` error.
2018-08-23 13:33:49 +03:00
If `` request_fd `` is specified and `` which `` is set to
`` V4L2_CTRL_WHICH_REQUEST_VAL `` during a call to
:ref: `VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` , then it will return the
values of the controls at the time of request completion.
If the request is not yet completed, then this will result in an
`` EACCES `` error.
2018-05-21 11:54:54 +03:00
2016-06-30 16:18:56 +03:00
The driver will only set/get these controls if all control values are
correct. This prevents the situation where only some of the controls
were set/get. Only low-level errors (e. g. a failed i2c command) can
still cause this situation.
2020-12-10 13:39:46 +03:00
.. tabularcolumns :: |p{6.8cm}|p{4.0cm}|p{6.5cm}|
2016-08-18 20:31:47 +03:00
2016-08-29 23:37:59 +03:00
.. c:type :: v4l2_ext_control
2016-08-19 17:14:23 +03:00
2020-12-10 13:39:46 +03:00
.. raw :: latex
\footnotesize
.. cssclass :: longtable
[media] docs-rst: add tabularcolumns to all tables
LaTeX doesn't handle too well auto-width on tables, and ReST
markup requires an special tag to give it the needed hints.
As we're using A4 paper, we have 17cm of useful spaces. As
most media tables have widths, let's use it to generate the
needed via the following perl script:
my ($line_size, $table_header, $has_cols) = (17.5, 0, 0);
my $out;
my $header = "";
my @widths = ();
sub round { $_[0] > 0 ? int($_[0] + .5) : -int(-$_[0] + .5) }
while (<>) {
if (!$table_header) {
$has_cols = 1 if (m/..\s+tabularcolumns::/);
if (m/..\s+flat-table::/) {
$table_header = 1;
$header = $_;
next;
}
$out .= $_;
next;
}
$header .= $_;
@widths = split(/ /, $1) if (m/:widths:\s+(.*)/);
if (m/^\n$/) {
if (!$has_cols && @widths) {
my ($tot, $t, $i) = (0, 0, 0);
foreach my $v(@widths) { $tot += $v; };
$out .= ".. tabularcolumns:: |";
for ($i = 0; $i < scalar @widths - 1; $i++) {
my $v = $widths[$i];
my $w = round(10 * ($v * $line_size) / $tot) / 10;
$out .= sprintf "p{%.1fcm}|", $w;
$t += $w;
}
my $w = $line_size - $t;
$out .= sprintf "p{%.1fcm}|\n\n", $w;
}
$out .= $header;
$table_header = 0;
$has_cols = 0;
$header = "";
@widths = ();
}
}
print $out;
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-17 14:14:19 +03:00
2016-06-30 16:18:56 +03:00
.. flat-table :: struct v4l2_ext_control
:header-rows: 0
:stub-columns: 0
2020-02-10 13:42:38 +03:00
:widths: 1 1 2
2016-06-30 16:18:56 +03:00
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
* - __u32
- `` id ``
- Identifies the control, set by the application.
* - __u32
- `` size ``
2021-03-18 12:03:06 +03:00
- The total size in bytes of the payload of this control.
* - :cspan: `2` The `` size `` field is normally 0, but for pointer
controls this should be set to the size of the memory that contains
the payload or that will receive the payload.
If :ref: `VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` finds that this value
is less than is required to store the payload result, then it is set
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
to a value large enough to store the payload result and `` ENOSPC `` is
returned.
.. note::
For string controls, this `` size `` field should
not be confused with the length of the string. This field refers
to the size of the memory that contains the string. The actual
*length* of the string may well be much smaller.
* - __u32
- `` reserved2 ` ` \ [1]
- Reserved for future extensions. Drivers and applications must set
the array to zero.
2020-02-10 13:42:38 +03:00
* - union {
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- (anonymous)
2020-02-10 13:42:38 +03:00
* - __s32
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` value ``
- New value or current value. Valid if this control is not of type
`` V4L2_CTRL_TYPE_INTEGER64 `` and `` V4L2_CTRL_FLAG_HAS_PAYLOAD `` is
not set.
2020-02-10 13:42:38 +03:00
* - __s64
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` value64 ``
- New value or current value. Valid if this control is of type
`` V4L2_CTRL_TYPE_INTEGER64 `` and `` V4L2_CTRL_FLAG_HAS_PAYLOAD `` is
not set.
2020-02-10 13:42:38 +03:00
* - char *
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` string ``
- A pointer to a string. Valid if this control is of type
`` V4L2_CTRL_TYPE_STRING `` .
2020-02-10 13:42:38 +03:00
* - __u8 *
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` p_u8 ``
- A pointer to a matrix control of unsigned 8-bit values. Valid if
this control is of type `` V4L2_CTRL_TYPE_U8 `` .
2020-02-10 13:42:38 +03:00
* - __u16 *
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` p_u16 ``
- A pointer to a matrix control of unsigned 16-bit values. Valid if
this control is of type `` V4L2_CTRL_TYPE_U16 `` .
2020-02-10 13:42:38 +03:00
* - __u32 *
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` p_u32 ``
- A pointer to a matrix control of unsigned 32-bit values. Valid if
this control is of type `` V4L2_CTRL_TYPE_U32 `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_area` *
2019-11-04 16:09:22 +03:00
- `` p_area ``
- A pointer to a struct :c:type: `v4l2_area` . Valid if this control is
of type `` V4L2_CTRL_TYPE_AREA `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_sps` *
2020-11-26 12:36:18 +03:00
- `` p_h264_sps ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_sps` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_SPS `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_pps` *
2020-11-26 12:36:18 +03:00
- `` p_h264_pps ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_pps` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_PPS `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_scaling_matrix` *
2020-11-26 12:36:18 +03:00
- `` p_h264_scaling_matrix ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_scaling_matrix` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_SCALING_MATRIX `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_pred_weights` *
2020-11-26 12:36:18 +03:00
- `` p_h264_pred_weights ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_pred_weights` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_PRED_WEIGHTS `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_slice_params` *
2020-11-26 12:36:18 +03:00
- `` p_h264_slice_params ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_slice_params` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_SLICE_PARAMS `` .
2020-11-26 16:27:16 +03:00
* - struct :c:type: `v4l2_ctrl_h264_decode_params` *
2020-11-26 12:36:18 +03:00
- `` p_h264_decode_params ``
- A pointer to a struct :c:type: `v4l2_ctrl_h264_decode_params` . Valid if this control is
of type `` V4L2_CTRL_TYPE_H264_DECODE_PARAMS `` .
2020-11-26 16:27:17 +03:00
* - struct :c:type: `v4l2_ctrl_fwht_params` *
- `` p_fwht_params ``
- A pointer to a struct :c:type: `v4l2_ctrl_fwht_params` . Valid if this control is
of type `` V4L2_CTRL_TYPE_FWHT_PARAMS `` .
2021-03-04 17:07:55 +03:00
* - struct :c:type: `v4l2_ctrl_vp8_frame` *
- `` p_vp8_frame ``
- A pointer to a struct :c:type: `v4l2_ctrl_vp8_frame` . Valid if this control is
of type `` V4L2_CTRL_TYPE_VP8_FRAME `` .
2021-04-29 17:48:18 +03:00
* - struct :c:type: `v4l2_ctrl_mpeg2_sequence` *
- `` p_mpeg2_sequence ``
- A pointer to a struct :c:type: `v4l2_ctrl_mpeg2_sequence` . Valid if this control is
of type `` V4L2_CTRL_TYPE_MPEG2_SEQUENCE `` .
* - struct :c:type: `v4l2_ctrl_mpeg2_picture` *
- `` p_mpeg2_picture ``
- A pointer to a struct :c:type: `v4l2_ctrl_mpeg2_picture` . Valid if this control is
of type `` V4L2_CTRL_TYPE_MPEG2_PICTURE `` .
* - struct :c:type: `v4l2_ctrl_mpeg2_quantisation` *
- `` p_mpeg2_quantisation ``
- A pointer to a struct :c:type: `v4l2_ctrl_mpeg2_quantisation` . Valid if this control is
of type `` V4L2_CTRL_TYPE_MPEG2_QUANTISATION `` .
2021-11-16 17:38:35 +03:00
* - struct :c:type: `v4l2_ctrl_vp9_compressed_hdr` *
- `` p_vp9_compressed_hdr_probs ``
- A pointer to a struct :c:type: `v4l2_ctrl_vp9_compressed_hdr` . Valid if this
control is of type `` V4L2_CTRL_TYPE_VP9_COMPRESSED_HDR `` .
* - struct :c:type: `v4l2_ctrl_vp9_frame` *
- `` p_vp9_frame ``
- A pointer to a struct :c:type: `v4l2_ctrl_vp9_frame` . Valid if this
control is of type `` V4L2_CTRL_TYPE_VP9_FRAME `` .
2021-01-19 18:08:59 +03:00
* - struct :c:type: `v4l2_ctrl_hdr10_cll_info` *
- `` p_hdr10_cll ``
- A pointer to a struct :c:type: `v4l2_ctrl_hdr10_cll_info` . Valid if this control is
of type `` V4L2_CTRL_TYPE_HDR10_CLL_INFO `` .
* - struct :c:type: `v4l2_ctrl_hdr10_mastering_display` *
- `` p_hdr10_mastering ``
- A pointer to a struct :c:type: `v4l2_ctrl_hdr10_mastering_display` . Valid if this control is
of type `` V4L2_CTRL_TYPE_HDR10_MASTERING_DISPLAY `` .
2022-07-08 19:21:56 +03:00
* - struct :c:type: `v4l2_ctrl_hevc_sps` *
- `` p_hevc_sps ``
- A pointer to a struct :c:type: `v4l2_ctrl_hevc_sps` . Valid if this
control is of type `` V4L2_CTRL_TYPE_HEVC_SPS `` .
* - struct :c:type: `v4l2_ctrl_hevc_pps` *
- `` p_hevc_pps ``
- A pointer to a struct :c:type: `v4l2_ctrl_hevc_pps` . Valid if this
control is of type `` V4L2_CTRL_TYPE_HEVC_PPS `` .
* - struct :c:type: `v4l2_ctrl_hevc_slice_params` *
- `` p_hevc_slice_params ``
- A pointer to a struct :c:type: `v4l2_ctrl_hevc_slice_params` . Valid if this
control is of type `` V4L2_CTRL_TYPE_HEVC_SLICE_PARAMS `` .
* - struct :c:type: `v4l2_ctrl_hevc_scaling_matrix` *
- `` p_hevc_scaling_matrix ``
- A pointer to a struct :c:type: `v4l2_ctrl_hevc_scaling_matrix` . Valid if this
control is of type `` V4L2_CTRL_TYPE_HEVC_SCALING_MATRIX `` .
* - struct :c:type: `v4l2_ctrl_hevc_decode_params` *
- `` p_hevc_decode_params ``
- A pointer to a struct :c:type: `v4l2_ctrl_hevc_decode_params` . Valid if this
control is of type `` V4L2_CTRL_TYPE_HEVC_DECODE_PARAMS `` .
2020-02-10 13:42:38 +03:00
* - void *
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` ptr ``
- A pointer to a compound type which can be an N-dimensional array
and/or a compound type (the control's type is >=
`` V4L2_CTRL_COMPOUND_TYPES `` ). Valid if
`` V4L2_CTRL_FLAG_HAS_PAYLOAD `` is set for this control.
2020-02-10 13:42:38 +03:00
* - }
-
2016-06-30 16:18:56 +03:00
2020-12-10 13:39:46 +03:00
.. raw :: latex
\normalsize
.. tabularcolumns :: |p{4.0cm}|p{2.5cm}|p{10.8cm}|
2016-06-30 16:18:56 +03:00
2016-08-29 23:37:59 +03:00
.. c:type :: v4l2_ext_controls
2016-06-30 16:18:56 +03:00
2016-08-18 20:31:47 +03:00
.. cssclass :: longtable
[media] docs-rst: add tabularcolumns to all tables
LaTeX doesn't handle too well auto-width on tables, and ReST
markup requires an special tag to give it the needed hints.
As we're using A4 paper, we have 17cm of useful spaces. As
most media tables have widths, let's use it to generate the
needed via the following perl script:
my ($line_size, $table_header, $has_cols) = (17.5, 0, 0);
my $out;
my $header = "";
my @widths = ();
sub round { $_[0] > 0 ? int($_[0] + .5) : -int(-$_[0] + .5) }
while (<>) {
if (!$table_header) {
$has_cols = 1 if (m/..\s+tabularcolumns::/);
if (m/..\s+flat-table::/) {
$table_header = 1;
$header = $_;
next;
}
$out .= $_;
next;
}
$header .= $_;
@widths = split(/ /, $1) if (m/:widths:\s+(.*)/);
if (m/^\n$/) {
if (!$has_cols && @widths) {
my ($tot, $t, $i) = (0, 0, 0);
foreach my $v(@widths) { $tot += $v; };
$out .= ".. tabularcolumns:: |";
for ($i = 0; $i < scalar @widths - 1; $i++) {
my $v = $widths[$i];
my $w = round(10 * ($v * $line_size) / $tot) / 10;
$out .= sprintf "p{%.1fcm}|", $w;
$t += $w;
}
my $w = $line_size - $t;
$out .= sprintf "p{%.1fcm}|\n\n", $w;
}
$out .= $header;
$table_header = 0;
$has_cols = 0;
$header = "";
@widths = ();
}
}
print $out;
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-08-17 14:14:19 +03:00
2016-06-30 16:18:56 +03:00
.. flat-table :: struct v4l2_ext_controls
:header-rows: 0
:stub-columns: 0
2020-02-10 13:42:38 +03:00
:widths: 1 1 2
2016-06-30 16:18:56 +03:00
2020-02-10 13:42:38 +03:00
* - union {
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- (anonymous)
2020-02-10 13:42:38 +03:00
* - __u32
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- `` which ``
- Which value of the control to get/set/try.
2021-03-18 12:03:06 +03:00
* - :cspan: `2` `` V4L2_CTRL_WHICH_CUR_VAL `` will return the current value of
the control, `` V4L2_CTRL_WHICH_DEF_VAL `` will return the default
2018-05-21 11:54:54 +03:00
value of the control and `` V4L2_CTRL_WHICH_REQUEST_VAL `` indicates that
these controls have to be retrieved from a request or tried/set for
a request. In the latter case the `` request_fd `` field contains the
file descriptor of the request that should be used. If the device
2018-09-01 14:29:14 +03:00
does not support requests, then `` EACCES `` will be returned.
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
2021-03-18 12:03:06 +03:00
When using `` V4L2_CTRL_WHICH_DEF_VAL `` be aware that you can only
get the default value of the control, you cannot set or try it.
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
For backwards compatibility you can also use a control class here
(see :ref: `ctrl-class` ). In that case all controls have to
belong to that control class. This usage is deprecated, instead
just use `` V4L2_CTRL_WHICH_CUR_VAL `` . There are some very old
drivers that do not yet support `` V4L2_CTRL_WHICH_CUR_VAL `` and
that require a control class here. You can test for such drivers
2021-03-18 12:03:06 +03:00
by setting `` which `` to `` V4L2_CTRL_WHICH_CUR_VAL `` and calling
:ref: `VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` with a count of 0.
If that fails, then the driver does not support `` V4L2_CTRL_WHICH_CUR_VAL `` .
* - __u32
- `` ctrl_class ``
- Deprecated name kept for backwards compatibility. Use `` which `` instead.
2020-02-10 13:42:38 +03:00
* - }
-
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
* - __u32
- `` count ``
- The number of controls in the controls array. May also be zero.
* - __u32
- `` error_idx ``
2021-03-18 12:03:06 +03:00
- Index of the failing control. Set by the driver in case of an error.
* - :cspan: `2` If the error is associated
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
with a particular control, then `` error_idx `` is set to the index
of that control. If the error is not related to a specific
control, or the validation step failed (see below), then
`` error_idx `` is set to `` count `` . The value is undefined if the
ioctl returned 0 (success).
Before controls are read from/written to hardware a validation
step takes place: this checks if all controls in the list are
valid controls, if no attempt is made to write to a read-only
control or read from a write-only control, and any other up-front
checks that can be done without accessing the hardware. The exact
validations done during this step are driver dependent since some
checks might require hardware access for some devices, thus making
it impossible to do those checks up-front. However, drivers should
make a best-effort to do as many up-front checks as possible.
This check is done to avoid leaving the hardware in an
inconsistent state due to easy-to-avoid problems. But it leads to
another problem: the application needs to know whether an error
came from the validation step (meaning that the hardware was not
touched) or from an error during the actual reading from/writing
to hardware.
The, in hindsight quite poor, solution for that is to set
`` error_idx `` to `` count `` if the validation failed. This has the
unfortunate side-effect that it is not possible to see which
control failed the validation. If the validation was successful
and the error happened while accessing the hardware, then
`` error_idx `` is less than `` count `` and only the controls up to
`` error_idx-1 `` were read or written correctly, and the state of
the remaining controls is undefined.
Since :ref: `VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` does not access hardware there is
also no need to handle the validation step in this special way, so
`` error_idx `` will just be set to the control that failed the
validation step instead of to `` count `` . This means that if
:ref: `VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` fails with `` error_idx `` set to `` count `` ,
then you can call :ref: `VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` to try to discover the
actual control that failed the validation step. Unfortunately,
there is no `` TRY `` equivalent for :ref: `VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` .
2018-05-21 11:54:54 +03:00
* - __s32
- `` request_fd ``
- File descriptor of the request to be used by this operation. Only
valid if `` which `` is set to `` V4L2_CTRL_WHICH_REQUEST_VAL `` .
2018-09-01 14:29:14 +03:00
If the device does not support requests, then `` EACCES `` will be returned.
2018-08-23 13:14:12 +03:00
If requests are supported but an invalid request file descriptor is
given, then `` EINVAL `` will be returned.
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
* - __u32
2018-05-21 11:54:54 +03:00
- `` reserved ` ` \ [1]
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- Reserved for future extensions.
Drivers and applications must set the array to zero.
* - struct :c:type: `v4l2_ext_control` *
- `` controls ``
- Pointer to an array of `` count `` v4l2_ext_control structures.
Ignored if `` count `` equals zero.
2016-06-30 16:18:56 +03:00
2020-12-10 13:39:46 +03:00
.. tabularcolumns :: |p{7.3cm}|p{2.0cm}|p{8.0cm}|
.. cssclass :: longtable
2021-03-04 17:56:09 +03:00
.. _ctrl-class:
2016-06-30 16:18:56 +03:00
.. flat-table :: Control classes
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
* - `` V4L2_CTRL_CLASS_USER ``
- 0x980000
- The class containing user controls. These controls are described
in :ref: `control` . All controls that can be set using the
:ref: `VIDIOC_S_CTRL <VIDIOC_G_CTRL>` and
:ref: `VIDIOC_G_CTRL <VIDIOC_G_CTRL>` ioctl belong to this
class.
2020-11-26 12:36:09 +03:00
* - `` V4L2_CTRL_CLASS_CODEC ``
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
- 0x990000
2020-11-26 12:36:09 +03:00
- The class containing stateful codec controls. These controls are
described in :ref: `codec-controls` .
[media] v4l: doc: Remove row numbers from tables
Shorten the tables by removing row numbers in comments, allowing for
later insertion of rows with minimal diffs.
All changes have been generated by the following script.
import io
import re
import sys
def process_table(fname, data):
if fname.endswith('hist-v4l2.rst'):
data = re.sub(u'\n{1,2}\t( ?) -( ?) ?', u'\n\t\\1 -\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n(\t| )- \.\. row [0-9]+\n\t ?-( ?) ?', u'\\1* -\\2', data, flags = re.MULTILINE)
else:
data = re.sub(u'\n{1,2} -( ?) ?', u'\n -\\1', data, flags = re.MULTILINE)
data = re.sub(u'(\n?)(\n\n - \.\. row 1\n)', u'\n\\2', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n -( ?) ?', u' * -\\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. row [0-9]+\n \.\. (_[A-Z0-9_`-]*:)', u'\n - .. \\1', data, flags = re.MULTILINE)
data = re.sub(u'\n - \.\. (_[A-Z0-9_`-]*:)\n -', u' * .. \\1\n\n -', data, flags = re.MULTILINE)
data = re.sub(u'^ - ', u' -', data, flags = re.MULTILINE)
data = re.sub(u'^(\t{1,2}) ', u'\\1', data, flags = re.MULTILINE)
return data
def process_file(fname, data):
buf = io.StringIO(data)
output = ''
in_table = False
table_separator = 0
for line in buf.readlines():
if line.find('.. flat-table::') != -1:
in_table = True
table = ''
elif in_table and not re.match('^[\t\n]|( )', line):
in_table = False
output += process_table(fname, table)
if in_table:
table += line
else:
output += line
if in_table:
in_table = False
output += process_table(fname, table)
return output
fname = sys.argv[1]
data = file(fname, 'rb').read().decode('utf-8')
data = process_file(fname, data)
file(fname, 'wb').write(data.encode('utf-8'))
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2016-09-05 14:44:34 +03:00
* - `` V4L2_CTRL_CLASS_CAMERA ``
- 0x9a0000
- The class containing camera controls. These controls are described
in :ref: `camera-controls` .
* - `` V4L2_CTRL_CLASS_FM_TX ``
- 0x9b0000
- The class containing FM Transmitter (FM TX) controls. These
controls are described in :ref: `fm-tx-controls` .
* - `` V4L2_CTRL_CLASS_FLASH ``
- 0x9c0000
- The class containing flash device controls. These controls are
described in :ref: `flash-controls` .
* - `` V4L2_CTRL_CLASS_JPEG ``
- 0x9d0000
- The class containing JPEG compression controls. These controls are
described in :ref: `jpeg-controls` .
* - `` V4L2_CTRL_CLASS_IMAGE_SOURCE ``
- 0x9e0000
- The class containing image source controls. These controls are
described in :ref: `image-source-controls` .
* - `` V4L2_CTRL_CLASS_IMAGE_PROC ``
- 0x9f0000
- The class containing image processing controls. These controls are
described in :ref: `image-process-controls` .
* - `` V4L2_CTRL_CLASS_FM_RX ``
- 0xa10000
- The class containing FM Receiver (FM RX) controls. These controls
are described in :ref: `fm-rx-controls` .
* - `` V4L2_CTRL_CLASS_RF_TUNER ``
- 0xa20000
- The class containing RF tuner controls. These controls are
described in :ref: `rf-tuner-controls` .
2020-11-26 12:36:05 +03:00
* - `` V4L2_CTRL_CLASS_DETECT ``
- 0xa30000
- The class containing motion or object detection controls. These controls
are described in :ref: `detect-controls` .
2020-11-26 12:36:12 +03:00
* - `` V4L2_CTRL_CLASS_CODEC_STATELESS ``
- 0xa40000
- The class containing stateless codec controls. These controls are
described in :ref: `codec-stateless-controls` .
2021-01-19 17:05:37 +03:00
* - `` V4L2_CTRL_CLASS_COLORIMETRY ``
- 0xa50000
- The class containing colorimetry controls. These controls are
described in :ref: `colorimetry-controls` .
2016-06-30 16:18:56 +03:00
2016-07-05 21:14:35 +03:00
Return Value
2016-06-30 16:18:56 +03:00
============
On success 0 is returned, on error -1 and the `` errno `` variable is set
appropriately. The generic error codes are described at the
:ref: `Generic Error Codes <gen-errors>` chapter.
EINVAL
2016-08-29 23:37:59 +03:00
The struct :c:type: `v4l2_ext_control` `` id `` is
2018-08-23 13:14:12 +03:00
invalid, or the struct :c:type: `v4l2_ext_controls`
2016-06-30 16:18:56 +03:00
`` which `` is invalid, or the struct
2016-08-29 23:37:59 +03:00
:c:type: `v4l2_ext_control` `` value `` was
2016-06-30 16:18:56 +03:00
inappropriate (e.g. the given menu index is not supported by the
2018-08-23 13:14:12 +03:00
driver), or the `` which `` field was set to `` V4L2_CTRL_WHICH_REQUEST_VAL ``
2018-08-28 12:11:04 +03:00
but the given `` request_fd `` was invalid or `` V4L2_CTRL_WHICH_REQUEST_VAL ``
is not supported by the kernel.
2018-08-23 13:14:12 +03:00
This error code is also returned by the
2016-07-01 20:33:56 +03:00
:ref: `VIDIOC_S_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` and :ref: `VIDIOC_TRY_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` ioctls if two or
2016-06-30 16:18:56 +03:00
more control values are in conflict.
ERANGE
2016-08-29 23:37:59 +03:00
The struct :c:type: `v4l2_ext_control` `` value ``
2016-06-30 16:18:56 +03:00
is out of bounds.
EBUSY
The control is temporarily not changeable, possibly because another
applications took over control of the device function this control
2018-05-21 11:54:54 +03:00
belongs to, or (if the `` which `` field was set to
`` V4L2_CTRL_WHICH_REQUEST_VAL `` ) the request was queued but not yet
completed.
2016-06-30 16:18:56 +03:00
ENOSPC
The space reserved for the control's payload is insufficient. The
field `` size `` is set to a value that is enough to store the payload
and this error code is returned.
EACCES
2018-08-23 13:33:49 +03:00
Attempt to try or set a read-only control, or to get a write-only
control, or to get a control from a request that has not yet been
completed.
2018-05-21 11:54:54 +03:00
2018-09-01 14:29:14 +03:00
Or the `` which `` field was set to `` V4L2_CTRL_WHICH_REQUEST_VAL `` but the
2018-05-21 11:54:54 +03:00
device does not support requests.
2021-06-18 15:29:18 +03:00
Or if there is an attempt to set an inactive control and the driver is
not capable of caching the new value until the control is active again.