]> git.parisson.com Git - timeside.git/commitdiff
timeside/{decoder/core,encoder/coder,tools/gstutils}.py: only import gst when needed
authorPaul Brossier <piem@piem.org>
Sun, 14 Apr 2013 23:20:04 +0000 (18:20 -0500)
committerPaul Brossier <piem@piem.org>
Sun, 14 Apr 2013 23:20:04 +0000 (18:20 -0500)
timeside/decoder/core.py
timeside/encoder/core.py
timeside/tools/gstutils.py

index d4476083c72035f10850f19d08ac37d5e49cd89e..2ddb34955a635521034bb174c345c772ee0cf68a 100644 (file)
@@ -29,6 +29,7 @@ from timeside.api import IDecoder
 from timeside.tools import *
 
 import Queue
+from gst import _gst as gst
 
 GST_APPSINK_MAX_BUFFERS = 10
 QUEUE_SIZE = 10
index 87165e2245843555c5767d6e8207c0fc4c22df21..4a7383b592b77b039f02f85bf166a377fc564586 100644 (file)
@@ -23,6 +23,7 @@ from timeside.core import Processor, implements, interfacedoc
 from timeside.api import IEncoder
 from timeside.tools import *
 
+from gst import _gst as gst
 
 class GstEncoder(Processor):
 
index 2c60a36e658e18e4a962b282271efd31430671be..461b9af2b260ae6ca9f8deb0b1a5d6ea279f18c1 100644 (file)
@@ -2,14 +2,13 @@ from numpy import array, getbuffer, frombuffer
 
 import pygst
 pygst.require('0.10')
-import gst
 import gobject
-
 gobject.threads_init()
 
 def numpy_array_to_gst_buffer(frames):
+    from gst import Buffer
     """ gstreamer buffer to numpy array conversion """
-    buf = gst.Buffer(getbuffer(frames.astype("float32")))
+    buf = Buffer(getbuffer(frames.astype("float32")))
     return buf
 
 def gst_buffer_to_numpy_array(buf, chan):