dmx-get-stc.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. .. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
  2. .. c:namespace:: DTV.dmx
  3. .. _DMX_GET_STC:
  4. ===========
  5. DMX_GET_STC
  6. ===========
  7. Name
  8. ----
  9. DMX_GET_STC
  10. Synopsis
  11. --------
  12. .. c:macro:: DMX_GET_STC
  13. ``int ioctl(int fd, DMX_GET_STC, struct dmx_stc *stc)``
  14. Arguments
  15. ---------
  16. ``fd``
  17. File descriptor returned by :c:func:`open()`.
  18. ``stc``
  19. Pointer to :c:type:`dmx_stc` where the stc data is to be stored.
  20. Description
  21. -----------
  22. This ioctl call returns the current value of the system time counter
  23. (which is driven by a PES filter of type :c:type:`DMX_PES_PCR <dmx_ts_pes>`).
  24. Some hardware supports more than one STC, so you must specify which one by
  25. setting the :c:type:`num <dmx_stc>` field of stc before the ioctl (range 0...n).
  26. The result is returned in form of a ratio with a 64 bit numerator
  27. and a 32 bit denominator, so the real 90kHz STC value is
  28. ``stc->stc / stc->base``.
  29. Return Value
  30. ------------
  31. On success 0 is returned.
  32. On error -1 is returned, and the ``errno`` variable is set
  33. appropriately.
  34. .. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
  35. .. flat-table::
  36. :header-rows: 0
  37. :stub-columns: 0
  38. :widths: 1 16
  39. - .. row 1
  40. - ``EINVAL``
  41. - Invalid stc number.
  42. The generic error codes are described at the
  43. :ref:`Generic Error Codes <gen-errors>` chapter.