^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_GET_STC:
^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) DMX_GET_STC
^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) DMX_GET_STC
^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:macro:: DMX_GET_STC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) ``int ioctl(int fd, DMX_GET_STC, struct dmx_stc *stc)``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) Arguments
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) ---------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) ``fd``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) File descriptor returned by :c:func:`open()`.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) ``stc``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) Pointer to :c:type:`dmx_stc` where the stc data is to be stored.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Description
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) -----------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) This ioctl call returns the current value of the system time counter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) (which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Some hardware supports more than one STC, so you must specify which one by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) The result is returned in form of a ratio with a 64 bit numerator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) and a 32 bit denominator, so the real 90kHz STC value is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) ``stc->stc / stc->base``.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) Return Value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) ------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) On success 0 is returned.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) On error -1 is returned, and the ``errno`` variable is set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) appropriately.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) .. flat-table::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) :header-rows: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) :stub-columns: 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) :widths: 1 16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) - .. row 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) - ``EINVAL``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) - Invalid stc number.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) The generic error codes are described at the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) :ref:`Generic Error Codes <gen-errors>` chapter.