from gi.repository import Gst
Gst.init(None)
-from gi.repository import GObject
-GObject.threads_init()
+from gi.repository import GLib
# 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
"""
class Player:
def __init__(self):
- self.loop = GObject.MainLoop()
+ self.loop = GLib.MainLoop()
self.pipeline = Gst.parse_launch(PIPELINE)
self.selector = self.pipeline.get_by_name('selector')
player.on_switch()
return True
- GObject.io_add_watch(sys.stdin, GObject.IO_IN, stdin_cb)
+ GLib.io_add_watch(sys.stdin, GLib.IO_IN, stdin_cb)
print("\nPress Enter to switch the source\n")
player.run()