raise
-Gst.init(None)
+Gst.init_python()
AUDIO_FORMATS = [f.strip() for f in
GstAudio.AUDIO_FORMATS_ALL.strip('{ }').split(',')]
import numpy as np
-Gst.init(None)
+Gst.init_python()
FIXED_CAPS = Gst.Caps.from_string('video/x-raw,format=GRAY8,width=[1,2147483647],height=[1,2147483647]')
class ExampleTransform(GstBase.BaseTransform):
gi.require_version('GstBase', '1.0')
from gi.repository import Gst, GObject, GstBase
-Gst.init(None)
+Gst.init_python()
#
# Simple Identity element created entirely in python
from gi.repository import Gst, GObject, GstBase
-Gst.init(None)
+Gst.init_python()
try:
from PIL import Image
Gst.error('py_audiotestsrc requires numpy')
raise
+Gst.init_python()
+
OCAPS = Gst.Caps.from_string (
'audio/x-raw, format=F32LE, layout=interleaved, rate=44100, channels=2')
# $ gst-launch-1.0 videotestsrc ! pymysink://
from gi.repository import Gst, GObject, GstBase
-Gst.init(None)
+Gst.init_python()
#
# Simple Sink element created entirely in python
deinit_pygst()
return real_deinit()
+def init_python():
+ if not Gst.is_initialized():
+ raise NotInitialized("Gst.init_python should never be called before GStreamer itself is initialized")
+
+ init_pygst()
+
Gst.deinit = deinit
+Gst.init_python = init_python
if not Gst.is_initialized():
deinit_pygst()