summaryrefslogtreecommitdiff
path: root/voctocore/lib/distributor.py
blob: 8282839e33d3836d347f322594c17bcd220f01fd (plain)
  1. #!/usr/bin/python3
  2. import time, logging
  3. from gi.repository import GLib, Gst
  4. from lib.config import Config
  5. class TimesTwoDistributor(Gst.Bin):
  6. log = logging.getLogger('TimesTwoDistributor')
  7. def __init__(self):
  8. super().__init__()
  9. self.tee = Gst.ElementFactory.make('tee', None)
  10. self.queue_a = Gst.ElementFactory.make('queue', 'queue-a')
  11. self.queue_b = Gst.ElementFactory.make('queue', 'queue-b')
  12. self.add(self.tee)
  13. self.add(self.queue_a)
  14. self.add(self.queue_b)
  15. self.tee.link(self.queue_a)
  16. self.tee.link(self.queue_b)
  17. # Add Ghost Pads
  18. self.add_pad(
  19. Gst.GhostPad.new('sink', self.tee.get_static_pad('sink'))
  20. )
  21. self.add_pad(
  22. Gst.GhostPad.new('src_a', self.queue_a.get_static_pad('src'))
  23. )
  24. self.add_pad(
  25. Gst.GhostPad.new('src_b', self.queue_b.get_static_pad('src'))
  26. )