0001 .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
0002 .. c:namespace:: DTV.dmx
0003
0004 .. _dmx_fopen:
0005
0006 =======================
0007 Digital TV demux open()
0008 =======================
0009
0010 Name
0011 ----
0012
0013 Digital TV demux open()
0014
0015 Synopsis
0016 --------
0017
0018 .. c:function:: int open(const char *deviceName, int flags)
0019
0020 Arguments
0021 ---------
0022
0023 ``name``
0024 Name of specific Digital TV demux device.
0025
0026 ``flags``
0027 A bit-wise OR of the following flags:
0028
0029 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
0030
0031 .. flat-table::
0032 :header-rows: 0
0033 :stub-columns: 0
0034 :widths: 1 16
0035
0036 -
0037 - ``O_RDONLY``
0038 - read-only access
0039
0040 -
0041 - ``O_RDWR``
0042 - read/write access
0043
0044 -
0045 - ``O_NONBLOCK``
0046 - open in non-blocking mode
0047 (blocking mode is the default)
0048
0049 Description
0050 -----------
0051
0052 This system call, used with a device name of ``/dev/dvb/adapter?/demux?``,
0053 allocates a new filter and returns a handle which can be used for
0054 subsequent control of that filter. This call has to be made for each
0055 filter to be used, i.e. every returned file descriptor is a reference to
0056 a single filter. ``/dev/dvb/adapter?/dvr?`` is a logical device to be used
0057 for retrieving Transport Streams for digital video recording. When
0058 reading from this device a transport stream containing the packets from
0059 all PES filters set in the corresponding demux device
0060 (``/dev/dvb/adapter?/demux?``) having the output set to ``DMX_OUT_TS_TAP``.
0061 A recorded Transport Stream is replayed by writing to this device.
0062
0063 The significance of blocking or non-blocking mode is described in the
0064 documentation for functions where there is a difference. It does not
0065 affect the semantics of the ``open()`` call itself. A device opened
0066 in blocking mode can later be put into non-blocking mode (and vice versa)
0067 using the ``F_SETFL`` command of the fcntl system call.
0068
0069 Return Value
0070 ------------
0071
0072 On success 0 is returned.
0073
0074 On error -1 is returned, and the ``errno`` variable is set
0075 appropriately.
0076
0077 .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
0078
0079 .. flat-table::
0080 :header-rows: 0
0081 :stub-columns: 0
0082 :widths: 1 16
0083
0084 - - ``EMFILE``
0085 - "Too many open files", i.e. no more filters available.
0086
0087 The generic error codes are described at the
0088 :ref:`Generic Error Codes <gen-errors>` chapter.