summaryrefslogtreecommitdiff
path: root/voctocore/lib/pipeline.py
blob: 56875737ec71ec62b3abdf35cad94aad4852697c (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.video.src import VideoSrc
  9. from lib.video.rawoutput import VideoRawOutput
  10. from lib.video.mix import VideoMix
  11. class Pipeline(object):
  12. """mixing, streaming and encoding pipeline constuction and control"""
  13. log = logging.getLogger('Pipeline')
  14. vsources = []
  15. vmirrors = []
  16. vpreviews = []
  17. def __init__(self):
  18. caps = Config.get('mix', 'videocaps')
  19. self.log.info('Video-Caps configured to: %s', caps)
  20. for idx, name in enumerate(Config.getlist('sources', 'video')):
  21. port = 10000 + idx
  22. self.log.info('Creating Video-Source %s at tcp-port %u', name, port)
  23. source = VideoSrc(name, port, caps)
  24. self.vsources.append(source)
  25. port = 13000 + idx
  26. self.log.info('Creating Mirror-Output for Video-Source %s at tcp-port %u', name, port)
  27. mirror = VideoRawOutput('video_%s_mirror' % name, port, caps)
  28. self.vmirrors.append(mirror)
  29. # self.log.debug('Creating Video-Mixer')
  30. # self.videomixer = VideoMix()
  31. # port = 11000
  32. # self.log.debug('Creating Video-Mixer-Output at tcp-port %u', port)
  33. # mirror = VideoRawOutput('video_mix', port, caps)