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-playbin-switch.py
diff --git
a/python/gst-playbin-switch.py
b/python/gst-playbin-switch.py
index
85be7f2
..
0128a94
100755
(executable)
--- a/
python/gst-playbin-switch.py
+++ b/
python/gst-playbin-switch.py
@@
-24,14
+24,13
@@
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
class Player:
def __init__(self):
class Player:
def __init__(self):
- self.loop = G
Object
.MainLoop()
- self.pipeline = Gst.ElementFactory.make("playbin", "player")
+ self.loop = G
Lib
.MainLoop()
+ self.pipeline = Gst.ElementFactory.make("playbin
3
", "player")
files = ["sample_440hz.webm", "sample_880hz.webm"]
self.uris = [Gst.filename_to_uri(f) for f in files]
files = ["sample_440hz.webm", "sample_880hz.webm"]
self.uris = [Gst.filename_to_uri(f) for f in files]
@@
-97,7
+96,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()