dmx-get-stc.rst 1.3 KB

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