aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib/clock.py
blob: 862c2d53be6a8673df874be48f92d09d71310683 (plain)
  1. #!/usr/bin/python3
  2. import logging
  3. from gi.repository import Gst, GstNet
  4. __all__ = ['Clock']
  5. port = 9998
  6. log = logging.getLogger('Clock')
  7. Clock = None
  8. log.debug("Obtaining System-Clock")
  9. SystemClock = Gst.SystemClock.obtain()
  10. def obtainClock(host):
  11. global log, Clock, SystemClock
  12. log.debug('obtaining NetClientClock from host %s', host)
  13. Clock = GstNet.NetClientClock.new('voctocore', host, port, SystemClock.get_time())
  14. log.info('obtained NetClientClock from host %s: %s', host, Clock)