diff options
author | MaZderMind <github@mazdermind.de> | 2014-07-28 23:13:45 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2014-07-28 23:13:45 +0200 |
commit | f3245358a983f2e97076cac3bbeaafc42eac148a (patch) | |
tree | 3f6a4e3651d7831be5496f25807186bd67cd5f4f /voctocat | |
parent | 150db06d4dccb52b1b219dad4f5bb189c9d29d95 (diff) |
rename from octocat to core
Diffstat (limited to 'voctocat')
-rw-r--r-- | voctocat/README.md | 0 | ||||
-rw-r--r-- | voctocat/controlserver.py | 4 | ||||
-rw-r--r-- | voctocat/videomix.py | 69 | ||||
-rwxr-xr-x | voctocat/voctocat.py | 27 |
4 files changed, 0 insertions, 100 deletions
diff --git a/voctocat/README.md b/voctocat/README.md deleted file mode 100644 index e69de29..0000000 --- a/voctocat/README.md +++ /dev/null diff --git a/voctocat/controlserver.py b/voctocat/controlserver.py deleted file mode 100644 index 8397705..0000000 --- a/voctocat/controlserver.py +++ /dev/null @@ -1,4 +0,0 @@ -class ControlServer: - - def __init__(self, videomix): - self.videomix = videomix diff --git a/voctocat/videomix.py b/voctocat/videomix.py deleted file mode 100644 index 895a25f..0000000 --- a/voctocat/videomix.py +++ /dev/null @@ -1,69 +0,0 @@ -import sys, inspect -from pprint import pprint -from gi.repository import GLib, Gst - -class Videomix: - decoder = [] - mixerpads = [] - - def __init__(self): - self.pipeline = Gst.Pipeline() - - self.videomixer = Gst.ElementFactory.make('videomixer', 'videomixer') - self.pipeline.add(self.videomixer) - - for uri in ("http://video.blendertestbuilds.de/download.blender.org/ED/ED_1280.avi", "http://download.blender.org/durian/trailer/sintel_trailer-720p.mp4",): - decoder = Gst.ElementFactory.make('uridecodebin', 'uridecoder('+uri+')') - decoder.set_property("uri", uri) - decoder.connect("pad-added", self.OnDynamicPad) - self.pipeline.add(decoder) - self.decoder.append(decoder) - - self.monitorvideosink = Gst.ElementFactory.make('autovideosink', 'monitorvideosink') - self.pipeline.add(self.monitorvideosink) - self.videomixer.link(self.monitorvideosink) - - self.monitoraudiosink = Gst.ElementFactory.make('autoaudiosink', 'monitoraudiosink') - self.pipeline.add(self.monitoraudiosink) - - self.pipeline.set_state(Gst.State.PLAYING) - - GLib.io_add_watch(sys.stdin, GLib.IO_IN, self.Input) - - def Input(self, fd, condition): - if condition == GLib.IO_IN: - char = fd.readline() - try: - i = int(char.rstrip()) - print("settinh pad {0} to alpha=1".format(i)) - self.mixerpads[i].set_property('alpha', 1) - for idx, pad in enumerate(self.mixerpads): - if idx != i: - print("settinh pad {0} to alpha=0".format(idx)) - pad.set_property('alpha', 0) - except: - pass - - return True - else: - return False - - def OnDynamicPad(self, uridecodebin, src_pad): - caps = src_pad.query_caps(None).to_string() - srcname = uridecodebin.get_name() - print("{0}-source of {1} online".format(caps.split(',')[0], srcname)) - - if caps.startswith('audio/'): - sinkpad = self.monitoraudiosink.get_static_pad("sink") - - # link the first audio-stream and be done - if not sinkpad.is_linked(): - src_pad.link(sinkpad) - - else: - sinkpad = Gst.Element.get_request_pad(self.videomixer, "sink_%u") - src_pad.link(sinkpad) - self.mixerpads.append(sinkpad) - print('add', sinkpad) - sinkpad.set_property('alpha', 0.7) - diff --git a/voctocat/voctocat.py b/voctocat/voctocat.py deleted file mode 100755 index dcab83d..0000000 --- a/voctocat/voctocat.py +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/python3 -import gi -import signal - -gi.require_version('Gst', '1.0') -from gi.repository import GLib, Gst, Gtk, GObject - -from videomix import Videomix -from controlserver import ControlServer - - - -class Main: - def __init__(self): - self.videomix = Videomix() - self.controlserver = ControlServer(self.videomix) - -def runmain(): - GObject.threads_init() - Gst.init(None) - - signal.signal(signal.SIGINT, signal.SIG_DFL) - start=Main() - Gtk.main() - -if __name__ == '__main__': - runmain() |