From e104284f309b4492325931c5b47a16505e44a9a1 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Sun, 10 May 2015 20:06:51 +0200 Subject: Move files & implement output counting --- voctocore/lib/videomix.py | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 voctocore/lib/videomix.py (limited to 'voctocore/lib/videomix.py') diff --git a/voctocore/lib/videomix.py b/voctocore/lib/videomix.py deleted file mode 100644 index 9207723..0000000 --- a/voctocore/lib/videomix.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/python3 -import time, logging -from gi.repository import GLib, Gst - -from lib.config import Config - -class VideoMix(object): - log = logging.getLogger('VideoMix') - mixerpads = [] - - def __init__(self): - super().__init__() - - self.mixer = Gst.ElementFactory.make('videomixer', 'mixer') - self.scale = Gst.ElementFactory.make('videoscale', 'scale') - self.conv = Gst.ElementFactory.make('videoconvert', 'conv') - - self.add(self.mixer) - self.add(self.scale) - self.add(self.conv) - - caps = Gst.Caps.from_string(Config.get('mix', 'outputcaps')) - self.mixer.link_filtered(self.scale, caps) - self.scale.link(self.conv) - - self.add_pad( - Gst.GhostPad.new('src', self.conv.get_static_pad('src')) - ) - - def request_mixer_pad(self): - mixerpad = self.mixer.get_request_pad('sink_%u') - self.mixerpads.append(mixerpad) - mixerpad.set_property('alpha', 1) - - self.log.info('requested mixerpad %u (named %s)', len(self.mixerpads) - 1, mixerpad.get_name()) - ghostpad = Gst.GhostPad.new(mixerpad.get_name(), mixerpad) - self.add_pad(ghostpad) - return ghostpad - - def set_active(self, target): - self.log.info('setting videosource %u active, disabling other', target) - for idx, mixerpad in enumerate(self.mixerpads): - mixerpad.set_property('alpha', int(target == idx)) -- cgit v1.2.3