dmx-fread.rst 1.7 KB

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