Use GLib instead of GObject

Thanks mi!

Fixes bug 5399
This commit is contained in:
Boris Bobrov 2016-07-25 03:39:23 +03:00
parent 1aab84d0dc
commit c12a97b084
2 changed files with 5 additions and 4 deletions

View File

@ -76,6 +76,7 @@ Thank you!
* Matt Lee * Matt Lee
* Matt Molyneaux * Matt Molyneaux
* Meg Ford * Meg Ford
* mi
* Michele Azzolari * Michele Azzolari
* Mike Linksvayer * Mike Linksvayer
* Natalie Foust-Pilcher * Natalie Foust-Pilcher

View File

@ -31,7 +31,7 @@ sys.argv = []
import gi import gi
gi.require_version('Gst', '1.0') gi.require_version('Gst', '1.0')
from gi.repository import GObject, Gst from gi.repository import GLib, Gst
Gst.init(None) Gst.init(None)
# init before import to work around https://bugzilla.gnome.org/show_bug.cgi?id=736260 # init before import to work around https://bugzilla.gnome.org/show_bug.cgi?id=736260
from gi.repository import GstPbutils from gi.repository import GstPbutils
@ -154,7 +154,7 @@ class VideoTranscoder(object):
def __init__(self): def __init__(self):
_log.info('Initializing VideoTranscoder...') _log.info('Initializing VideoTranscoder...')
self.progress_percentage = None self.progress_percentage = None
self.loop = GObject.MainLoop() self.loop = GLib.MainLoop()
def transcode(self, src, dst, **kwargs): def transcode(self, src, dst, **kwargs):
''' '''
@ -371,11 +371,11 @@ class VideoTranscoder(object):
self.pipeline.set_state(Gst.State.NULL) self.pipeline.set_state(Gst.State.NULL)
# This kills the loop, mercifully # This kills the loop, mercifully
GObject.idle_add(self.__stop_mainloop) GLib.idle_add(self.__stop_mainloop)
def __stop_mainloop(self): def __stop_mainloop(self):
''' '''
Wrapper for GObject.MainLoop.quit() Wrapper for GLib.MainLoop.quit()
This wrapper makes us able to see if self.loop.quit has been called This wrapper makes us able to see if self.loop.quit has been called
''' '''