2016-06-30 21:18:56 +08:00
|
|
|
.. -*- coding: utf-8; mode: rst -*-
|
|
|
|
|
2016-07-02 00:42:29 +08:00
|
|
|
.. _VIDIOC_ENUMINPUT:
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
**********************
|
|
|
|
ioctl VIDIOC_ENUMINPUT
|
|
|
|
**********************
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Name
|
2016-07-05 18:58:48 +08:00
|
|
|
====
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-05 18:58:48 +08:00
|
|
|
VIDIOC_ENUMINPUT - Enumerate video inputs
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
|
|
|
|
Synopsis
|
2016-06-30 21:18:56 +08:00
|
|
|
========
|
|
|
|
|
2016-08-20 03:53:38 +08:00
|
|
|
.. c:function:: int ioctl( int fd, VIDIOC_ENUMINPUT, struct v4l2_input *argp )
|
|
|
|
:name: VIDIOC_ENUMINPUT
|
2016-06-30 21:18:56 +08:00
|
|
|
|
2016-07-05 18:58:48 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Arguments
|
2016-06-30 21:18:56 +08:00
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
|
|
|
File descriptor returned by :ref:`open() <func-open>`.
|
|
|
|
|
|
|
|
``argp``
|
2017-09-02 21:54:48 +08:00
|
|
|
Pointer to struct :c:type:`v4l2_input`.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Description
|
2016-06-30 21:18:56 +08:00
|
|
|
===========
|
|
|
|
|
|
|
|
To query the attributes of a video input applications initialize the
|
2016-08-30 04:37:59 +08:00
|
|
|
``index`` field of struct :c:type:`v4l2_input` and call the
|
2017-03-31 16:58:39 +08:00
|
|
|
:ref:`VIDIOC_ENUMINPUT` with a pointer to this structure. Drivers
|
2016-07-03 22:53:09 +08:00
|
|
|
fill the rest of the structure or return an ``EINVAL`` error code when the
|
2016-06-30 21:18:56 +08:00
|
|
|
index is out of bounds. To enumerate all inputs applications shall begin
|
2016-07-03 22:53:09 +08:00
|
|
|
at index zero, incrementing by one until the driver returns ``EINVAL``.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
[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 19:14:19 +08:00
|
|
|
.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
|
|
|
|
|
2016-08-30 04:37:59 +08:00
|
|
|
.. c:type:: v4l2_input
|
2016-08-19 22:14:23 +08:00
|
|
|
|
2016-06-30 21:18:56 +08:00
|
|
|
.. flat-table:: struct v4l2_input
|
|
|
|
:header-rows: 0
|
|
|
|
:stub-columns: 0
|
|
|
|
:widths: 1 1 2
|
|
|
|
|
[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 19:44:34 +08:00
|
|
|
* - __u32
|
|
|
|
- ``index``
|
|
|
|
- Identifies the input, set by the application.
|
|
|
|
* - __u8
|
|
|
|
- ``name``\ [32]
|
|
|
|
- Name of the video input, a NUL-terminated ASCII string, for
|
|
|
|
example: "Vin (Composite 2)". This information is intended for the
|
|
|
|
user, preferably the connector label on the device itself.
|
|
|
|
* - __u32
|
|
|
|
- ``type``
|
|
|
|
- Type of the input, see :ref:`input-type`.
|
|
|
|
* - __u32
|
|
|
|
- ``audioset``
|
|
|
|
- Drivers can enumerate up to 32 video and audio inputs. This field
|
|
|
|
shows which audio inputs were selectable as audio source if this
|
|
|
|
was the currently selected video input. It is a bit mask. The LSB
|
|
|
|
corresponds to audio input 0, the MSB to input 31. Any number of
|
|
|
|
bits can be set, or none.
|
|
|
|
|
|
|
|
When the driver does not enumerate audio inputs no bits must be
|
|
|
|
set. Applications shall not interpret this as lack of audio
|
|
|
|
support. Some drivers automatically select audio sources and do
|
|
|
|
not enumerate them since there is no choice anyway.
|
|
|
|
|
|
|
|
For details on audio inputs and how to select the current input
|
|
|
|
see :ref:`audio`.
|
|
|
|
* - __u32
|
|
|
|
- ``tuner``
|
|
|
|
- Capture devices can have zero or more tuners (RF demodulators).
|
|
|
|
When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an
|
|
|
|
RF connector and this field identifies the tuner. It corresponds
|
|
|
|
to struct :c:type:`v4l2_tuner` field ``index``. For
|
|
|
|
details on tuners see :ref:`tuner`.
|
|
|
|
* - :ref:`v4l2_std_id <v4l2-std-id>`
|
|
|
|
- ``std``
|
|
|
|
- Every video input supports one or more different video standards.
|
|
|
|
This field is a set of all supported standards. For details on
|
|
|
|
video standards and how to switch see :ref:`standard`.
|
|
|
|
* - __u32
|
|
|
|
- ``status``
|
|
|
|
- This field provides status information about the input. See
|
|
|
|
:ref:`input-status` for flags. With the exception of the sensor
|
|
|
|
orientation bits ``status`` is only valid when this is the current
|
|
|
|
input.
|
|
|
|
* - __u32
|
|
|
|
- ``capabilities``
|
|
|
|
- This field provides capabilities for the input. See
|
|
|
|
:ref:`input-capabilities` for flags.
|
|
|
|
* - __u32
|
|
|
|
- ``reserved``\ [3]
|
|
|
|
- Reserved for future extensions. Drivers must set the array to
|
|
|
|
zero.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
[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 19:14:19 +08:00
|
|
|
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
|
|
|
|
|
2016-08-19 22:14:23 +08:00
|
|
|
.. _input-type:
|
|
|
|
|
2016-06-30 21:18:56 +08:00
|
|
|
.. flat-table:: Input Types
|
|
|
|
: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 19:44:34 +08:00
|
|
|
* - ``V4L2_INPUT_TYPE_TUNER``
|
|
|
|
- 1
|
|
|
|
- This input uses a tuner (RF demodulator).
|
|
|
|
* - ``V4L2_INPUT_TYPE_CAMERA``
|
|
|
|
- 2
|
2017-03-31 16:58:39 +08:00
|
|
|
- Any non-tuner video input, for example Composite Video,
|
|
|
|
S-Video, HDMI, camera sensor. The naming as ``_TYPE_CAMERA`` is historical,
|
|
|
|
today we would have called it ``_TYPE_VIDEO``.
|
[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 19:44:34 +08:00
|
|
|
* - ``V4L2_INPUT_TYPE_TOUCH``
|
|
|
|
- 3
|
|
|
|
- This input is a touch device for capturing raw touch data.
|
2016-08-15 03:57:29 +08:00
|
|
|
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
2016-08-19 01:31:47 +08:00
|
|
|
.. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
|
|
|
|
|
2016-08-19 22:14:23 +08:00
|
|
|
.. _input-status:
|
|
|
|
|
2016-06-30 21:18:56 +08:00
|
|
|
.. flat-table:: Input Status Flags
|
|
|
|
:header-rows: 0
|
|
|
|
:stub-columns: 0
|
|
|
|
|
[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 19:44:34 +08:00
|
|
|
* - :cspan:`2` General
|
|
|
|
* - ``V4L2_IN_ST_NO_POWER``
|
|
|
|
- 0x00000001
|
|
|
|
- Attached device is off.
|
|
|
|
* - ``V4L2_IN_ST_NO_SIGNAL``
|
|
|
|
- 0x00000002
|
|
|
|
-
|
|
|
|
* - ``V4L2_IN_ST_NO_COLOR``
|
|
|
|
- 0x00000004
|
|
|
|
- The hardware supports color decoding, but does not detect color
|
|
|
|
modulation in the signal.
|
|
|
|
* - :cspan:`2` Sensor Orientation
|
|
|
|
* - ``V4L2_IN_ST_HFLIP``
|
|
|
|
- 0x00000010
|
|
|
|
- The input is connected to a device that produces a signal that is
|
|
|
|
flipped horizontally and does not correct this before passing the
|
|
|
|
signal to userspace.
|
|
|
|
* - ``V4L2_IN_ST_VFLIP``
|
|
|
|
- 0x00000020
|
|
|
|
- The input is connected to a device that produces a signal that is
|
|
|
|
flipped vertically and does not correct this before passing the
|
|
|
|
signal to userspace.
|
|
|
|
.. note:: A 180 degree rotation is the same as HFLIP | VFLIP
|
|
|
|
* - :cspan:`2` Analog Video
|
|
|
|
* - ``V4L2_IN_ST_NO_H_LOCK``
|
|
|
|
- 0x00000100
|
|
|
|
- No horizontal sync lock.
|
|
|
|
* - ``V4L2_IN_ST_COLOR_KILL``
|
|
|
|
- 0x00000200
|
|
|
|
- A color killer circuit automatically disables color decoding when
|
|
|
|
it detects no color modulation. When this flag is set the color
|
|
|
|
killer is enabled *and* has shut off color decoding.
|
|
|
|
* - ``V4L2_IN_ST_NO_V_LOCK``
|
|
|
|
- 0x00000400
|
|
|
|
- No vertical sync lock.
|
|
|
|
* - ``V4L2_IN_ST_NO_STD_LOCK``
|
|
|
|
- 0x00000800
|
|
|
|
- No standard format lock in case of auto-detection format
|
|
|
|
by the component.
|
|
|
|
* - :cspan:`2` Digital Video
|
|
|
|
* - ``V4L2_IN_ST_NO_SYNC``
|
|
|
|
- 0x00010000
|
|
|
|
- No synchronization lock.
|
|
|
|
* - ``V4L2_IN_ST_NO_EQU``
|
|
|
|
- 0x00020000
|
|
|
|
- No equalizer lock.
|
|
|
|
* - ``V4L2_IN_ST_NO_CARRIER``
|
|
|
|
- 0x00040000
|
|
|
|
- Carrier recovery failed.
|
|
|
|
* - :cspan:`2` VCR and Set-Top Box
|
|
|
|
* - ``V4L2_IN_ST_MACROVISION``
|
|
|
|
- 0x01000000
|
|
|
|
- Macrovision is an analog copy prevention system mangling the video
|
|
|
|
signal to confuse video recorders. When this flag is set
|
|
|
|
Macrovision has been detected.
|
|
|
|
* - ``V4L2_IN_ST_NO_ACCESS``
|
|
|
|
- 0x02000000
|
|
|
|
- Conditional access denied.
|
|
|
|
* - ``V4L2_IN_ST_VTR``
|
|
|
|
- 0x04000000
|
|
|
|
- VTR time constant. [?]
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
[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 19:14:19 +08:00
|
|
|
.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
|
|
|
|
|
2016-08-19 22:14:23 +08:00
|
|
|
.. _input-capabilities:
|
|
|
|
|
2016-06-30 21:18:56 +08:00
|
|
|
.. flat-table:: Input capabilities
|
|
|
|
: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 19:44:34 +08:00
|
|
|
* - ``V4L2_IN_CAP_DV_TIMINGS``
|
|
|
|
- 0x00000002
|
|
|
|
- This input supports setting video timings by using
|
2017-03-31 16:58:39 +08:00
|
|
|
``VIDIOC_S_DV_TIMINGS``.
|
[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 19:44:34 +08:00
|
|
|
* - ``V4L2_IN_CAP_STD``
|
|
|
|
- 0x00000004
|
|
|
|
- This input supports setting the TV standard by using
|
2017-03-31 16:58:39 +08:00
|
|
|
``VIDIOC_S_STD``.
|
[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 19:44:34 +08:00
|
|
|
* - ``V4L2_IN_CAP_NATIVE_SIZE``
|
|
|
|
- 0x00000008
|
|
|
|
- This input supports setting the native size using the
|
|
|
|
``V4L2_SEL_TGT_NATIVE_SIZE`` selection target, see
|
|
|
|
:ref:`v4l2-selections-common`.
|
2016-06-30 21:18:56 +08:00
|
|
|
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Return Value
|
2016-06-30 21:18:56 +08: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-30 04:37:59 +08:00
|
|
|
The struct :c:type:`v4l2_input` ``index`` is out of
|
2016-06-30 21:18:56 +08:00
|
|
|
bounds.
|