Skip to content
Snippets Groups Projects

Plot horizon distance from ranking statistics

Merged ChiWai Chan requested to merge plot_psd_horizon into master
1 unresolved thread
1 file
+ 7
7
Compare changes
  • Side-by-side
  • Inline
+ 7
7
@@ -42,7 +42,8 @@ import pluggy
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstAudio', '1.0')
from gi.repository import GObject, Gst, GstAudio
gi.require_version('GLib', '2.0')
from gi.repository import Gst, GstAudio, GLib
from lal import LIGOTimeGPS
@@ -73,7 +74,7 @@ MessageType = Gst.MessageType
class Stream:
"""Class for building a GStreamer-based pipeline.
"""
_thread_init = False
_gst_init = False
_has_elements = False
_caps_buffer_map = None
@@ -86,11 +87,10 @@ class Stream:
source=None,
head=None,
):
# initialize threads if not set
if not self._thread_init:
GObject.threads_init()
# initialize GStreamer if needed
if not self._gst_init:
Gst.init(None)
self._thread_init = True
self._gst_init = True
# register elements to stream if needed
if not self._has_elements:
@@ -103,7 +103,7 @@ class Stream:
# set up gstreamer pipeline
self.name = name if name else str(uuid.uuid1())
self.mainloop = mainloop if mainloop else GObject.MainLoop()
self.mainloop = mainloop if mainloop else GLib.MainLoop()
self.pipeline = pipeline if pipeline else Gst.Pipeline(self.name)
self.handler = handler if handler else StreamHandler(self.mainloop, self.pipeline)
self.head = head if head is not None else {}
Loading