X-Git-Url: https://git.ao2.it/experiments/gstreamer.git/blobdiff_plain/bd161b37c12141ed5c311f03a560b5915ec08527..HEAD:/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 --- 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 python3 # # 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 GObject -GObject.threads_init() +from gi.repository import GLib class Player: @@ -29,7 +28,7 @@ class Player: def run(self): self._player.set_state(Gst.State.PLAYING) - self.loop = GObject.MainLoop() + self.loop = GLib.MainLoop() self.loop.run() def quit(self): @@ -42,7 +41,7 @@ class Player: def on_error(self, bus, msg): (err, debug) = msg.parse_error() - print "Error: %s" % err, debug + print("Error: %s" % err, debug) self.quit()