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-looping-video-1.py
diff --git
a/python/gst-looping-video-1.py
b/python/gst-looping-video-1.py
index
7d1cc3f
..
7d8bd01
100755
(executable)
--- a/
python/gst-looping-video-1.py
+++ b/
python/gst-looping-video-1.py
@@
-1,4
+1,4
@@
-#!/usr/bin/env python
+#!/usr/bin/env python
3
#
# A simple looping player.
# Version 1, based on EOS handling.
#
# A simple looping player.
# Version 1, based on EOS handling.
@@
-13,8
+13,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
class Player:
class Player:
@@
-29,7
+28,7
@@
class Player:
def run(self):
self._player.set_state(Gst.State.PLAYING)
def run(self):
self._player.set_state(Gst.State.PLAYING)
- self.loop = G
Object
.MainLoop()
+ self.loop = G
Lib
.MainLoop()
self.loop.run()
def quit(self):
self.loop.run()
def quit(self):
@@
-42,7
+41,7
@@
class Player:
def on_error(self, bus, msg):
(err, debug) = msg.parse_error()
def on_error(self, bus, msg):
(err, debug) = msg.parse_error()
- print
"Error: %s" % err, debug
+ print
("Error: %s" % err, debug)
self.quit()
self.quit()