Package timeside :: Module api :: Class IProcessor
[hide private]
[frames] | no frames]

Class IProcessor

source code

         object --+    
                  |    
component.Interface --+
                      |
                     IProcessor
Known Subclasses:

Common processor interface

Instance Methods [hide private]
 
setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None)
Allocate internal resources and reset state, so that this processor is ready for a new run.
source code
 
channels(self)
Number of channels in the data returned by process().
source code
 
samplerate(self)
Samplerate of the data returned by process().
source code
 
blocksize()
The total number of frames that this processor can output for each step in the pipeline, or None if the number is unknown.
source code
 
totalframes()
The total number of frames that this processor will output, or None if the number is unknown.
source code
 
process(self, frames=None, eod=False)
Process input frames and return a (output_frames, eod) tuple.
source code
 
post_process(self)
Post-Process data after processign the input frames with process()
source code
 
release(self)
Release resources owned by this processor.
source code
 
mediainfo(self)
Information about the media object uri start duration
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
id()
Short alphanumeric, lower-case string which uniquely identify this processor, suitable for use as an HTTP/GET argument value, in filenames, etc...
source code
 
uuid()
Return the UUID of the processor
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setup(self, channels=None, samplerate=None, blocksize=None, totalframes=None)

source code 

Allocate internal resources and reset state, so that this processor is ready for a new run.

The channels, samplerate and/or blocksize and/or totalframes arguments may be required by processors which accept input. An error will occur if any of these arguments is passed to an output-only processor such as a decoder.

channels(self)

source code 

Number of channels in the data returned by process(). May be different from the number of channels passed to setup()

samplerate(self)

source code 

Samplerate of the data returned by process(). May be different from the samplerate passed to setup()

process(self, frames=None, eod=False)

source code 

Process input frames and return a (output_frames, eod) tuple. Both input and output frames are 2D numpy arrays, where columns are channels, and containing an undetermined number of frames. eod=True means that the end-of-data has been reached.

Output-only processors (such as decoders) will raise an exception if the frames argument is not None. All processors (even encoders) return data, even if that means returning the input unchanged.

Warning: it is required to call setup() before this method.

post_process(self)

source code 

Post-Process data after processign the input frames with process()

Processors such as analyzers will produce Results during the Post-Process

release(self)

source code 

Release resources owned by this processor. The processor cannot be used anymore after calling this method.