diff options
author | MaZderMind <github@mazdermind.de> | 2015-04-23 06:49:07 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-04-23 06:49:42 +0200 |
commit | f4cd6ec1bfed02def8502bc8373b1fe0d35acca8 (patch) | |
tree | 0b6f79472d0d033a8fb9c852f079d15740132731 /voctocore/experiments/startuptest/startuptest.py | |
parent | 33ae6e1aac59b4d120ed3b8a319c6eb0ed5045cf (diff) |
remove unsuccessful experiments, add intervideo-based working example
Diffstat (limited to 'voctocore/experiments/startuptest/startuptest.py')
-rwxr-xr-x | voctocore/experiments/startuptest/startuptest.py | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/voctocore/experiments/startuptest/startuptest.py b/voctocore/experiments/startuptest/startuptest.py deleted file mode 100755 index 58e676a..0000000 --- a/voctocore/experiments/startuptest/startuptest.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/python3 - -# Example for the startup-problem -# -# The Pipeline will start but the test-image will be still, as long as no -# ShmSink at /tmp/grabber-v is present (run ../test-grabber-src.sh in another shell) -# -# Even though the ShmSrc is not linked to anything and logically not required for -# the videotestsrc or the ximagesink, the whole pipeline won't startup when this element -# fails to start. -# -# once the pipeline is running, it does not matter what happens to the ShmSink on the -# other end, because the TestBin filters all EOS and ERROR Messages coming from the ShmSrc, -# but somehow this is not enough to make the pipeline start in an error-condition.. -# - -import gi, time - -# import GStreamer and GTK-Helper classes -gi.require_version('Gst', '1.0') -from gi.repository import GLib, Gst, GObject - -# init GObject before importing local classes -GObject.threads_init() -Gst.init(None) - -from testbin import TestBin - -class Example: - def __init__(self): - self.mainloop = GObject.MainLoop() - self.pipeline = Gst.Pipeline() - - self.src = Gst.ElementFactory.make('videotestsrc', None) - self.sink = Gst.ElementFactory.make('ximagesink', None) - - self.testbin = TestBin() - - # Add elements to pipeline - self.pipeline.add(self.testbin) - self.pipeline.add(self.src) - self.pipeline.add(self.sink) - - self.src.link(self.sink) - - def run(self): - print("PAUSED") - self.pipeline.set_state(Gst.State.PAUSED) - time.sleep(0.1) - print("PLAYING") - self.pipeline.set_state(Gst.State.PLAYING) - self.mainloop.run() - - def kill(self): - self.pipeline.set_state(Gst.State.NULL) - self.mainloop.quit() - -example = Example() -example.run() |