aboutsummaryrefslogtreecommitdiff
path: root/voctocore/lib/pipeline.py
blob: 6c207feef9f7ae998b374666f858fad70d660f5b (plain)
  1. #!/usr/bin/python3
  2. import logging
  3. from gi.repository import Gst
  4. # import controlserver annotation
  5. from lib.controlserver import controlServerEntrypoint
  6. # import library components
  7. from lib.config import Config
  8. from lib.videosrc import VideoSrc
  9. from lib.videosrcmirror import VideoSrcMirror
  10. class Pipeline(object):
  11. """mixing, streaming and encoding pipeline constuction and control"""
  12. log = logging.getLogger('Pipeline')
  13. vsources = []
  14. vmirrors = []
  15. def __init__(self):
  16. # self.log.debug('Creating A/V-Mixer')
  17. # self.videomixer = VideoMix()
  18. # self.add(self.videomixer)
  19. # self.audiomixer = AudioMix()
  20. # self.add(self.audiomixer)
  21. caps = Config.get('mix', 'videocaps')
  22. self.log.info('Video-Caps configured to: %s', caps)
  23. for idx, name in enumerate(Config.getlist('sources', 'video')):
  24. port = 10000 + idx
  25. self.log.info('Creating Video-Source %s at tcp-port %u', name, port)
  26. source = VideoSrc(name, port, caps)
  27. self.vsources.append(source)
  28. port = 13000 + idx
  29. self.log.info('Creating Mirror-Output for Video-Source %s at tcp-port %u', name, port)
  30. mirror = VideoSrcMirror(name, port, caps)
  31. self.vmirrors.append(mirror)