|
|
|
.. -*- coding: utf-8; mode: rst -*-
|
|
|
|
|
|
|
|
.. _VIDIOC_G_SLICED_VBI_CAP:
|
|
|
|
|
|
|
|
*****************************
|
|
|
|
ioctl VIDIOC_G_SLICED_VBI_CAP
|
|
|
|
*****************************
|
|
|
|
|
|
|
|
Name
|
|
|
|
====
|
|
|
|
|
|
|
|
VIDIOC_G_SLICED_VBI_CAP - Query sliced VBI capabilities
|
|
|
|
|
|
|
|
|
|
|
|
Synopsis
|
|
|
|
========
|
|
|
|
|
|
|
|
.. c:function:: int ioctl( int fd, VIDIOC_G_SLICED_VBI_CAP, struct v4l2_sliced_vbi_cap *argp )
|
|
|
|
:name: VIDIOC_G_SLICED_VBI_CAP
|
|
|
|
|
|
|
|
|
|
|
|
Arguments
|
|
|
|
=========
|
|
|
|
|
|
|
|
``fd``
|
|
|
|
File descriptor returned by :ref:`open() <func-open>`.
|
|
|
|
|
|
|
|
``argp``
|
|
|
|
Pointer to struct :c:type:`v4l2_sliced_vbi_cap`.
|
|
|
|
|
|
|
|
|
|
|
|
Description
|
|
|
|
===========
|
|
|
|
|
|
|
|
To find out which data services are supported by a sliced VBI capture or
|
|
|
|
output device, applications initialize the ``type`` field of a struct
|
|
|
|
:c:type:`v4l2_sliced_vbi_cap`, clear the
|
|
|
|
``reserved`` array and call the :ref:`VIDIOC_G_SLICED_VBI_CAP <VIDIOC_G_SLICED_VBI_CAP>` ioctl. The
|
|
|
|
driver fills in the remaining fields or returns an ``EINVAL`` error code if
|
|
|
|
the sliced VBI API is unsupported or ``type`` is invalid.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
The ``type`` field was added, and the ioctl changed from read-only
|
|
|
|
to write-read, in Linux 2.6.19.
|
|
|
|
|
|
|
|
|
|
|
|
.. c:type:: v4l2_sliced_vbi_cap
|
|
|
|
|
|
|
|
.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|
|
[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>
9 years ago
|
|
|
|
|
|
|
.. flat-table:: struct v4l2_sliced_vbi_cap
|
|
|
|
:header-rows: 0
|
|
|
|
:stub-columns: 0
|
|
|
|
:widths: 3 3 2 2 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>
8 years ago
|
|
|
* - __u16
|
|
|
|
- ``service_set``
|
|
|
|
- :cspan:`2` A set of all data services supported by the driver.
|
|
|
|
|
|
|
|
Equal to the union of all elements of the ``service_lines`` array.
|
|
|
|
* - __u16
|
|
|
|
- ``service_lines``\ [2][24]
|
|
|
|
- :cspan:`2` Each element of this array contains a set of data
|
|
|
|
services the hardware can look for or insert into a particular
|
|
|
|
scan line. Data services are defined in :ref:`vbi-services`.
|
|
|
|
Array indices map to ITU-R line numbers\ [#f1]_ as follows:
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- Element
|
|
|
|
- 525 line systems
|
|
|
|
- 625 line systems
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- ``service_lines``\ [0][1]
|
|
|
|
- 1
|
|
|
|
- 1
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- ``service_lines``\ [0][23]
|
|
|
|
- 23
|
|
|
|
- 23
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- ``service_lines``\ [1][1]
|
|
|
|
- 264
|
|
|
|
- 314
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- ``service_lines``\ [1][23]
|
|
|
|
- 286
|
|
|
|
- 336
|
|
|
|
* -
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- :cspan:`2` The number of VBI lines the hardware can capture or
|
|
|
|
output per frame, or the number of services it can identify on a
|
|
|
|
given line may be limited. For example on PAL line 16 the hardware
|
|
|
|
may be able to look for a VPS or Teletext signal, but not both at
|
|
|
|
the same time. Applications can learn about these limits using the
|
|
|
|
:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl as described in
|
|
|
|
:ref:`sliced`.
|
|
|
|
* -
|
|
|
|
* -
|
|
|
|
-
|
|
|
|
- :cspan:`2` Drivers must set ``service_lines`` [0][0] and
|
|
|
|
``service_lines``\ [1][0] to zero.
|
|
|
|
* - __u32
|
|
|
|
- ``type``
|
|
|
|
- Type of the data stream, see :c:type:`v4l2_buf_type`. Should be
|
|
|
|
``V4L2_BUF_TYPE_SLICED_VBI_CAPTURE`` or
|
|
|
|
``V4L2_BUF_TYPE_SLICED_VBI_OUTPUT``.
|
|
|
|
* - __u32
|
|
|
|
- ``reserved``\ [3]
|
|
|
|
- :cspan:`2` This array is reserved for future extensions.
|
|
|
|
|
|
|
|
Applications and drivers must set it to zero.
|
|
|
|
|
|
|
|
.. [#f1]
|
|
|
|
|
|
|
|
See also :ref:`vbi-525` and :ref:`vbi-625`.
|
|
|
|
|
|
|
|
|
|
|
|
.. raw:: latex
|
|
|
|
|
media: fix pdf build with Spinx 1.6
Sphinx 1.6 generates some LaTeX code before each table,
starting its own environment before calling tabulary,
apparently to improve table layout.
The problem is that such environment is incompatible with
adjustbox. While, in thesis, it should be possible to override
it or to redefine tabulary, I was unable to produce such patch.
Also, that would likely break on some future Sphinx version.
So, instead, let's just change the font size on bigger tables,
in order for them to fit into the page size. That is not as
good as adjustbox, and require some manual work, but it should
be less sensitive to Sphinx changes.
While here, adjust a few other tables whose text is exceeding
the cell boundaries.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago
|
|
|
\scriptsize
|
|
|
|
|
media: fix pdf build with Spinx 1.6
Sphinx 1.6 generates some LaTeX code before each table,
starting its own environment before calling tabulary,
apparently to improve table layout.
The problem is that such environment is incompatible with
adjustbox. While, in thesis, it should be possible to override
it or to redefine tabulary, I was unable to produce such patch.
Also, that would likely break on some future Sphinx version.
So, instead, let's just change the font size on bigger tables,
in order for them to fit into the page size. That is not as
good as adjustbox, and require some manual work, but it should
be less sensitive to Sphinx changes.
While here, adjust a few other tables whose text is exceeding
the cell boundaries.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago
|
|
|
.. tabularcolumns:: |p{3.5cm}|p{1.0cm}|p{2.0cm}|p{2.0cm}|p{8.0cm}|
|
|
|
|
|
|
|
|
.. _vbi-services:
|
[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>
9 years ago
|
|
|
|
|
|
|
.. flat-table:: Sliced VBI services
|
|
|
|
:header-rows: 1
|
|
|
|
:stub-columns: 0
|
|
|
|
:widths: 2 1 1 2 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>
8 years ago
|
|
|
* - Symbol
|
|
|
|
- Value
|
|
|
|
- Reference
|
|
|
|
- Lines, usually
|
|
|
|
- Payload
|
|
|
|
* - ``V4L2_SLICED_TELETEXT_B`` (Teletext System B)
|
|
|
|
- 0x0001
|
|
|
|
- :ref:`ets300706`,
|
|
|
|
|
|
|
|
:ref:`itu653`
|
|
|
|
- PAL/SECAM line 7-22, 320-335 (second field 7-22)
|
|
|
|
- Last 42 of the 45 byte Teletext packet, that is without clock
|
|
|
|
run-in and framing code, lsb first transmitted.
|
|
|
|
* - ``V4L2_SLICED_VPS``
|
|
|
|
- 0x0400
|
|
|
|
- :ref:`ets300231`
|
|
|
|
- PAL line 16
|
|
|
|
- Byte number 3 to 15 according to Figure 9 of ETS 300 231, lsb
|
|
|
|
first transmitted.
|
|
|
|
* - ``V4L2_SLICED_CAPTION_525``
|
|
|
|
- 0x1000
|
|
|
|
- :ref:`cea608`
|
|
|
|
- NTSC line 21, 284 (second field 21)
|
|
|
|
- Two bytes in transmission order, including parity bit, lsb first
|
|
|
|
transmitted.
|
|
|
|
* - ``V4L2_SLICED_WSS_625``
|
|
|
|
- 0x4000
|
|
|
|
- :ref:`en300294`,
|
|
|
|
|
|
|
|
:ref:`itu1119`
|
|
|
|
- PAL/SECAM line 23
|
|
|
|
-
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
Byte 0 1
|
|
|
|
msb lsb msb lsb
|
|
|
|
Bit 7 6 5 4 3 2 1 0 x x 13 12 11 10 9
|
|
|
|
* - ``V4L2_SLICED_VBI_525``
|
|
|
|
- 0x1000
|
|
|
|
- :cspan:`2` Set of services applicable to 525 line systems.
|
|
|
|
* - ``V4L2_SLICED_VBI_625``
|
|
|
|
- 0x4401
|
|
|
|
- :cspan:`2` Set of services applicable to 625 line systems.
|
|
|
|
|
|
|
|
.. raw:: latex
|
|
|
|
|
media: fix pdf build with Spinx 1.6
Sphinx 1.6 generates some LaTeX code before each table,
starting its own environment before calling tabulary,
apparently to improve table layout.
The problem is that such environment is incompatible with
adjustbox. While, in thesis, it should be possible to override
it or to redefine tabulary, I was unable to produce such patch.
Also, that would likely break on some future Sphinx version.
So, instead, let's just change the font size on bigger tables,
in order for them to fit into the page size. That is not as
good as adjustbox, and require some manual work, but it should
be less sensitive to Sphinx changes.
While here, adjust a few other tables whose text is exceeding
the cell boundaries.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
7 years ago
|
|
|
\normalsize
|
|
|
|
|
|
|
|
|
|
|
|
Return Value
|
|
|
|
============
|
|
|
|
|
|
|
|
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
|
|
|
|
The value in the ``type`` field is wrong.
|