Merge pull request #1433 from trygveaa/fix/gst-init
Fix errors and warnings when importing Gst with gst-python >= 1.5.2
This commit is contained in:
commit
c4da2c240f
@ -7,8 +7,7 @@ import textwrap
|
|||||||
try:
|
try:
|
||||||
import gi
|
import gi
|
||||||
gi.require_version('Gst', '1.0')
|
gi.require_version('Gst', '1.0')
|
||||||
gi.require_version('GstPbutils', '1.0')
|
from gi.repository import GLib, GObject, Gst
|
||||||
from gi.repository import GLib, GObject, Gst, GstPbutils
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print(textwrap.dedent("""
|
print(textwrap.dedent("""
|
||||||
ERROR: A GObject Python package was not found.
|
ERROR: A GObject Python package was not found.
|
||||||
@ -22,7 +21,9 @@ except ImportError:
|
|||||||
"""))
|
"""))
|
||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
Gst.is_initialized() or Gst.init()
|
Gst.init([])
|
||||||
|
gi.require_version('GstPbutils', '1.0')
|
||||||
|
from gi.repository import GstPbutils
|
||||||
|
|
||||||
|
|
||||||
REQUIRED_GST_VERSION = (1, 2, 3)
|
REQUIRED_GST_VERSION = (1, 2, 3)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user