projects
/
experiments
/
gstreamer.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
python: update python examples to modern python, Gst, and Glib versions
[experiments/gstreamer.git]
/
python
/
gst-input-selector-switch.py
diff --git
a/python/gst-input-selector-switch.py
b/python/gst-input-selector-switch.py
index
4f622c6
..
db4754e
100755
(executable)
--- a/
python/gst-input-selector-switch.py
+++ b/
python/gst-input-selector-switch.py
@@
-7,8
+7,7
@@
gi.require_version('Gst', '1.0')
from gi.repository import Gst
Gst.init(None)
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
# The following pipeline works
@@
-21,7
+20,7
@@
input-selector name=selector ! autovideosink
class Player:
def __init__(self):
class Player:
def __init__(self):
- self.loop = G
Object
.MainLoop()
+ self.loop = G
Lib
.MainLoop()
self.pipeline = Gst.parse_launch(PIPELINE)
self.selector = self.pipeline.get_by_name('selector')
self.pipeline = Gst.parse_launch(PIPELINE)
self.selector = self.pipeline.get_by_name('selector')
@@
-79,7
+78,7
@@
def main():
player.on_switch()
return True
player.on_switch()
return True
- G
Object.io_add_watch(sys.stdin, GObject
.IO_IN, stdin_cb)
+ G
Lib.io_add_watch(sys.stdin, GLib
.IO_IN, stdin_cb)
print("\nPress Enter to switch the source\n")
player.run()
print("\nPress Enter to switch the source\n")
player.run()