aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib/clock.py
blob: 1a977ce7f7578494334c4802d322c5d8edeb758d (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. def obtainClock(host):
  9. global log, Clock, SystemClock
  10. log.debug('obtaining NetClientClock from host %s', host)
  11. Clock = GstNet.NetClientClock.new('voctocore', host, port, 0)
  12. log.debug('obtained NetClientClock from host %s: %s', host, Clock)
  13. log.debug('waiting for NetClientClock to sync to host')
  14. Clock.wait_for_sync(Gst.CLOCK_TIME_NONE)
  15. log.info('successfully synced NetClientClock to host')