]> git.parisson.com Git - timeside.git/commitdiff
test with blocksize
authoryomguy <yomguy@parisson.com>
Fri, 18 Mar 2011 17:01:59 +0000 (17:01 +0000)
committeryomguy <yomguy@parisson.com>
Fri, 18 Mar 2011 17:01:59 +0000 (17:01 +0000)
timeside/decoder/core.py

index 66540b01cfdbd206e8f8d0e8dda58e5b695cd3ca..481b9cfe4e6805c63866a58cb367d1d54ffa3aab 100644 (file)
@@ -25,6 +25,7 @@
 from timeside.core import Processor, implements, interfacedoc
 from timeside.api import IDecoder
 from numpy import array, frombuffer, getbuffer, float32
+import Queue
 
 import pygst
 pygst.require('0.10')
@@ -44,7 +45,8 @@ class FileDecoder(Processor):
     audiorate = None
     audionframes = None
     mimetype = ''
-
+    buffer_size = 0x2000
+    
     # IProcessor methods
 
     @staticmethod
@@ -53,9 +55,11 @@ class FileDecoder(Processor):
         return "gstreamerdec"
 
     def setup(self, channels = None, samplerate = None, nframes = None):
+        self.queue = Queue.Queue(self.buffer_size)
+        
         # the output data format we want
         caps = "audio/x-raw-float, width=32"
-        self.pipeline = gst.parse_launch('''uridecodebin uri="%s"
+        self.pipeline = gst.parse_launch('''uridecodebin uri="%s" 
             ! audioconvert
             ! %s
             ! appsink name=sink sync=False ''' % (self.uri, caps))
@@ -63,7 +67,7 @@ class FileDecoder(Processor):
         self.sink = self.pipeline.get_by_name('sink')
         self.sink.set_property('emit-signals', True)
         # adjust length of emitted buffers
-        self.sink.set_property('blocksize', 0x8000)
+        self.sink.set_property('blocksize', 16384)
         # start pipeline
         self.pipeline.set_state(gst.STATE_PLAYING)