Commit 706f8a99 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] doc-rst: improve display of notes and warnings

There are several notes and warning mesages in the middle of
the media docbook. Use the ReST tags for that, as it makes
them visually better and hightlights them.

While here, modify a few ones to make them clearer.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent fed7b888
...@@ -32,8 +32,8 @@ Arguments ...@@ -32,8 +32,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
Closes the cec device. Resources associated with the file descriptor are Closes the cec device. Resources associated with the file descriptor are
freed. The device configuration remain unchanged. freed. The device configuration remain unchanged.
......
...@@ -38,8 +38,8 @@ Arguments ...@@ -38,8 +38,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
The :c:func:`ioctl()` function manipulates cec device parameters. The The :c:func:`ioctl()` function manipulates cec device parameters. The
argument ``fd`` must be an open file descriptor. argument ``fd`` must be an open file descriptor.
......
...@@ -45,8 +45,8 @@ Arguments ...@@ -45,8 +45,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
To open a cec device applications call :c:func:`open()` with the To open a cec device applications call :c:func:`open()` with the
desired device name. The function has no side effects; the device desired device name. The function has no side effects; the device
......
...@@ -29,8 +29,8 @@ Arguments ...@@ -29,8 +29,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
With the :c:func:`poll()` function applications can wait for CEC With the :c:func:`poll()` function applications can wait for CEC
events. events.
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
Introduction Introduction
============ ============
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
HDMI connectors provide a single pin for use by the Consumer Electronics HDMI connectors provide a single pin for use by the Consumer Electronics
Control protocol. This protocol allows different devices connected by an Control protocol. This protocol allows different devices connected by an
......
...@@ -31,8 +31,8 @@ Arguments ...@@ -31,8 +31,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
All cec devices must support the :ref:`CEC_ADAP_G_CAPS` ioctl. To query All cec devices must support the :ref:`CEC_ADAP_G_CAPS` ioctl. To query
device information, applications call the ioctl with a pointer to a device information, applications call the ioctl with a pointer to a
...@@ -63,7 +63,7 @@ returns the information to the application. The ioctl never fails. ...@@ -63,7 +63,7 @@ returns the information to the application. The ioctl never fails.
- ``name[32]`` - ``name[32]``
- The name of this CEC adapter. The combination ``driver`` and - The name of this CEC adapter. The combination ``driver`` and
``name`` must be unique. ``name`` must be unique.
- .. row 3 - .. row 3
...@@ -72,7 +72,7 @@ returns the information to the application. The ioctl never fails. ...@@ -72,7 +72,7 @@ returns the information to the application. The ioctl never fails.
- ``capabilities`` - ``capabilities``
- The capabilities of the CEC adapter, see - The capabilities of the CEC adapter, see
:ref:`cec-capabilities`. :ref:`cec-capabilities`.
- .. row 4 - .. row 4
...@@ -81,7 +81,7 @@ returns the information to the application. The ioctl never fails. ...@@ -81,7 +81,7 @@ returns the information to the application. The ioctl never fails.
- ``version`` - ``version``
- CEC Framework API version, formatted with the ``KERNEL_VERSION()`` - CEC Framework API version, formatted with the ``KERNEL_VERSION()``
macro. macro.
...@@ -100,10 +100,10 @@ returns the information to the application. The ioctl never fails. ...@@ -100,10 +100,10 @@ returns the information to the application. The ioctl never fails.
- 0x00000001 - 0x00000001
- Userspace has to configure the physical address by calling - Userspace has to configure the physical address by calling
:ref:`CEC_ADAP_S_PHYS_ADDR`. If :ref:`CEC_ADAP_S_PHYS_ADDR`. If
this capability isn't set, then setting the physical address is this capability isn't set, then setting the physical address is
handled by the kernel whenever the EDID is set (for an HDMI handled by the kernel whenever the EDID is set (for an HDMI
receiver) or read (for an HDMI transmitter). receiver) or read (for an HDMI transmitter).
- .. _`CEC-CAP-LOG-ADDRS`: - .. _`CEC-CAP-LOG-ADDRS`:
...@@ -112,9 +112,9 @@ returns the information to the application. The ioctl never fails. ...@@ -112,9 +112,9 @@ returns the information to the application. The ioctl never fails.
- 0x00000002 - 0x00000002
- Userspace has to configure the logical addresses by calling - Userspace has to configure the logical addresses by calling
:ref:`CEC_ADAP_S_LOG_ADDRS`. If :ref:`CEC_ADAP_S_LOG_ADDRS`. If
this capability isn't set, then the kernel will have configured this capability isn't set, then the kernel will have configured
this. this.
- .. _`CEC-CAP-TRANSMIT`: - .. _`CEC-CAP-TRANSMIT`:
...@@ -123,11 +123,11 @@ returns the information to the application. The ioctl never fails. ...@@ -123,11 +123,11 @@ returns the information to the application. The ioctl never fails.
- 0x00000004 - 0x00000004
- Userspace can transmit CEC messages by calling - Userspace can transmit CEC messages by calling
:ref:`CEC_TRANSMIT`. This implies that :ref:`CEC_TRANSMIT`. This implies that
userspace can be a follower as well, since being able to transmit userspace can be a follower as well, since being able to transmit
messages is a prerequisite of becoming a follower. If this messages is a prerequisite of becoming a follower. If this
capability isn't set, then the kernel will handle all CEC capability isn't set, then the kernel will handle all CEC
transmits and process all CEC messages it receives. transmits and process all CEC messages it receives.
- .. _`CEC-CAP-PASSTHROUGH`: - .. _`CEC-CAP-PASSTHROUGH`:
...@@ -136,7 +136,7 @@ returns the information to the application. The ioctl never fails. ...@@ -136,7 +136,7 @@ returns the information to the application. The ioctl never fails.
- 0x00000008 - 0x00000008
- Userspace can use the passthrough mode by calling - Userspace can use the passthrough mode by calling
:ref:`CEC_S_MODE`. :ref:`CEC_S_MODE`.
- .. _`CEC-CAP-RC`: - .. _`CEC-CAP-RC`:
...@@ -153,7 +153,7 @@ returns the information to the application. The ioctl never fails. ...@@ -153,7 +153,7 @@ returns the information to the application. The ioctl never fails.
- 0x00000020 - 0x00000020
- The CEC hardware can monitor all messages, not just directed and - The CEC hardware can monitor all messages, not just directed and
broadcast messages. broadcast messages.
......
...@@ -35,8 +35,8 @@ Arguments ...@@ -35,8 +35,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
To query the current CEC logical addresses, applications call the To query the current CEC logical addresses, applications call the
:ref:`CEC_ADAP_G_LOG_ADDRS` ioctl with a pointer to a :ref:`CEC_ADAP_G_LOG_ADDRS` ioctl with a pointer to a
...@@ -68,10 +68,10 @@ by a file handle in initiator mode (see ...@@ -68,10 +68,10 @@ by a file handle in initiator mode (see
- ``log_addr`` [CEC_MAX_LOG_ADDRS] - ``log_addr`` [CEC_MAX_LOG_ADDRS]
- The actual logical addresses that were claimed. This is set by the - The actual logical addresses that were claimed. This is set by the
driver. If no logical address could be claimed, then it is set to driver. If no logical address could be claimed, then it is set to
``CEC_LOG_ADDR_INVALID``. If this adapter is Unregistered, then ``CEC_LOG_ADDR_INVALID``. If this adapter is Unregistered, then
``log_addr[0]`` is set to 0xf and all others to ``log_addr[0]`` is set to 0xf and all others to
``CEC_LOG_ADDR_INVALID``. ``CEC_LOG_ADDR_INVALID``.
- .. row 2 - .. row 2
...@@ -80,9 +80,9 @@ by a file handle in initiator mode (see ...@@ -80,9 +80,9 @@ by a file handle in initiator mode (see
- ``log_addr_mask`` - ``log_addr_mask``
- The bitmask of all logical addresses this adapter has claimed. If - The bitmask of all logical addresses this adapter has claimed. If
this adapter is Unregistered then ``log_addr_mask`` sets bit 15 this adapter is Unregistered then ``log_addr_mask`` sets bit 15
and clears all other bits. If this adapter is not configured at and clears all other bits. If this adapter is not configured at
all, then ``log_addr_mask`` is set to 0. Set by the driver. all, then ``log_addr_mask`` is set to 0. Set by the driver.
- .. row 3 - .. row 3
...@@ -91,10 +91,10 @@ by a file handle in initiator mode (see ...@@ -91,10 +91,10 @@ by a file handle in initiator mode (see
- ``cec_version`` - ``cec_version``
- The CEC version that this adapter shall use. See - The CEC version that this adapter shall use. See
:ref:`cec-versions`. Used to implement the :ref:`cec-versions`. Used to implement the
``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages. ``CEC_MSG_CEC_VERSION`` and ``CEC_MSG_REPORT_FEATURES`` messages.
Note that :ref:`CEC_OP_CEC_VERSION_1_3A <CEC-OP-CEC-VERSION-1-3A>` is not allowed by the CEC Note that :ref:`CEC_OP_CEC_VERSION_1_3A <CEC-OP-CEC-VERSION-1-3A>` is not allowed by the CEC
framework. framework.
- .. row 4 - .. row 4
...@@ -103,17 +103,17 @@ by a file handle in initiator mode (see ...@@ -103,17 +103,17 @@ by a file handle in initiator mode (see
- ``num_log_addrs`` - ``num_log_addrs``
- Number of logical addresses to set up. Must be ≤ - Number of logical addresses to set up. Must be ≤
``available_log_addrs`` as returned by ``available_log_addrs`` as returned by
:ref:`CEC_ADAP_G_CAPS`. All arrays in :ref:`CEC_ADAP_G_CAPS`. All arrays in
this structure are only filled up to index this structure are only filled up to index
``available_log_addrs``-1. The remaining array elements will be ``available_log_addrs``-1. The remaining array elements will be
ignored. Note that the CEC 2.0 standard allows for a maximum of 2 ignored. Note that the CEC 2.0 standard allows for a maximum of 2
logical addresses, although some hardware has support for more. logical addresses, although some hardware has support for more.
``CEC_MAX_LOG_ADDRS`` is 4. The driver will return the actual ``CEC_MAX_LOG_ADDRS`` is 4. The driver will return the actual
number of logical addresses it could claim, which may be less than number of logical addresses it could claim, which may be less than
what was requested. If this field is set to 0, then the CEC what was requested. If this field is set to 0, then the CEC
adapter shall clear all claimed logical addresses and all other adapter shall clear all claimed logical addresses and all other
fields will be ignored. fields will be ignored.
- .. row 5 - .. row 5
...@@ -122,9 +122,9 @@ by a file handle in initiator mode (see ...@@ -122,9 +122,9 @@ by a file handle in initiator mode (see
- ``vendor_id`` - ``vendor_id``
- The vendor ID is a 24-bit number that identifies the specific - The vendor ID is a 24-bit number that identifies the specific
vendor or entity. Based on this ID vendor specific commands may be vendor or entity. Based on this ID vendor specific commands may be
defined. If you do not want a vendor ID then set it to defined. If you do not want a vendor ID then set it to
``CEC_VENDOR_ID_NONE``. ``CEC_VENDOR_ID_NONE``.
- .. row 6 - .. row 6
...@@ -141,7 +141,7 @@ by a file handle in initiator mode (see ...@@ -141,7 +141,7 @@ by a file handle in initiator mode (see
- ``osd_name``\ [15] - ``osd_name``\ [15]
- The On-Screen Display name as is returned by the - The On-Screen Display name as is returned by the
``CEC_MSG_SET_OSD_NAME`` message. ``CEC_MSG_SET_OSD_NAME`` message.
- .. row 8 - .. row 8
...@@ -150,7 +150,7 @@ by a file handle in initiator mode (see ...@@ -150,7 +150,7 @@ by a file handle in initiator mode (see
- ``primary_device_type`` [CEC_MAX_LOG_ADDRS] - ``primary_device_type`` [CEC_MAX_LOG_ADDRS]
- Primary device type for each logical address. See - Primary device type for each logical address. See
:ref:`cec-prim-dev-types` for possible types. :ref:`cec-prim-dev-types` for possible types.
- .. row 9 - .. row 9
...@@ -159,9 +159,9 @@ by a file handle in initiator mode (see ...@@ -159,9 +159,9 @@ by a file handle in initiator mode (see
- ``log_addr_type`` [CEC_MAX_LOG_ADDRS] - ``log_addr_type`` [CEC_MAX_LOG_ADDRS]
- Logical address types. See :ref:`cec-log-addr-types` for - Logical address types. See :ref:`cec-log-addr-types` for
possible types. The driver will update this with the actual possible types. The driver will update this with the actual
logical address type that it claimed (e.g. it may have to fallback logical address type that it claimed (e.g. it may have to fallback
to :ref:`CEC_LOG_ADDR_TYPE_UNREGISTERED <CEC-LOG-ADDR-TYPE-UNREGISTERED>`). to :ref:`CEC_LOG_ADDR_TYPE_UNREGISTERED <CEC-LOG-ADDR-TYPE-UNREGISTERED>`).
- .. row 10 - .. row 10
...@@ -170,9 +170,9 @@ by a file handle in initiator mode (see ...@@ -170,9 +170,9 @@ by a file handle in initiator mode (see
- ``all_device_types`` [CEC_MAX_LOG_ADDRS] - ``all_device_types`` [CEC_MAX_LOG_ADDRS]
- CEC 2.0 specific: all device types. See - CEC 2.0 specific: all device types. See
:ref:`cec-all-dev-types-flags`. Used to implement the :ref:`cec-all-dev-types-flags`. Used to implement the
``CEC_MSG_REPORT_FEATURES`` message. This field is ignored if ``CEC_MSG_REPORT_FEATURES`` message. This field is ignored if
``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`. ``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`.
- .. row 11 - .. row 11
...@@ -181,9 +181,9 @@ by a file handle in initiator mode (see ...@@ -181,9 +181,9 @@ by a file handle in initiator mode (see
- ``features`` [CEC_MAX_LOG_ADDRS][12] - ``features`` [CEC_MAX_LOG_ADDRS][12]
- Features for each logical address. Used to implement the - Features for each logical address. Used to implement the
``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the ``CEC_MSG_REPORT_FEATURES`` message. The 12 bytes include both the
RC Profile and the Device Features. This field is ignored if RC Profile and the Device Features. This field is ignored if
``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`. ``cec_version`` < :ref:`CEC_OP_CEC_VERSION_2_0 <CEC-OP-CEC-VERSION-2-0>`.
...@@ -350,8 +350,8 @@ by a file handle in initiator mode (see ...@@ -350,8 +350,8 @@ by a file handle in initiator mode (see
- 6 - 6
- Use this if you just want to remain unregistered. Used for pure - Use this if you just want to remain unregistered. Used for pure
CEC switches or CDC-only devices (CDC: Capability Discovery and CEC switches or CDC-only devices (CDC: Capability Discovery and
Control). Control).
......
...@@ -34,8 +34,8 @@ Arguments ...@@ -34,8 +34,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
To query the current physical address applications call the To query the current physical address applications call the
:ref:`CEC_ADAP_G_PHYS_ADDR` ioctl with a pointer to an __u16 where the :ref:`CEC_ADAP_G_PHYS_ADDR` ioctl with a pointer to an __u16 where the
......
...@@ -32,8 +32,8 @@ Arguments ...@@ -32,8 +32,8 @@ Arguments
Description Description
=========== ===========
Note: this documents the proposed CEC API. This API is not yet finalized .. note:: This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module. and is currently only available as a staging kernel module.
CEC devices can send asynchronous events. These can be retrieved by CEC devices can send asynchronous events. These can be retrieved by
calling the :ref:`CEC_DQEVENT` ioctl. If the file descriptor is in calling the :ref:`CEC_DQEVENT` ioctl. If the file descriptor is in
...@@ -91,14 +91,14 @@ state did change in between the two events. ...@@ -91,14 +91,14 @@ state did change in between the two events.
- ``lost_msgs`` - ``lost_msgs``
- Set to the number of lost messages since the filehandle was opened - Set to the number of lost messages since the filehandle was opened
or since the last time this event was dequeued for this or since the last time this event was dequeued for this
filehandle. The messages lost are the oldest messages. So when a filehandle. The messages lost are the oldest messages. So when a
new message arrives and there is no more room, then the oldest new message arrives and there is no more room, then the oldest
message is discarded to make room for the new one. The internal message is discarded to make room for the new one. The internal
size of the message queue guarantees that all messages received in size of the message queue guarantees that all messages received in
the last two seconds will be stored. Since messages should be the last two seconds will be stored. Since messages should be
replied to within a second according to the CEC specification, replied to within a second according to the CEC specification,
this is more than enough. this is more than enough.
...@@ -157,7 +157,7 @@ state did change in between the two events. ...@@ -157,7 +157,7 @@ state did change in between the two events.
- ``state_change`` - ``state_change``
- The new adapter state as sent by the :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>` - The new adapter state as sent by the :ref:`CEC_EVENT_STATE_CHANGE <CEC-EVENT-STATE-CHANGE>`
event. event.
- .. row 6 - .. row 6
...@@ -167,7 +167,7 @@ state did change in between the two events. ...@@ -167,7 +167,7 @@ state did change in between the two events.
- ``lost_msgs`` - ``lost_msgs``
- The number of lost messages as sent by the :ref:`CEC_EVENT_LOST_MSGS <CEC-EVENT-LOST-MSGS>` - The number of lost messages as sent by the :ref:`CEC_EVENT_LOST_MSGS <CEC-EVENT-LOST-MSGS>`
event. event.
...@@ -186,8 +186,8 @@ state did change in between the two events. ...@@ -186,8 +186,8 @@ state did change in between the two events.
- 1 - 1
- Generated when the CEC Adapter's state changes. When open() is - Generated when the CEC Adapter's state changes. When open() is
called an initial event will be generated for that filehandle with called an initial event will be generated for that filehandle with
the CEC Adapter's state at that time. the CEC Adapter's state at that time.
- .. _`CEC-EVENT-LOST-MSGS`: - .. _`CEC-EVENT-LOST-MSGS`:
...@@ -196,7 +196,7 @@ state did change in between the two events. ...@@ -196,7 +196,7 @@ state did change in between the two events.
- 2 - 2
- Generated if one or more CEC messages were lost because the - Generated if one or more CEC messages were lost because the
application didn't dequeue CEC messages fast enough. application didn't dequeue CEC messages fast enough.
...@@ -215,9 +215,9 @@ state did change in between the two events. ...@@ -215,9 +215,9 @@ state did change in between the two events.
- 1 - 1
- Set for the initial events that are generated when the device is - Set for the initial events that are generated when the device is
opened. See the table above for which events do this. This allows opened. See the table above for which events do this. This allows
applications to learn the initial state of the CEC adapter at applications to learn the initial state of the CEC adapter at
open() time. open() time.
......
...@@ -15,8 +15,9 @@ The information about the frontend tuner locking status can be queried ...@@ -15,8 +15,9 @@ The information about the frontend tuner locking status can be queried
using :ref:`FE_READ_STATUS`. using :ref:`FE_READ_STATUS`.
Signal statistics are provided via Signal statistics are provided via
:ref:`FE_GET_PROPERTY`. Please note that several :ref:`FE_GET_PROPERTY`.
statistics require the demodulator to be fully locked (e. g. with
FE_HAS_LOCK bit set). See .. note:: Most statistics require the demodulator to be fully locked
:ref:`Frontend statistics indicators <frontend-stat-properties>` for (e. g. with FE_HAS_LOCK bit set). See
more details. :ref:`Frontend statistics indicators <frontend-stat-properties>` for
more details.
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
Digital TV API Digital TV API
############## ##############
**NOTE:** This API is also known as **DVB API**, although it is generic .. note:: This API is also known as **DVB API**, although it is generic
enough to support all digital TV standards. enough to support all digital TV standards.
**Version 5.10** **Version 5.10**
......
...@@ -20,13 +20,13 @@ Also, the union didn't have any space left to be expanded without ...@@ -20,13 +20,13 @@ Also, the union didn't have any space left to be expanded without
breaking userspace. So, the decision was to deprecate the legacy breaking userspace. So, the decision was to deprecate the legacy
union/struct based approach, in favor of a properties set approach. union/struct based approach, in favor of a properties set approach.
NOTE: on Linux DVB API version 3, setting a frontend were done via .. note:: On Linux DVB API version 3, setting a frontend were done via
:ref:`struct dvb_frontend_parameters <dvb-frontend-parameters>`. :ref:`struct dvb_frontend_parameters <dvb-frontend-parameters>`.
This got replaced on version 5 (also called "S2API", as this API were This got replaced on version 5 (also called "S2API", as this API were
added originally_enabled to provide support for DVB-S2), because the added originally_enabled to provide support for DVB-S2), because the
old API has a very limited support to new standards and new hardware. old API has a very limited support to new standards and new hardware.
This section describes the new and recommended way to set the frontend, This section describes the new and recommended way to set the frontend,
with suppports all digital TV delivery systems. with suppports all digital TV delivery systems.
Example: with the properties based approach, in order to set the tuner Example: with the properties based approach, in order to set the tuner
to a DVB-C channel at 651 kHz, modulated with 256-QAM, FEC 3/4 and to a DVB-C channel at 651 kHz, modulated with 256-QAM, FEC 3/4 and
...@@ -93,12 +93,12 @@ Example: Setting digital TV frontend properties ...@@ -93,12 +93,12 @@ Example: Setting digital TV frontend properties
return 0; return 0;
} }
NOTE: While it is possible to directly call the Kernel code like the .. attention:: While it is possible to directly call the Kernel code like the
above example, it is strongly recommended to use above example, it is strongly recommended to use
`libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__, as it
provides abstraction to work with the supported digital TV standards and provides abstraction to work with the supported digital TV standards and
provides methods for usual operations like program scanning and to provides methods for usual operations like program scanning and to
read/write channel descriptor files. read/write channel descriptor files.
.. toctree:: .. toctree::
......
...@@ -9,10 +9,10 @@ Examples ...@@ -9,10 +9,10 @@ Examples
In this section we would like to present some examples for using the DVB In this section we would like to present some examples for using the DVB
API. API.
NOTE: This section is out of date, and the code below won't even ..note:: This section is out of date, and the code below won't even
compile. Please refer to the compile. Please refer to the
`libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__ for `libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__ for
updated/recommended examples. updated/recommended examples.
.. _tuning: .. _tuning:
......
...@@ -36,8 +36,9 @@ Arguments ...@@ -36,8 +36,9 @@ Arguments
Description Description
=========== ===========
WARNING: This is a very obscure legacy command, used only at stv0299 .. warning::
driver. Should not be used on newer drivers. This is a very obscure legacy command, used only at stv0299
driver. Should not be used on newer drivers.
It provides a non-standard method for selecting Diseqc voltage on the It provides a non-standard method for selecting Diseqc voltage on the
frontend, for Dish Network legacy switches. frontend, for Dish Network legacy switches.
......
...@@ -144,8 +144,8 @@ struct dvb_frontend_info ...@@ -144,8 +144,8 @@ struct dvb_frontend_info
- Capabilities supported by the frontend - Capabilities supported by the frontend
NOTE: The frequencies are specified in Hz for Terrestrial and Cable .. note:: The frequencies are specified in Hz for Terrestrial and Cable
systems. They're specified in kHz for Satellite systems systems. They're specified in kHz for Satellite systems
.. _fe-caps-t: .. _fe-caps-t:
......
...@@ -40,9 +40,9 @@ used to check about the locking status of the frontend after being ...@@ -40,9 +40,9 @@ used to check about the locking status of the frontend after being
tuned. The ioctl takes a pointer to an integer where the status will be tuned. The ioctl takes a pointer to an integer where the status will be
written. written.
NOTE: the size of status is actually sizeof(enum fe_status), with .. note:: The size of status is actually sizeof(enum fe_status), with
varies according with the architecture. This needs to be fixed in the varies according with the architecture. This needs to be fixed in the
future. future.
.. _fe-status-t: .. _fe-status-t:
......
...@@ -42,10 +42,10 @@ to send a 22kHz tone in order to select between high/low band on some ...@@ -42,10 +42,10 @@ to send a 22kHz tone in order to select between high/low band on some
dual-band LNBf. It is also used to send signals to DiSEqC equipment, but dual-band LNBf. It is also used to send signals to DiSEqC equipment, but
this is done using the DiSEqC ioctls. this is done using the DiSEqC ioctls.
NOTE: if more than one device is connected to the same antenna, setting .. attention:: If more than one device is connected to the same antenna,
a tone may interfere on other devices, as they may lose the capability setting a tone may interfere on other devices, as they may lose the
of selecting the band. So, it is recommended that applications would capability of selecting the band. So, it is recommended that applications
change to SEC_TONE_OFF when the device is not used. would change to SEC_TONE_OFF when the device is not used.
.. _fe-sec-tone-mode-t: .. _fe-sec-tone-mode-t:
......
...@@ -48,11 +48,11 @@ the ones that implement DISEqC and multipoint LNBf's don't need to ...@@ -48,11 +48,11 @@ the ones that implement DISEqC and multipoint LNBf's don't need to
control the voltage level, provided that either 13V or 18V is sent to control the voltage level, provided that either 13V or 18V is sent to
power up the LNBf. power up the LNBf.
NOTE: if more than one device is connected to the same antenna, setting .. attention:: if more than one device is connected to the same antenna,
a voltage level may interfere on other devices, as they may lose the setting a voltage level may interfere on other devices, as they may lose
capability of setting polarization or IF. So, on those cases, setting the capability of setting polarization or IF. So, on those cases, setting
the voltage to SEC_VOLTAGE_OFF while the device is not is used is the voltage to SEC_VOLTAGE_OFF while the device is not is used is
recommended. recommended.
Return Value Return Value
......
...@@ -29,8 +29,8 @@ The frontend can be accessed through ``/dev/dvb/adapter?/frontend?``. ...@@ -29,8 +29,8 @@ The frontend can be accessed through ``/dev/dvb/adapter?/frontend?``.
Data types and ioctl definitions can be accessed by including Data types and ioctl definitions can be accessed by including
``linux/dvb/frontend.h`` in your application. ``linux/dvb/frontend.h`` in your application.
NOTE: Transmission via the internet (DVB-IP) is not yet handled by this .. note:: Transmission via the internet (DVB-IP) is not yet handled by this
API but a future extension is possible. API but a future extension is possible.
On Satellite systems, the API support for the Satellite Equipment On Satellite systems, the API support for the Satellite Equipment
Control (SEC) allows to power control and to send/receive signals to Control (SEC) allows to power control and to send/receive signals to
......
...@@ -92,10 +92,12 @@ Generic Error Codes ...@@ -92,10 +92,12 @@ Generic Error Codes
- Permission denied. Can be returned if the device needs write - Permission denied. Can be returned if the device needs write
permission, or some special capabilities is needed (e. g. root) permission, or some special capabilities is needed (e. g. root)
.. note::
Note 1: ioctls may return other error codes. Since errors may have side #. This list is not exaustive; ioctls may return other error codes.
effects such as a driver reset, applications should abort on unexpected Since errors may have side effects such as a driver reset,
errors. applications should abort on unexpected errors, or otherwise
assume that the device is in a bad state.
Note 2: Request-specific error codes are listed in the individual #. Request-specific error codes are listed in the individual
requests descriptions. requests descriptions.
...@@ -251,11 +251,13 @@ I/O control requests ...@@ -251,11 +251,13 @@ I/O control requests
be useful of receivers that have otherwise narrow band receiver that be useful of receivers that have otherwise narrow band receiver that
prevents them to be used with some remotes. Wide band receiver might prevents them to be used with some remotes. Wide band receiver might
also be more precise On the other hand its disadvantage it usually also be more precise On the other hand its disadvantage it usually
reduced range of reception. Note: wide band receiver might be reduced range of reception.
implictly enabled if you enable carrier reports. In that case it
will be disabled as soon as you disable carrier reports. Trying to .. note:: Wide band receiver might be
disable wide band receiver while carrier reports are active will do implictly enabled if you enable carrier reports. In that case it
nothing. will be disabled as soon as you disable carrier reports. Trying to
disable wide band receiver while carrier reports are active will do
nothing.
.. _lirc_dev_errors: .. _lirc_dev_errors:
......
...@@ -35,11 +35,12 @@ The struct :ref:`v4l2_audio <v4l2-audio>` returned by the ...@@ -35,11 +35,12 @@ The struct :ref:`v4l2_audio <v4l2-audio>` returned by the
The :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` and The :ref:`VIDIOC_G_AUDIO <VIDIOC_G_AUDIO>` and
:ref:`VIDIOC_G_AUDOUT <VIDIOC_G_AUDOUT>` ioctls report the current :ref:`VIDIOC_G_AUDOUT <VIDIOC_G_AUDOUT>` ioctls report the current
audio input and output, respectively. Note that, unlike audio input and output, respectively.
:ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` these ioctls return a .. note:: Note that, unlike :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
structure as :ref:`VIDIOC_ENUMAUDIO` and :ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` these ioctls return a
:ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` do, not just an index. structure as :ref:`VIDIOC_ENUMAUDIO` and
:ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` do, not just an index.
To select an audio input and change its properties applications call the To select an audio input and change its properties applications call the
:ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` ioctl. To select an audio :ref:`VIDIOC_S_AUDIO <VIDIOC_G_AUDIO>` ioctl. To select an audio
......
...@@ -166,11 +166,11 @@ struct v4l2_buffer ...@@ -166,11 +166,11 @@ struct v4l2_buffer
output device because the application did not pass new data in output device because the application did not pass new data in
time. time.
Note this may count the frames received e.g. over USB, without .. note:: This may count the frames received e.g. over USB, without
taking into account the frames dropped by the remote hardware due taking into account the frames dropped by the remote hardware due
to limited compression throughput or bus bandwidth. These devices to limited compression throughput or bus bandwidth. These devices
identify by not enumerating any video standards, see identify by not enumerating any video standards, see
:ref:`standard`. :ref:`standard`.
- .. row 10 - .. row 10
...@@ -297,8 +297,10 @@ struct v4l2_plane ...@@ -297,8 +297,10 @@ struct v4l2_plane
stream, applications when it refers to an output stream. If the stream, applications when it refers to an output stream. If the
application sets this to 0 for an output stream, then application sets this to 0 for an output stream, then
``bytesused`` will be set to the size of the plane (see the ``bytesused`` will be set to the size of the plane (see the
``length`` field of this struct) by the driver. Note that the ``length`` field of this struct) by the driver.
actual image data starts at ``data_offset`` which may not be 0.
.. note:: Note that the actual image data starts at ``data_offset``
which may not be 0.
- .. row 2 - .. row 2
...@@ -367,10 +369,11 @@ struct v4l2_plane ...@@ -367,10 +369,11 @@ struct v4l2_plane
- -
- Offset in bytes to video data in the plane. Drivers must set this - Offset in bytes to video data in the plane. Drivers must set this
field when ``type`` refers to a capture stream, applications when field when ``type`` refers to a capture stream, applications when
it refers to an output stream. Note that data_offset is included it refers to an output stream.
in ``bytesused``. So the size of the image in the plane is
``bytesused``-``data_offset`` at offset ``data_offset`` from the .. note:: That data_offset is included in ``bytesused``. So the
start of the plane. size of the image in the plane is ``bytesused``-``data_offset``
at offset ``data_offset`` from the start of the plane.
- .. row 8 - .. row 8
......
...@@ -15,9 +15,9 @@ offset into a video signal. ...@@ -15,9 +15,9 @@ offset into a video signal.
Applications can use the following API to select an area in the video Applications can use the following API to select an area in the video
signal, query the default area and the hardware limits. signal, query the default area and the hardware limits.
**NOTE**: Despite their name, the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>`, .. note:: Despite their name, the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>`,
:ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP
<VIDIOC_G_CROP>` ioctls apply to input as well as output devices. <VIDIOC_G_CROP>` ioctls apply to input as well as output devices.
Scaling requires a source and a target. On a video capture or overlay Scaling requires a source and a target. On a video capture or overlay
device the source is the video signal, and the cropping ioctls determine device the source is the video signal, and the cropping ioctls determine
...@@ -38,9 +38,9 @@ support scaling or the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and ...@@ -38,9 +38,9 @@ support scaling or the :ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and
:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctls. Their size (and position :ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctls. Their size (and position
where applicable) will be fixed in this case. where applicable) will be fixed in this case.
**NOTE:** All capture and output devices must support the .. note:: All capture and output devices must support the
:ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl such that applications can :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl such that applications
determine if scaling takes place. can determine if scaling takes place.
Cropping Structures Cropping Structures
...@@ -144,8 +144,8 @@ reopening a device, such that piping data into or out of a device will ...@@ -144,8 +144,8 @@ reopening a device, such that piping data into or out of a device will
work without special preparations. More advanced applications should work without special preparations. More advanced applications should
ensure the parameters are suitable before starting I/O. ensure the parameters are suitable before starting I/O.
**NOTE:** on the next two examples, a video capture device is assumed; .. note:: On the next two examples, a video capture device is assumed;
change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device. change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
Example: Resetting the cropping parameters Example: Resetting the cropping parameters
========================================== ==========================================
...@@ -207,7 +207,7 @@ Example: Simple downscaling ...@@ -207,7 +207,7 @@ Example: Simple downscaling
Example: Selecting an output area Example: Selecting an output area
================================= =================================
**NOTE:** This example assumes an output device. .. note:: This example assumes an output device.
.. code-block:: c .. code-block:: c
...@@ -246,7 +246,7 @@ Example: Selecting an output area ...@@ -246,7 +246,7 @@ Example: Selecting an output area
Example: Current scaling factor and pixel aspect Example: Current scaling factor and pixel aspect
================================================ ================================================
**NOTE:** This example assumes a video capture device. .. note:: This example assumes a video capture device.
.. code-block:: c .. code-block:: c
......
...@@ -15,7 +15,9 @@ Conventionally V4L2 video capture devices are accessed through character ...@@ -15,7 +15,9 @@ Conventionally V4L2 video capture devices are accessed through character
device special files named ``/dev/video`` and ``/dev/video0`` to device special files named ``/dev/video`` and ``/dev/video0`` to
``/dev/video63`` with major number 81 and minor numbers 0 to 63. ``/dev/video63`` with major number 81 and minor numbers 0 to 63.
``/dev/video`` is typically a symbolic link to the preferred video ``/dev/video`` is typically a symbolic link to the preferred video
device. Note the same device files are used for video output devices. device.
.. note:: The same device file names are used for video output devices.
Querying Capabilities Querying Capabilities
......
...@@ -19,8 +19,10 @@ both sides and finally call :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` ...@@ -19,8 +19,10 @@ both sides and finally call :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>`
for both capture and output to start the codec. for both capture and output to start the codec.
Video compression codecs use the MPEG controls to setup their codec Video compression codecs use the MPEG controls to setup their codec
parameters (note that the MPEG controls actually support many more parameters
codecs than just MPEG). See :ref:`mpeg-controls`.
.. note:: The MPEG controls actually support many more codecs than
just MPEG. See :ref:`mpeg-controls`.
Memory-to-memory devices can often be used as a shared resource: you can Memory-to-memory devices can often be used as a shared resource: you can
open the video node multiple times, each application setting up their open the video node multiple times, each application setting up their
......
...@@ -6,11 +6,10 @@ ...@@ -6,11 +6,10 @@
Effect Devices Interface Effect Devices Interface
************************ ************************
**Note** .. note::
This interface has been be suspended from the V4L2 API.
This interface has been be suspended from the V4L2 API implemented The implementation for such effects should be done
in Linux 2.6 until we have more experience with effect device via mem2mem devices.
interfaces.
A V4L2 video effect device can do image effects, filtering, or combine A V4L2 video effect device can do image effects, filtering, or combine
two or more images or image streams. For example video transitions or two or more images or image streams. For example video transitions or
......
...@@ -14,10 +14,11 @@ this interface, which borrows structures and ioctls of the ...@@ -14,10 +14,11 @@ this interface, which borrows structures and ioctls of the
:ref:`Video Overlay <overlay>` interface. :ref:`Video Overlay <overlay>` interface.
The OSD function is accessible through the same character special file The OSD function is accessible through the same character special file
as the :ref:`Video Output <capture>` function. Note the default as the :ref:`Video Output <capture>` function.
function of such a ``/dev/video`` device is video capturing or output.
The OSD function is only available after calling the .. note:: The default function of such a ``/dev/video`` device is video
:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. capturing or output. The OSD function is only available after calling
the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
Querying Capabilities Querying Capabilities
......
...@@ -14,7 +14,9 @@ Conventionally V4L2 video output devices are accessed through character ...@@ -14,7 +14,9 @@ Conventionally V4L2 video output devices are accessed through character
device special files named ``/dev/video`` and ``/dev/video0`` to device special files named ``/dev/video`` and ``/dev/video0`` to
``/dev/video63`` with major number 81 and minor numbers 0 to 63. ``/dev/video63`` with major number 81 and minor numbers 0 to 63.
``/dev/video`` is typically a symbolic link to the preferred video ``/dev/video`` is typically a symbolic link to the preferred video
device. Note the same device files are used for video capture devices. device.
..note:: The same device file names are used also for video capture devices.
Querying Capabilities Querying Capabilities
......
...@@ -17,10 +17,11 @@ plants needed cooling towers this used to be the only way to put live ...@@ -17,10 +17,11 @@ plants needed cooling towers this used to be the only way to put live
video into a window. video into a window.
Video overlay devices are accessed through the same character special Video overlay devices are accessed through the same character special
files as :ref:`video capture <capture>` devices. Note the default files as :ref:`video capture <capture>` devices.
function of a ``/dev/video`` device is video capturing. The overlay
function is only available after calling the .. note:: The default function of a ``/dev/video`` device is video
:ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl. capturing. The overlay function is only available after calling
the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
The driver may support simultaneous overlay and capturing using the The driver may support simultaneous overlay and capturing using the
read/write and streaming I/O methods. If so, operation at the nominal read/write and streaming I/O methods. If so, operation at the nominal
...@@ -235,10 +236,10 @@ exceeded are undefined. [3]_ ...@@ -235,10 +236,10 @@ exceeded are undefined. [3]_
:ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`, :ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`,
:ref:`framebuffer-flags`). :ref:`framebuffer-flags`).
**Note**: this field was added in Linux 2.6.23, extending the structure. .. note:: This field was added in Linux 2.6.23, extending the
However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>` structure. However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>`
ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>` ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>`
parent structure with padding bytes at the end, are not affected. parent structure with padding bytes at the end, are not affected.
.. _v4l2-clip: .. _v4l2-clip:
......
...@@ -14,10 +14,10 @@ at devices capable of receiving and/or transmitting RDS information. ...@@ -14,10 +14,10 @@ at devices capable of receiving and/or transmitting RDS information.
For more information see the core RDS standard :ref:`iec62106` and the For more information see the core RDS standard :ref:`iec62106` and the
RBDS standard :ref:`nrsc4`. RBDS standard :ref:`nrsc4`.
Note that the RBDS standard as is used in the USA is almost identical to .. note:: Note that the RBDS standard as is used in the USA is almost
the RDS standard. Any RDS decoder/encoder can also handle RBDS. Only identical to the RDS standard. Any RDS decoder/encoder can also handle
some of the fields have slightly different meanings. See the RBDS RBDS. Only some of the fields have slightly different meanings. See the
standard for more information. RBDS standard for more information.
The RBDS standard also specifies support for MMBS (Modified Mobile The RBDS standard also specifies support for MMBS (Modified Mobile
Search). This is a proprietary format which seems to be discontinued. Search). This is a proprietary format which seems to be discontinued.
......
...@@ -72,14 +72,14 @@ reported on one (or several) V4L2 device nodes. ...@@ -72,14 +72,14 @@ reported on one (or several) V4L2 device nodes.
Pad-level Formats Pad-level Formats
================= =================
**Warning** .. warning::
Pad-level formats are only applicable to very complex device that Pad-level formats are only applicable to very complex devices that
need to expose low-level format configuration to user space. Generic need to expose low-level format configuration to user space. Generic
V4L2 applications do *not* need to use the API described in this V4L2 applications do *not* need to use the API described in this
section. section.
**Note** .. note::
For the purpose of this section, the term *format* means the For the purpose of this section, the term *format* means the
combination of media bus data format, frame width and frame height. combination of media bus data format, frame width and frame height.
......
...@@ -143,13 +143,16 @@ functions are always available. ...@@ -143,13 +143,16 @@ functions are always available.
To start and stop capturing or displaying applications call the To start and stop capturing or displaying applications call the
:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls. Note that :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctls.
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
both queues and unlocks all buffers as a side effect. Since there is no .. note::
notion of doing anything "now" on a multitasking system, if an
application needs to synchronize with another event it should examine :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or both queues and unlocks all buffers as a side effect. Since there is no
outputted buffers. notion of doing anything "now" on a multitasking system, if an
application needs to synchronize with another event it should examine
the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
outputted buffers.
Drivers implementing DMABUF importing I/O must support the Drivers implementing DMABUF importing I/O must support the
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`,
......
...@@ -84,17 +84,20 @@ themselves than is possible with ...@@ -84,17 +84,20 @@ themselves than is possible with
particular, this ioctl gives the dimensions of the N-dimensional array particular, this ioctl gives the dimensions of the N-dimensional array
if this control consists of more than one element. if this control consists of more than one element.
It is important to realize that due to the flexibility of controls it is .. note::
necessary to check whether the control you want to set actually is
supported in the driver and what the valid range of values is. So use #. It is important to realize that due to the flexibility of controls it is
the :ref:`VIDIOC_QUERYCTRL` (or necessary to check whether the control you want to set actually is
:ref:`VIDIOC_QUERY_EXT_CTRL <VIDIOC_QUERYCTRL>`) and supported in the driver and what the valid range of values is. So use
:ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>` ioctls to check this. Also the :ref:`VIDIOC_QUERYCTRL` (or :ref:`VIDIOC_QUERY_EXT_CTRL
note that it is possible that some of the menu indices in a control of <VIDIOC_QUERYCTRL>`) and :ref:`VIDIOC_QUERYMENU <VIDIOC_QUERYCTRL>`
type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU`` ioctls to check this.
will return an error). A good example is the list of supported MPEG
audio bitrates. Some drivers only support one or two bitrates, others #. It is possible that some of the menu indices in a control of
support a wider range. type ``V4L2_CTRL_TYPE_MENU`` may not be supported (``VIDIOC_QUERYMENU``
will return an error). A good example is the list of supported MPEG
audio bitrates. Some drivers only support one or two bitrates, others
support a wider range.
All controls use machine endianness. All controls use machine endianness.
...@@ -181,10 +184,10 @@ Codec Control Reference ...@@ -181,10 +184,10 @@ Codec Control Reference
Below all controls within the Codec control class are described. First Below all controls within the Codec control class are described. First
the generic controls, then controls specific for certain hardware. the generic controls, then controls specific for certain hardware.
Note: These controls are applicable to all codecs and not just MPEG. The .. note:: These controls are applicable to all codecs and not just MPEG. The
defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls
were originally made for MPEG codecs and later extended to cover all were originally made for MPEG codecs and later extended to cover all
encoding formats. encoding formats.
Generic Codec Controls Generic Codec Controls
...@@ -2282,13 +2285,15 @@ MFC 5.1 Control IDs ...@@ -2282,13 +2285,15 @@ MFC 5.1 Control IDs
``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)`` ``V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (integer)``
Reaction coefficient for MFC rate control. Applicable to encoders. Reaction coefficient for MFC rate control. Applicable to encoders.
Note 1: Valid only when the frame level RC is enabled. .. note::
Note 2: For tight CBR, this field must be small (ex. 2 ~ 10). For #. Valid only when the frame level RC is enabled.
VBR, this field must be large (ex. 100 ~ 1000).
Note 3: It is not recommended to use the greater number than #. For tight CBR, this field must be small (ex. 2 ~ 10). For
FRAME_RATE * (10^9 / BIT_RATE). VBR, this field must be large (ex. 100 ~ 1000).
#. It is not recommended to use the greater number than
FRAME_RATE * (10^9 / BIT_RATE).
``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)`` ``V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (boolean)``
Adaptive rate control for dark region. Valid only when H.264 and Adaptive rate control for dark region. Valid only when H.264 and
...@@ -4107,14 +4112,16 @@ transmitters for `VGA <http://en.wikipedia.org/wiki/Vga>`__, ...@@ -4107,14 +4112,16 @@ transmitters for `VGA <http://en.wikipedia.org/wiki/Vga>`__,
the receiver or transmitter subdevice that implements them, so they are the receiver or transmitter subdevice that implements them, so they are
only exposed on the ``/dev/v4l-subdev*`` device node. only exposed on the ``/dev/v4l-subdev*`` device node.
Note that these devices can have multiple input or output pads which are .. note::
hooked up to e.g. HDMI connectors. Even though the subdevice will
receive or transmit video from/to only one of those pads, the other pads Note that these devices can have multiple input or output pads which are
can still be active when it comes to EDID (Extended Display hooked up to e.g. HDMI connectors. Even though the subdevice will
Identification Data, :ref:`vesaedid`) and HDCP (High-bandwidth Digital receive or transmit video from/to only one of those pads, the other pads
Content Protection System, :ref:`hdcp`) processing, allowing the can still be active when it comes to EDID (Extended Display
device to do the fairly slow EDID/HDCP handling in advance. This allows Identification Data, :ref:`vesaedid`) and HDCP (High-bandwidth Digital
for quick switching between connectors. Content Protection System, :ref:`hdcp`) processing, allowing the
device to do the fairly slow EDID/HDCP handling in advance. This allows
for quick switching between connectors.
These pads appear in several of the controls in this section as These pads appear in several of the controls in this section as
bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad bitmasks, one bit for each pad. Bit 0 corresponds to pad 0, bit 1 to pad
......
...@@ -47,17 +47,20 @@ Arguments ...@@ -47,17 +47,20 @@ Arguments
Regardless of the device type and the direction of data exchange it Regardless of the device type and the direction of data exchange it
should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read should be set to ``PROT_READ`` | ``PROT_WRITE``, permitting read
and write access to image buffers. Drivers should support at least and write access to image buffers. Drivers should support at least
this combination of flags. Note the Linux ``video-buf`` kernel this combination of flags.
module, which is used by the bttv, saa7134, saa7146, cx88 and vivi
driver supports only ``PROT_READ`` | ``PROT_WRITE``. When the .. note::
driver does not support the desired protection the
:ref:`mmap() <func-mmap>` function fails. #. The Linux ``videobuf`` kernel module, which is used by some
drivers supports only ``PROT_READ`` | ``PROT_WRITE``. When the
Note device memory accesses (e. g. the memory on a graphics card driver does not support the desired protection, the
with video capturing hardware) may incur a performance penalty :ref:`mmap() <func-mmap>` function fails.
compared to main memory accesses, or reads may be significantly
slower than writes or vice versa. Other I/O methods may be more #. Device memory accesses (e. g. the memory on a graphics card
efficient in this case. with video capturing hardware) may incur a performance penalty
compared to main memory accesses, or reads may be significantly
slower than writes or vice versa. Other I/O methods may be more
efficient in such case.
``flags`` ``flags``
The ``flags`` parameter specifies the type of the mapped object, The ``flags`` parameter specifies the type of the mapped object,
...@@ -73,11 +76,13 @@ Arguments ...@@ -73,11 +76,13 @@ Arguments
One of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set. One of the ``MAP_SHARED`` or ``MAP_PRIVATE`` flags must be set.
``MAP_SHARED`` allows applications to share the mapped memory with ``MAP_SHARED`` allows applications to share the mapped memory with
other (e. g. child-) processes. Note the Linux ``video-buf`` module other (e. g. child-) processes.
which is used by the bttv, saa7134, saa7146, cx88 and vivi driver
supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests copy-on-write .. note:: The Linux ``videobuf`` module which is used by some
semantics. V4L2 applications should not set the ``MAP_PRIVATE``, drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests
``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON`` flag. copy-on-write semantics. V4L2 applications should not set the
``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON``
flags.
``fd`` ``fd``
File descriptor returned by :ref:`open() <func-open>`. File descriptor returned by :ref:`open() <func-open>`.
......
...@@ -245,12 +245,14 @@ available. The :ref:`select() <func-select>` or :ref:`poll() ...@@ -245,12 +245,14 @@ available. The :ref:`select() <func-select>` or :ref:`poll()
To start and stop capturing or output applications call the To start and stop capturing or output applications call the
:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMOFF :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMOFF
<VIDIOC_STREAMON>` ioctl. Note :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` <VIDIOC_STREAMON>` ioctl.
removes all buffers from both queues as a side effect. Since there is
no notion of doing anything "now" on a multitasking system, if an .. note:::ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>`
application needs to synchronize with another event it should examine removes all buffers from both queues as a side effect. Since there is
the struct ::ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured no notion of doing anything "now" on a multitasking system, if an
or outputted buffers. application needs to synchronize with another event it should examine
the struct ::ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured
or outputted buffers.
Drivers implementing memory mapping I/O must support the Drivers implementing memory mapping I/O must support the
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QUERYBUF :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QUERYBUF
......
...@@ -17,9 +17,11 @@ identifier (enum :ref:`v4l2_quantization <v4l2-quantization>`) to ...@@ -17,9 +17,11 @@ identifier (enum :ref:`v4l2_quantization <v4l2-quantization>`) to
specify non-standard quantization methods. Most of the time only the specify non-standard quantization methods. Most of the time only the
colorspace field of struct :ref:`v4l2_pix_format <v4l2-pix-format>` colorspace field of struct :ref:`v4l2_pix_format <v4l2-pix-format>`
or struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>` or struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>`
needs to be filled in. Note that the default R'G'B' quantization is full needs to be filled in.
range for all colorspaces except for BT.2020 which uses limited range
R'G'B' quantization. .. note:: The default R'G'B' quantization is full range for all
colorspaces except for BT.2020 which uses limited range R'G'B'
quantization.
.. _v4l2-colorspace: .. _v4l2-colorspace:
......
...@@ -536,11 +536,13 @@ Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3) ...@@ -536,11 +536,13 @@ Colorspace DCI-P3 (V4L2_COLORSPACE_DCI_P3)
The :ref:`smpte431` standard defines the colorspace used by cinema The :ref:`smpte431` standard defines the colorspace used by cinema
projectors that use the DCI-P3 colorspace. The default transfer function projectors that use the DCI-P3 colorspace. The default transfer function
is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
``V4L2_YCBCR_ENC_709``. Note that this colorspace does not specify a ``V4L2_YCBCR_ENC_709``.
Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
default Y'CbCr encoding was picked because it is the HDTV encoding. The .. note:: Note that this colorspace does not specify a
default Y'CbCr quantization is limited range. The chromaticities of the Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
primary colors and the white reference are: default Y'CbCr encoding was picked because it is the HDTV encoding. The
default Y'CbCr quantization is limited range. The chromaticities of the
primary colors and the white reference are:
...@@ -752,10 +754,10 @@ reference are: ...@@ -752,10 +754,10 @@ reference are:
- 0.316 - 0.316
Note that this colorspace uses Illuminant C instead of D65 as the white .. note:: This colorspace uses Illuminant C instead of D65 as the white
reference. To correctly convert an image in this colorspace to another reference. To correctly convert an image in this colorspace to another
that uses D65 you need to apply a chromatic adaptation algorithm such as that uses D65 you need to apply a chromatic adaptation algorithm such as
the Bradford method. the Bradford method.
The transfer function was never properly defined for NTSC 1953. The Rec. The transfer function was never properly defined for NTSC 1953. The Rec.
709 transfer function is recommended in the literature: 709 transfer function is recommended in the literature:
...@@ -886,9 +888,9 @@ reference are identical to sRGB. The transfer function use is ...@@ -886,9 +888,9 @@ reference are identical to sRGB. The transfer function use is
with full range quantization where Y' is scaled to [0…255] and Cb/Cr are with full range quantization where Y' is scaled to [0…255] and Cb/Cr are
scaled to [-128…128] and then clipped to [-128…127]. scaled to [-128…128] and then clipped to [-128…127].
Note that the JPEG standard does not actually store colorspace .. note:: The JPEG standard does not actually store colorspace
information. So if something other than sRGB is used, then the driver information. So if something other than sRGB is used, then the driver
will have to set that information explicitly. Effectively will have to set that information explicitly. Effectively
``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for ``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for
``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and ``V4L2_COLORSPACE_SRGB``, ``V4L2_YCBCR_ENC_601`` and
``V4L2_QUANTIZATION_FULL_RANGE``. ``V4L2_QUANTIZATION_FULL_RANGE``.
...@@ -17,9 +17,10 @@ Description ...@@ -17,9 +17,10 @@ Description
This format is similar to This format is similar to
:ref:`V4L2_PIX_FMT_SBGGR8 <V4L2-PIX-FMT-SBGGR8>`, except each pixel :ref:`V4L2_PIX_FMT_SBGGR8 <V4L2-PIX-FMT-SBGGR8>`, except each pixel
has a depth of 16 bits. The least significant byte is stored at lower has a depth of 16 bits. The least significant byte is stored at lower
memory addresses (little-endian). Note the actual sampling precision may memory addresses (little-endian).
be lower than 16 bits, for example 10 bits per pixel with values in
range 0 to 1023. ..note:: The actual sampling precision may be lower than 16 bits,
for example 10 bits per pixel with values in tange 0 to 1023.
**Byte Order.** **Byte Order.**
Each cell is one byte. Each cell is one byte.
......
...@@ -15,9 +15,10 @@ Description ...@@ -15,9 +15,10 @@ Description
=========== ===========
This is a grey-scale image with a depth of 16 bits per pixel. The most This is a grey-scale image with a depth of 16 bits per pixel. The most
significant byte is stored at lower memory addresses (big-endian). Note significant byte is stored at lower memory addresses (big-endian).
the actual sampling precision may be lower than 16 bits, for example 10
bits per pixel with values in range 0 to 1023. .. note:: Tthe actual sampling precision may be lower than 16 bits, for
example 10 bits per pixel with values in range 0 to 1023.
**Byte Order.** **Byte Order.**
Each cell is one byte. Each cell is one byte.
......
...@@ -16,8 +16,9 @@ Description ...@@ -16,8 +16,9 @@ Description
This is a grey-scale image with a depth of 16 bits per pixel. The least This is a grey-scale image with a depth of 16 bits per pixel. The least
significant byte is stored at lower memory addresses (little-endian). significant byte is stored at lower memory addresses (little-endian).
Note the actual sampling precision may be lower than 16 bits, for
example 10 bits per pixel with values in range 0 to 1023. .. note:: The actual sampling precision may be lower than 16 bits, for
example 10 bits per pixel with values in range 0 to 1023.
**Byte Order.** **Byte Order.**
Each cell is one byte. Each cell is one byte.
......
...@@ -39,11 +39,12 @@ To query and select the standard used by the current video input or ...@@ -39,11 +39,12 @@ To query and select the standard used by the current video input or
output applications call the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and output applications call the :ref:`VIDIOC_G_STD <VIDIOC_G_STD>` and
:ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctl, respectively. The :ref:`VIDIOC_S_STD <VIDIOC_G_STD>` ioctl, respectively. The
*received* standard can be sensed with the *received* standard can be sensed with the
:ref:`VIDIOC_QUERYSTD` ioctl. Note that the :ref:`VIDIOC_QUERYSTD` ioctl.
parameter of all these ioctls is a pointer to a
:ref:`v4l2_std_id <v4l2-std-id>` type (a standard set), *not* an ..note:: The parameter of all these ioctls is a pointer to a
index into the standard enumeration. Drivers must implement all video :ref:`v4l2_std_id <v4l2-std-id>` type (a standard set), *not* an
standard ioctls when the device has one or more video inputs or outputs. index into the standard enumeration. Drivers must implement all video
standard ioctls when the device has one or more video inputs or outputs.
Special rules apply to devices such as USB cameras where the notion of Special rules apply to devices such as USB cameras where the notion of
video standards makes little sense. More generally for any capture or video standards makes little sense. More generally for any capture or
......
...@@ -26,13 +26,14 @@ To query and change tuner properties applications use the ...@@ -26,13 +26,14 @@ To query and change tuner properties applications use the
:ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` ioctls, respectively. The
struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>` struct :ref:`v4l2_tuner <v4l2-tuner>` returned by :ref:`VIDIOC_G_TUNER <VIDIOC_G_TUNER>`
also contains signal status information applicable when the tuner of the also contains signal status information applicable when the tuner of the
current video or radio input is queried. Note that :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` current video or radio input is queried.
does not switch the current tuner, when there is more than one at all.
The tuner is solely determined by the current video input. Drivers must .. note:: :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
support both ioctls and set the ``V4L2_CAP_TUNER`` flag in the struct current tuner, when there is more than one at all. The tuner is solely
:ref:`v4l2_capability <v4l2-capability>` returned by the determined by the current video input. Drivers must support both ioctls
:ref:`VIDIOC_QUERYCAP` ioctl when the device has and set the ``V4L2_CAP_TUNER`` flag in the struct :ref:`v4l2_capability
one or more tuners. <v4l2-capability>` returned by the :ref:`VIDIOC_QUERYCAP` ioctl when the
device has one or more tuners.
Modulators Modulators
......
...@@ -86,13 +86,14 @@ available. ...@@ -86,13 +86,14 @@ available.
To start and stop capturing or output applications call the To start and stop capturing or output applications call the
:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and :ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctl. Note :ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctl.
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from both
queues and unlocks all buffers as a side effect. Since there is no .. note:: ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
notion of doing anything "now" on a multitasking system, if an both queues and unlocks all buffers as a side effect. Since there is no
application needs to synchronize with another event it should examine notion of doing anything "now" on a multitasking system, if an
the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or application needs to synchronize with another event it should examine
outputted buffers. the struct :ref:`v4l2_buffer <v4l2-buffer>` ``timestamp`` of captured or
outputted buffers.
Drivers implementing user pointer I/O must support the Drivers implementing user pointer I/O must support the
:ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`, :ref:`VIDIOC_REQBUFS <VIDIOC_REQBUFS>`, :ref:`VIDIOC_QBUF <VIDIOC_QBUF>`,
......
...@@ -33,7 +33,7 @@ Arguments ...@@ -33,7 +33,7 @@ Arguments
Description Description
=========== ===========
**Note** .. note::
This is an :ref:`experimental` interface and may This is an :ref:`experimental` interface and may
change in the future. change in the future.
......
...@@ -35,7 +35,7 @@ Arguments ...@@ -35,7 +35,7 @@ Arguments
Description Description
=========== ===========
**Note** .. note::
This is an :ref:`experimental` interface and may This is an :ref:`experimental` interface and may
change in the future. change in the future.
......
...@@ -37,8 +37,10 @@ To query the capabilities of the DV receiver/transmitter applications ...@@ -37,8 +37,10 @@ To query the capabilities of the DV receiver/transmitter applications
initialize the ``pad`` field to 0, zero the reserved array of struct initialize the ``pad`` field to 0, zero the reserved array of struct
:ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` and call the :ref:`v4l2_dv_timings_cap <v4l2-dv-timings-cap>` and call the
``VIDIOC_DV_TIMINGS_CAP`` ioctl on a video node and the driver will fill ``VIDIOC_DV_TIMINGS_CAP`` ioctl on a video node and the driver will fill
in the structure. Note that drivers may return different values after in the structure.
switching the video input or output.
.. note:: Drivers may return different values after
switching the video input or output.
When implemented by the driver DV capabilities of subdevices can be When implemented by the driver DV capabilities of subdevices can be
queried by calling the ``VIDIOC_SUBDEV_DV_TIMINGS_CAP`` ioctl directly queried by calling the ``VIDIOC_SUBDEV_DV_TIMINGS_CAP`` ioctl directly
......
...@@ -47,8 +47,10 @@ field, set the ``pad`` field to 0, zero the reserved array of struct ...@@ -47,8 +47,10 @@ field, set the ``pad`` field to 0, zero the reserved array of struct
structure. Drivers fill the rest of the structure or return an ``EINVAL`` structure. Drivers fill the rest of the structure or return an ``EINVAL``
error code when the index is out of bounds. To enumerate all supported error code when the index is out of bounds. To enumerate all supported
DV timings, applications shall begin at index zero, incrementing by one DV timings, applications shall begin at index zero, incrementing by one
until the driver returns ``EINVAL``. Note that drivers may enumerate a until the driver returns ``EINVAL``.
different set of DV timings after switching the video input or output.
.. note:: Drivers may enumerate a different set of DV timings after
switching the video input or output.
When implemented by the driver DV timings of subdevices can be queried When implemented by the driver DV timings of subdevices can be queried
by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a by calling the ``VIDIOC_SUBDEV_ENUM_DV_TIMINGS`` ioctl directly on a
......
...@@ -40,8 +40,8 @@ fill the rest of the structure or return an ``EINVAL`` error code. All ...@@ -40,8 +40,8 @@ fill the rest of the structure or return an ``EINVAL`` error code. All
formats are enumerable by beginning at index zero and incrementing by formats are enumerable by beginning at index zero and incrementing by
one until ``EINVAL`` is returned. one until ``EINVAL`` is returned.
Note that after switching input or output the list of enumerated image .. note:: After switching input or output the list of enumerated image
formats may be different. formats may be different.
.. _v4l2-fmtdesc: .. _v4l2-fmtdesc:
...@@ -111,8 +111,10 @@ formats may be different. ...@@ -111,8 +111,10 @@ formats may be different.
#define v4l2_fourcc(a,b,c,d) (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24)) #define v4l2_fourcc(a,b,c,d) (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
Several image formats are already defined by this specification in Several image formats are already defined by this specification in
:ref:`pixfmt`. Note these codes are not the same as those used :ref:`pixfmt`.
in the Windows world.
.. attention:: These codes are not the same as those used
in the Windows world.
- .. row 7 - .. row 7
......
...@@ -73,25 +73,21 @@ the device supports. Only for the ``V4L2_FRMIVAL_TYPE_DISCRETE`` type ...@@ -73,25 +73,21 @@ the device supports. Only for the ``V4L2_FRMIVAL_TYPE_DISCRETE`` type
does it make sense to increase the index value to receive more frame does it make sense to increase the index value to receive more frame
intervals. intervals.
Note that the order in which the frame intervals are returned has no .. note:: The order in which the frame intervals are returned has no
special meaning. In particular does it not say anything about potential special meaning. In particular does it not say anything about potential
default frame intervals. default frame intervals.
Applications can assume that the enumeration data does not change Applications can assume that the enumeration data does not change
without any interaction from the application itself. This means that the without any interaction from the application itself. This means that the
enumeration data is consistent if the application does not perform any enumeration data is consistent if the application does not perform any
other ioctl calls while it runs the frame interval enumeration. other ioctl calls while it runs the frame interval enumeration.
.. note::
Notes **Frame intervals and frame rates:** The V4L2 API uses frame
=====
- **Frame intervals and frame rates:** The V4L2 API uses frame
intervals instead of frame rates. Given the frame interval the frame intervals instead of frame rates. Given the frame interval the frame
rate can be computed as follows: rate can be computed as follows:
:: ::
frame_rate = 1 / frame_interval frame_rate = 1 / frame_interval
......
...@@ -72,9 +72,9 @@ the ``type`` field to determine the type of frame size enumeration the ...@@ -72,9 +72,9 @@ the ``type`` field to determine the type of frame size enumeration the
device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does
it make sense to increase the index value to receive more frame sizes. it make sense to increase the index value to receive more frame sizes.
Note that the order in which the frame sizes are returned has no special .. note:: The order in which the frame sizes are returned has no special
meaning. In particular does it not say anything about potential default meaning. In particular does it not say anything about potential default
format sizes. format sizes.
Applications can assume that the enumeration data does not change Applications can assume that the enumeration data does not change
without any interaction from the application itself. This means that the without any interaction from the application itself. This means that the
......
...@@ -127,12 +127,14 @@ of the corresponding tuner/modulator is set. ...@@ -127,12 +127,14 @@ of the corresponding tuner/modulator is set.
- ``modulation`` - ``modulation``
- :cspan:`2` The supported modulation systems of this frequency - :cspan:`2` The supported modulation systems of this frequency
band. See :ref:`band-modulation`. Note that currently only one band. See :ref:`band-modulation`.
modulation system per frequency band is supported. More work will
need to be done if multiple modulation systems are possible. .. note:: Currently only one modulation system per frequency band
Contact the linux-media mailing list is supported. More work will need to be done if multiple
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__) modulation systems are possible. Contact the linux-media
if you need that functionality. mailing list
(`https://linuxtv.org/lists.php <https://linuxtv.org/lists.php>`__)
if you need such functionality.
- .. row 8 - .. row 8
......
...@@ -41,8 +41,8 @@ structure or return an ``EINVAL`` error code when the index is out of ...@@ -41,8 +41,8 @@ structure or return an ``EINVAL`` error code when the index is out of
bounds. To enumerate all audio outputs applications shall begin at index bounds. To enumerate all audio outputs applications shall begin at index
zero, incrementing by one until the driver returns ``EINVAL``. zero, incrementing by one until the driver returns ``EINVAL``.
Note connectors on a TV card to loop back the received audio signal to a .. note:: Connectors on a TV card to loop back the received audio signal
sound card are not audio outputs in this sense. to a sound card are not audio outputs in this sense.
See :ref:`VIDIOC_G_AUDIOout <VIDIOC_G_AUDOUT>` for a description of struct See :ref:`VIDIOC_G_AUDIOout <VIDIOC_G_AUDOUT>` for a description of struct
:ref:`v4l2_audioout <v4l2-audioout>`. :ref:`v4l2_audioout <v4l2-audioout>`.
......
...@@ -233,8 +233,8 @@ at index zero, incrementing by one until the driver returns ``EINVAL``. ...@@ -233,8 +233,8 @@ at index zero, incrementing by one until the driver returns ``EINVAL``.
- The input is connected to a device that produces a signal that is - The input is connected to a device that produces a signal that is
flipped vertically and does not correct this before passing the flipped vertically and does not correct this before passing the
signal to userspace. Note that a 180 degree rotation is the same signal to userspace.
as HFLIP | VFLIP .. note:: A 180 degree rotation is the same as HFLIP | VFLIP
- .. row 8 - .. row 8
......
...@@ -51,8 +51,8 @@ return the ``EINVAL`` error code when the index is out of bounds. This is a ...@@ -51,8 +51,8 @@ return the ``EINVAL`` error code when the index is out of bounds. This is a
write-only ioctl, it does not return the current audio output attributes write-only ioctl, it does not return the current audio output attributes
as ``VIDIOC_G_AUDOUT`` does. as ``VIDIOC_G_AUDOUT`` does.
Note connectors on a TV card to loop back the received audio signal to a .. note:: Connectors on a TV card to loop back the received audio signal
sound card are not audio outputs in this sense. to a sound card are not audio outputs in this sense.
.. _v4l2-audioout: .. _v4l2-audioout:
......
...@@ -65,8 +65,10 @@ If ``start_block`` and ``blocks`` are both set to 0 when ...@@ -65,8 +65,10 @@ If ``start_block`` and ``blocks`` are both set to 0 when
:ref:`VIDIOC_G_EDID <VIDIOC_G_EDID>` is called, then the driver will set ``blocks`` to the :ref:`VIDIOC_G_EDID <VIDIOC_G_EDID>` is called, then the driver will set ``blocks`` to the
total number of available EDID blocks and it will return 0 without total number of available EDID blocks and it will return 0 without
copying any data. This is an easy way to discover how many EDID blocks copying any data. This is an easy way to discover how many EDID blocks
there are. Note that if there are no EDID blocks available at all, then there are.
the driver will set ``blocks`` to 0 and it returns 0.
.. note:: If there are no EDID blocks available at all, then
the driver will set ``blocks`` to 0 and it returns 0.
To set the EDID blocks of a receiver the application has to fill in the To set the EDID blocks of a receiver the application has to fill in the
``pad``, ``blocks`` and ``edid`` fields, set ``start_block`` to 0 and ``pad``, ``blocks`` and ``edid`` fields, set ``start_block`` to 0 and
......
...@@ -125,10 +125,12 @@ still cause this situation. ...@@ -125,10 +125,12 @@ still cause this situation.
the payload. If :ref:`VIDIOC_G_EXT_CTRLS <VIDIOC_G_EXT_CTRLS>` finds that this value is 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 less than is required to store the payload result, then it is set
to a value large enough to store the payload result and ``ENOSPC`` is to a value large enough to store the payload result and ``ENOSPC`` is
returned. Note that for string controls this ``size`` field should returned.
not be confused with the length of the string. This field refers
to the size of the memory that contains the string. The actual .. note:: For string controls, this ``size`` field should
*length* of the string may well be much smaller. 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.
- .. row 3 - .. row 3
...@@ -261,8 +263,10 @@ still cause this situation. ...@@ -261,8 +263,10 @@ still cause this situation.
- Which value of the control to get/set/try. - Which value of the control to get/set/try.
``V4L2_CTRL_WHICH_CUR_VAL`` will return the current value of the ``V4L2_CTRL_WHICH_CUR_VAL`` will return the current value of the
control and ``V4L2_CTRL_WHICH_DEF_VAL`` will return the default control and ``V4L2_CTRL_WHICH_DEF_VAL`` will return the default
value of the control. Please note that you can only get the value of the control.
default value of the control, you cannot set or try it.
.. note:: You can only get the default value of the control,
you cannot set or try it.
For backwards compatibility you can also use a control class here For backwards compatibility you can also use a control class here
(see :ref:`ctrl-class`). In that case all controls have to (see :ref:`ctrl-class`). In that case all controls have to
......
...@@ -128,12 +128,14 @@ To change the radio frequency the ...@@ -128,12 +128,14 @@ To change the radio frequency the
- With this field applications can determine how audio sub-carriers - With this field applications can determine how audio sub-carriers
shall be modulated. It contains a set of flags as defined in shall be modulated. It contains a set of flags as defined in
:ref:`modulator-txsubchans`. Note the tuner ``rxsubchans`` flags :ref:`modulator-txsubchans`.
are reused, but the semantics are different. Video output devices
are assumed to have an analog or PCM audio input with 1-3 .. note:: The tuner ``rxsubchans`` flags are reused, but the
channels. The ``txsubchans`` flags select one or more channels for semantics are different. Video output devices
modulation, together with some audio subprogram indicator, for are assumed to have an analog or PCM audio input with 1-3
example a stereo pilot tone. channels. The ``txsubchans`` flags select one or more channels
for modulation, together with some audio subprogram indicator,
for example, a stereo pilot tone.
- .. row 7 - .. row 7
......
...@@ -40,8 +40,8 @@ output device, applications initialize the ``type`` field of a struct ...@@ -40,8 +40,8 @@ output device, applications initialize the ``type`` field of a struct
driver fills in the remaining fields or returns an ``EINVAL`` error code if driver fills in the remaining fields or returns an ``EINVAL`` error code if
the sliced VBI API is unsupported or ``type`` is invalid. the sliced VBI API is unsupported or ``type`` is invalid.
Note the ``type`` field was added, and the ioctl changed from read-only .. note:: The ``type`` field was added, and the ioctl changed from read-only
to write-read, in Linux 2.6.19. to write-read, in Linux 2.6.19.
.. _v4l2-sliced-vbi-cap: .. _v4l2-sliced-vbi-cap:
......
...@@ -391,9 +391,9 @@ To change the radio frequency the ...@@ -391,9 +391,9 @@ To change the radio frequency the
carrier for a monaural secondary language. Only carrier for a monaural secondary language. Only
``V4L2_TUNER_ANALOG_TV`` tuners can have this capability. ``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
Note the ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP`` flags .. note:: The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner
supports the ``V4L2_STD_NTSC_M`` video standard. supports the ``V4L2_STD_NTSC_M`` video standard.
- .. row 9 - .. row 9
...@@ -500,10 +500,11 @@ To change the radio frequency the ...@@ -500,10 +500,11 @@ To change the radio frequency the
- 0x0004 - 0x0004
- The tuner receives a Second Audio Program. Note the - The tuner receives a Second Audio Program.
``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP`` flags are
synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies when the current .. note:: The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
video standard is ``V4L2_STD_NTSC_M``. flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies
when the current video standard is ``V4L2_STD_NTSC_M``.
- .. row 6 - .. row 6
...@@ -578,9 +579,10 @@ To change the radio frequency the ...@@ -578,9 +579,10 @@ To change the radio frequency the
- Play the Second Audio Program. When the tuner receives no - Play the Second Audio Program. When the tuner receives no
bilingual audio or SAP, or their reception is not supported the bilingual audio or SAP, or their reception is not supported the
driver shall fall back to mono or stereo mode. Only driver shall fall back to mono or stereo mode. Only
``V4L2_TUNER_ANALOG_TV`` tuners support this mode. Note the ``V4L2_TUNER_ANALOG_TV`` tuners support this mode.
``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP`` are
synonyms. .. note:: The ``V4L2_TUNER_MODE_LANG2`` and ``V4L2_TUNER_MODE_SAP``
are synonyms.
- .. row 6 - .. row 6
......
...@@ -135,14 +135,15 @@ EINVAL ...@@ -135,14 +135,15 @@ EINVAL
EIO EIO
``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate ``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate
temporary problems like signal loss. Note the driver might dequeue temporary problems like signal loss.
an (empty) buffer despite returning an error, or even stop
capturing. Reusing such buffer may be unsafe though and its details .. note:: The driver might dequeue an (empty) buffer despite returning
(e.g. ``index``) may not be returned either. It is recommended that an error, or even stop capturing. Reusing such buffer may be unsafe
drivers indicate recoverable errors by setting the though and its details (e.g. ``index``) may not be returned either.
``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the It is recommended that drivers indicate recoverable errors by setting
application should be able to safely reuse the buffer and continue the ``V4L2_BUF_FLAG_ERROR`` and returning 0 instead. In that case the
streaming. application should be able to safely reuse the buffer and continue
streaming.
EPIPE EPIPE
``VIDIOC_DQBUF`` returns this on an empty capture queue for mem2mem ``VIDIOC_DQBUF`` returns this on an empty capture queue for mem2mem
......
...@@ -39,16 +39,16 @@ similar to sensing the video standard. To do so, applications call ...@@ -39,16 +39,16 @@ similar to sensing the video standard. To do so, applications call
:ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects :ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects
the timings, it will fill in the timings structure. the timings, it will fill in the timings structure.
Please note that drivers shall *not* switch timings automatically if new .. note:: Drivers shall *not* switch timings automatically if new
timings are detected. Instead, drivers should send the timings are detected. Instead, drivers should send the
``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect
that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`. that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`.
The reason is that new timings usually mean different buffer sizes as The reason is that new timings usually mean different buffer sizes as
well, and you cannot change buffer sizes on the fly. In general, well, and you cannot change buffer sizes on the fly. In general,
applications that receive the Source Change event will have to call applications that receive the Source Change event will have to call
:ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they :ref:`VIDIOC_QUERY_DV_TIMINGS`, and if the detected timings are valid they
will have to stop streaming, set the new timings, allocate new buffers will have to stop streaming, set the new timings, allocate new buffers
and start streaming again. and start streaming again.
If the timings could not be detected because there was no signal, then If the timings could not be detected because there was no signal, then
ENOLINK is returned. If a signal was detected, but it was unstable and ENOLINK is returned. If a signal was detected, but it was unstable and
......
...@@ -82,10 +82,12 @@ fills the rest of the structure or returns an ``EINVAL`` error code when the ...@@ -82,10 +82,12 @@ fills the rest of the structure or returns an ``EINVAL`` error code when the
``id`` or ``index`` is invalid. Menu items are enumerated by calling ``id`` or ``index`` is invalid. Menu items are enumerated by calling
``VIDIOC_QUERYMENU`` with successive ``index`` values from struct ``VIDIOC_QUERYMENU`` with successive ``index`` values from struct
:ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``, :ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``,
inclusive. Note that it is possible for ``VIDIOC_QUERYMENU`` to return inclusive.
an ``EINVAL`` error code for some indices between ``minimum`` and
``maximum``. In that case that particular menu item is not supported by .. note:: It is possible for ``VIDIOC_QUERYMENU`` to return
this driver. Also note that the ``minimum`` value is not necessarily 0. an ``EINVAL`` error code for some indices between ``minimum`` and
``maximum``. In that case that particular menu item is not supported by
this driver. Also note that the ``minimum`` value is not necessarily 0.
See also the examples in :ref:`control`. See also the examples in :ref:`control`.
...@@ -184,9 +186,10 @@ See also the examples in :ref:`control`. ...@@ -184,9 +186,10 @@ See also the examples in :ref:`control`.
- The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_BOOLEAN``, - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_BOOLEAN``,
``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid ``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid
for other types of controls. Note that drivers reset controls to for other types of controls.
their default value only when the driver is first loaded, never
afterwards. .. note:: Drivers reset controls to their default value only when
the driver is first loaded, never afterwards.
- .. row 8 - .. row 8
...@@ -301,9 +304,10 @@ See also the examples in :ref:`control`. ...@@ -301,9 +304,10 @@ See also the examples in :ref:`control`.
- The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_INTEGER64``, - The default value of a ``V4L2_CTRL_TYPE_INTEGER``, ``_INTEGER64``,
``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8`` ``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8``
or ``_U16`` control. Not valid for other types of controls. Note or ``_U16`` control. Not valid for other types of controls.
that drivers reset controls to their default value only when the
driver is first loaded, never afterwards. .. note:: Drivers reset controls to their default value only when
the driver is first loaded, never afterwards.
- .. row 8 - .. row 8
...@@ -722,11 +726,12 @@ See also the examples in :ref:`control`. ...@@ -722,11 +726,12 @@ See also the examples in :ref:`control`.
control changes continuously. A typical example would be the control changes continuously. A typical example would be the
current gain value if the device is in auto-gain mode. In such a current gain value if the device is in auto-gain mode. In such a
case the hardware calculates the gain value based on the lighting case the hardware calculates the gain value based on the lighting
conditions which can change over time. Note that setting a new conditions which can change over time.
value for a volatile control will have no effect and no
``V4L2_EVENT_CTRL_CH_VALUE`` will be sent, unless the .. note:: Setting a new value for a volatile control will have no
``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` flag (see below) is also set. effect and no ``V4L2_EVENT_CTRL_CH_VALUE`` will be sent, unless
Otherwise the new value will just be ignored. the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` flag (see below) is
also set. Otherwise the new value will just be ignored.
- .. row 9 - .. row 9
......
...@@ -43,16 +43,16 @@ will return V4L2_STD_UNKNOWN. When detection is not possible or fails, ...@@ -43,16 +43,16 @@ will return V4L2_STD_UNKNOWN. When detection is not possible or fails,
the set must contain all standards supported by the current video input the set must contain all standards supported by the current video input
or output. or output.
Please note that drivers shall *not* switch the video standard .. note:: Drivers shall *not* switch the video standard
automatically if a new video standard is detected. Instead, drivers automatically if a new video standard is detected. Instead, drivers
should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support
this) and expect that userspace will take action by calling this) and expect that userspace will take action by calling
:ref:`VIDIOC_QUERYSTD`. The reason is that a new video standard can mean :ref:`VIDIOC_QUERYSTD`. The reason is that a new video standard can mean
different buffer sizes as well, and you cannot change buffer sizes on different buffer sizes as well, and you cannot change buffer sizes on
the fly. In general, applications that receive the Source Change event the fly. In general, applications that receive the Source Change event
will have to call :ref:`VIDIOC_QUERYSTD`, and if the detected video will have to call :ref:`VIDIOC_QUERYSTD`, and if the detected video
standard is valid they will have to stop streaming, set the new standard is valid they will have to stop streaming, set the new
standard, allocate new buffers and start streaming again. standard, allocate new buffers and start streaming again.
Return Value Return Value
......
...@@ -76,10 +76,10 @@ then 0 is returned. Nothing happens in the case of ``VIDIOC_STREAMON``, ...@@ -76,10 +76,10 @@ then 0 is returned. Nothing happens in the case of ``VIDIOC_STREAMON``,
but ``VIDIOC_STREAMOFF`` will return queued buffers to their starting but ``VIDIOC_STREAMOFF`` will return queued buffers to their starting
state as mentioned above. state as mentioned above.
Note that applications can be preempted for unknown periods right before .. note:: Applications can be preempted for unknown periods right before
or after the ``VIDIOC_STREAMON`` or ``VIDIOC_STREAMOFF`` calls, there is or after the ``VIDIOC_STREAMON`` or ``VIDIOC_STREAMOFF`` calls, there is
no notion of starting or stopping "now". Buffer timestamps can be used no notion of starting or stopping "now". Buffer timestamps can be used
to synchronize with other events. to synchronize with other events.
Return Value Return Value
......
...@@ -35,7 +35,7 @@ Arguments ...@@ -35,7 +35,7 @@ Arguments
Description Description
=========== ===========
**Note** .. note::
This is an :ref:`obsolete` interface and may be removed This is an :ref:`obsolete` interface and may be removed
in the future. It is superseded by in the future. It is superseded by
......
...@@ -51,9 +51,11 @@ using the :ref:`VIDIOC_DQEVENT` ioctl. ...@@ -51,9 +51,11 @@ using the :ref:`VIDIOC_DQEVENT` ioctl.
- ``type`` - ``type``
- Type of the event, see :ref:`event-type`. Note that - Type of the event, see :ref:`event-type`.
``V4L2_EVENT_ALL`` can be used with VIDIOC_UNSUBSCRIBE_EVENT for
unsubscribing all events at once. .. note:: ``V4L2_EVENT_ALL`` can be used with
:ref:`VIDIOC_UNSUBSCRIBE_EVENT` for unsubscribing all events
at once.
- .. row 2 - .. row 2
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment