blob: 488bdc4ba178a90c37758e42d1b8a049f20a36b8 [file] [log] [blame]
.. -*- coding: utf-8; mode: rst -*-
.. _dmx_fread:
Digital TV demux read()
Digital TV demux read()
.. c:function:: size_t read(int fd, void *buf, size_t count)
:name: dvb-dmx-read
File descriptor returned by a previous call to :c:func:`open() <dvb-ca-open>`.
Buffer to be filled
Max number of bytes to read
This system call returns filtered data, which might be section or Packetized
Elementary Stream (PES) data. The filtered data is transferred from
the drivers internal circular buffer to ``buf``. The maximum amount of data
to be transferred is implied by count.
.. 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.
Return Value
On success 0 is returned.
On error -1 is returned, and the ``errno`` variable is set
.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 1 16
- No data to return and ``O_NONBLOCK`` was specified.
- The filtered data was not read from the buffer in due time,
resulting in non-read data being lost. The buffer is flushed.
- The section was not loaded within the stated timeout period.
See ioctl :ref:`DMX_SET_FILTER` for how to set a timeout.
- - ``EFAULT``
- The driver failed to write to the callers buffer due to an
invalid \*buf pointer.
The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.