diff options
author | MaZderMind <peter@mazdermind.de> | 2014-08-25 10:59:21 +0200 |
---|---|---|
committer | MaZderMind <peter@mazdermind.de> | 2014-08-25 10:59:21 +0200 |
commit | 2219fbe4bda924019080316b5718cbb6539f93d4 (patch) | |
tree | 41c532d3df37a032abf54f6c2174e3dfba1225fc /voctocore/lib/distributor.py | |
parent | b9e3f1a2733d56c2410fdec0f0864db6ae728d74 (diff) |
implement times-two distribution and main video mixer
Diffstat (limited to 'voctocore/lib/distributor.py')
-rw-r--r-- | voctocore/lib/distributor.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/voctocore/lib/distributor.py b/voctocore/lib/distributor.py new file mode 100644 index 0000000..8282839 --- /dev/null +++ b/voctocore/lib/distributor.py @@ -0,0 +1,33 @@ +#!/usr/bin/python3 +import time, logging +from gi.repository import GLib, Gst + +from lib.config import Config + +class TimesTwoDistributor(Gst.Bin): + log = logging.getLogger('TimesTwoDistributor') + + def __init__(self): + super().__init__() + + self.tee = Gst.ElementFactory.make('tee', None) + self.queue_a = Gst.ElementFactory.make('queue', 'queue-a') + self.queue_b = Gst.ElementFactory.make('queue', 'queue-b') + + self.add(self.tee) + self.add(self.queue_a) + self.add(self.queue_b) + + self.tee.link(self.queue_a) + self.tee.link(self.queue_b) + + # Add Ghost Pads + self.add_pad( + Gst.GhostPad.new('sink', self.tee.get_static_pad('sink')) + ) + self.add_pad( + Gst.GhostPad.new('src_a', self.queue_a.get_static_pad('src')) + ) + self.add_pad( + Gst.GhostPad.new('src_b', self.queue_b.get_static_pad('src')) + ) |