X-Git-Url: https://git.ao2.it/experiments/gstreamer.git/blobdiff_plain/a4c52c06e5bd73066e704a476bb9388314c503b7..28de60bacf12c9acd1664f009d05337a5368d0a4:/python/gst-input-selector-switch.py?ds=sidebyside diff --git a/python/gst-input-selector-switch.py b/python/gst-input-selector-switch.py index f653dfa..4f622c6 100755 --- a/python/gst-input-selector-switch.py +++ b/python/gst-input-selector-switch.py @@ -14,7 +14,7 @@ GObject.threads_init() # The following pipeline works PIPELINE = """ videotestsrc pattern=0 ! selector. -videotestsrc pattern=13 ! selector. +videotestsrc pattern=18 background-color=4294901760 ! selector. input-selector name=selector ! autovideosink """ @@ -43,7 +43,7 @@ class Player: self.pipeline.set_state(Gst.State.NULL) self.loop.quit() - def switch(self): + def on_switch(self): active_pad = self.selector.get_property("active-pad") if active_pad.get_name() == "sink_0": new_pad = self.selector.get_static_pad("sink_1") @@ -76,7 +76,7 @@ def main(): def stdin_cb(source, condition): source.readline() - player.switch() + player.on_switch() return True GObject.io_add_watch(sys.stdin, GObject.IO_IN, stdin_cb)