dmx-fopen.rst 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .. -*- coding: utf-8; mode: rst -*-
  2. .. _dmx_fopen:
  3. =======================
  4. Digital TV demux open()
  5. =======================
  6. Name
  7. ----
  8. Digital TV demux open()
  9. Synopsis
  10. --------
  11. .. c:function:: int open(const char *deviceName, int flags)
  12. :name: dvb-dmx-open
  13. Arguments
  14. ---------
  15. ``name``
  16. Name of specific Digital TV demux device.
  17. ``flags``
  18. A bit-wise OR of the following flags:
  19. .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
  20. .. flat-table::
  21. :header-rows: 0
  22. :stub-columns: 0
  23. :widths: 1 16
  24. -
  25. - ``O_RDONLY``
  26. - read-only access
  27. -
  28. - ``O_RDWR``
  29. - read/write access
  30. -
  31. - ``O_NONBLOCK``
  32. - open in non-blocking mode
  33. (blocking mode is the default)
  34. Description
  35. -----------
  36. This system call, used with a device name of ``/dev/dvb/adapter?/demux?``,
  37. allocates a new filter and returns a handle which can be used for
  38. subsequent control of that filter. This call has to be made for each
  39. filter to be used, i.e. every returned file descriptor is a reference to
  40. a single filter. ``/dev/dvb/adapter?/dvr?`` is a logical device to be used
  41. for retrieving Transport Streams for digital video recording. When
  42. reading from this device a transport stream containing the packets from
  43. all PES filters set in the corresponding demux device
  44. (``/dev/dvb/adapter?/demux?``) having the output set to ``DMX_OUT_TS_TAP``.
  45. A recorded Transport Stream is replayed by writing to this device.
  46. The significance of blocking or non-blocking mode is described in the
  47. documentation for functions where there is a difference. It does not
  48. affect the semantics of the ``open()`` call itself. A device opened
  49. in blocking mode can later be put into non-blocking mode (and vice versa)
  50. using the ``F_SETFL`` command of the fcntl system call.
  51. Return Value
  52. ------------
  53. On success 0 is returned.
  54. On error -1 is returned, and the ``errno`` variable is set
  55. appropriately.
  56. .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
  57. .. flat-table::
  58. :header-rows: 0
  59. :stub-columns: 0
  60. :widths: 1 16
  61. - - ``EMFILE``
  62. - “Too many open files”, i.e. no more filters available.
  63. The generic error codes are described at the
  64. :ref:`Generic Error Codes <gen-errors>` chapter.