GStreamer 1.0: Allocate element->h_snglsnr_buffer once instead of resizing
I've run into this in gstreamer_python_upgrade, though it could be fixed in py2.
Currently we set element->h_snglsnr_buffer
based on the size of an incoming buffer in multiratespiir
. If an incoming bufer is larger than the amount we've already allocated, we free and reallocate.
Its pointer is passed into spiirup
, which does its computations and copies the results from device to that pointer. At the end, the entire buffer is copied onto our gstreamer buffer.
We could just allocate a size based on num_exe_samples
(the size of a single buffer), and do multiple copies to the gstreamer buffer (in what I Believe is the rare case that an incoming buffer is larger than one execution size). I've done a quick test, and it doesn't seem to have a significant positive or negative performance impact, but prevent some crazy scenario from consuming all our memory.