2020-08-26 15:03:09 +08:00
|
|
|
.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
|
2020-09-24 22:56:00 +08:00
|
|
|
.. c:namespace:: DTV.dmx
|
2018-08-30 22:15:26 +08:00
|
|
|
|
2016-07-05 21:37:31 +08:00
|
|
|
.. _dmx_fread:
|
|
|
|
|
2017-09-02 00:28:16 +08:00
|
|
|
=======================
|
|
|
|
Digital TV demux read()
|
|
|
|
=======================
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Name
|
2016-07-05 18:58:48 +08:00
|
|
|
----
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:28:16 +08:00
|
|
|
Digital TV demux read()
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Synopsis
|
2016-07-05 21:37:31 +08:00
|
|
|
--------
|
|
|
|
|
2016-08-19 23:00:43 +08:00
|
|
|
.. c:function:: size_t read(int fd, void *buf, size_t count)
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Arguments
|
2016-07-05 18:58:48 +08:00
|
|
|
---------
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-08-20 03:56:15 +08:00
|
|
|
``fd``
|
2020-09-24 22:56:00 +08:00
|
|
|
File descriptor returned by a previous call to :c:func:`open()`.
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-08-20 03:56:15 +08:00
|
|
|
``buf``
|
|
|
|
Buffer to be filled
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-08-20 03:56:15 +08:00
|
|
|
``count``
|
|
|
|
Max number of bytes to read
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Description
|
2016-07-05 18:58:48 +08:00
|
|
|
-----------
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:21:49 +08:00
|
|
|
This system call returns filtered data, which might be section or Packetized
|
|
|
|
Elementary Stream (PES) data. The filtered data is transferred from
|
2021-06-02 21:12:18 +08:00
|
|
|
the driver's internal circular buffer to ``buf``. The maximum amount of data
|
2017-09-02 00:21:49 +08:00
|
|
|
to be transferred is implied by count.
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:30:16 +08:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
if a section filter created with
|
|
|
|
:c:type:`DMX_CHECK_CRC <dmx_sct_filter_params>` flag set,
|
|
|
|
data that fails on CRC check will be silently ignored.
|
|
|
|
|
2016-07-06 02:14:35 +08:00
|
|
|
Return Value
|
2016-07-05 18:58:48 +08:00
|
|
|
------------
|
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
On success 0 is returned.
|
|
|
|
|
|
|
|
On error -1 is returned, and the ``errno`` variable is set
|
|
|
|
appropriately.
|
|
|
|
|
2016-08-19 19:00:44 +08:00
|
|
|
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
|
|
|
|
|
2016-07-05 21:37:31 +08:00
|
|
|
.. flat-table::
|
|
|
|
:header-rows: 0
|
|
|
|
:stub-columns: 0
|
2017-09-02 00:15:43 +08:00
|
|
|
:widths: 1 16
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
- - ``EWOULDBLOCK``
|
|
|
|
- No data to return and ``O_NONBLOCK`` was specified.
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
- - ``EOVERFLOW``
|
2016-07-05 21:37:31 +08:00
|
|
|
- The filtered data was not read from the buffer in due time,
|
|
|
|
resulting in non-read data being lost. The buffer is flushed.
|
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
- - ``ETIMEDOUT``
|
|
|
|
- The section was not loaded within the stated timeout period.
|
|
|
|
See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
- - ``EFAULT``
|
|
|
|
- The driver failed to write to the callers buffer due to an
|
|
|
|
invalid \*buf pointer.
|
2016-07-05 21:37:31 +08:00
|
|
|
|
2017-09-02 00:15:43 +08:00
|
|
|
The generic error codes are described at the
|
|
|
|
:ref:`Generic Error Codes <gen-errors>` chapter.
|