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-decoupled-pipelines.py
diff --git
a/python/gst-decoupled-pipelines.py
b/python/gst-decoupled-pipelines.py
index
25a95b7
..
50ff31c
100755
(executable)
--- a/
python/gst-decoupled-pipelines.py
+++ b/
python/gst-decoupled-pipelines.py
@@
-9,8
+9,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
PIPELINE_SRC = """
PIPELINE_SRC = """
@@
-28,7
+27,7
@@
intervideosrc timeout=-1 ! videoconvert ! rotate name=rotate ! videoconvert ! au
class Player:
def __init__(self):
class Player:
def __init__(self):
- self.loop = G
Object
.MainLoop()
+ self.loop = G
Lib
.MainLoop()
self.pipeline_src = Gst.parse_launch(PIPELINE_SRC)
self.pipeline_sink = Gst.parse_launch(PIPELINE_SINK)
self.pipeline_src = Gst.parse_launch(PIPELINE_SRC)
self.pipeline_sink = Gst.parse_launch(PIPELINE_SINK)
@@
-94,8
+93,8
@@
def main():
player.on_rotate()
return True
player.on_rotate()
return True
- G
Object.io_add_watch(sys.stdin, GObject
.IO_IN, stdin_cb)
- G
Object
.timeout_add(100, timeout_cb)
+ G
Lib.io_add_watch(sys.stdin, GLib
.IO_IN, stdin_cb)
+ G
Lib
.timeout_add(100, timeout_cb)
print("\nPress Enter to freeze the video\n")
player.run()
print("\nPress Enter to freeze the video\n")
player.run()