^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) .. c:namespace:: DTV.dmx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) .. _dmx_fread:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Digital TV demux read()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) =======================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) Name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) ----
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Digital TV demux read()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Synopsis
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) --------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) .. c:function:: size_t read(int fd, void *buf, size_t count)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) File descriptor returned by a previous call to :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) ``buf``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) Buffer to be filled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) ``count``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) Max number of bytes to read
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) This system call returns filtered data, which might be section or Packetized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Elementary Stream (PES) data. The filtered data is transferred from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) the driver’s internal circular buffer to ``buf``. The maximum amount of data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) to be transferred is implied by count.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) .. note::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) if a section filter created with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) :c:type:`DMX_CHECK_CRC <dmx_sct_filter_params>` flag set,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) data that fails on CRC check will be silently ignored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) On success 0 is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) On error -1 is returned, and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) appropriately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) .. flat-table::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) :widths: 1 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) - - ``EWOULDBLOCK``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) - No data to return and ``O_NONBLOCK`` was specified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) - - ``EOVERFLOW``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) - The filtered data was not read from the buffer in due time,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) resulting in non-read data being lost. The buffer is flushed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) - - ``ETIMEDOUT``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) - The section was not loaded within the stated timeout period.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) - - ``EFAULT``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) - The driver failed to write to the callers buffer due to an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) invalid \*buf pointer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) :ref:`Generic Error Codes <gen-errors>` chapter.