add "no-inplace" buffers.

When allowing to cross-connect plugin-ports, inplace processing can
no longer be used. We need a complete set of independent input and
output buffers.

Since scratch and silent buffers are used by the various plugin
implementations we cannot re-use them in the PluginInsert.
Besides we need a complete BufferSet which can hold both: ins + outs.
This commit is contained in:
Robin Gareus 2016-03-26 00:40:51 +01:00
parent 6d735dafe2
commit 0954efffd3
6 changed files with 31 additions and 1 deletions

View file

@ -47,6 +47,7 @@ public:
static BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
static BufferSet& get_noinplace_buffers (ChanCount count = ChanCount::ZERO);
static BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
static BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
static gain_t* gain_automation_buffer ();

View file

@ -236,7 +236,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void process (pframes_t nframes);
BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true );
BufferSet& get_noinplace_buffers (ChanCount count = ChanCount::ZERO);
BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);

View file

@ -39,6 +39,7 @@ public:
BufferSet* silent_buffers;
BufferSet* scratch_buffers;
BufferSet* noinplace_buffers;
BufferSet* route_buffers;
BufferSet* mix_buffers;
gain_t* gain_automation_buffer;

View file

@ -116,6 +116,25 @@ ProcessThread::get_scratch_buffers (ChanCount count, bool silence)
return *sb;
}
BufferSet&
ProcessThread::get_noinplace_buffers (ChanCount count)
{
ThreadBuffers* tb = _private_thread_buffers.get();
assert (tb);
BufferSet* sb = tb->noinplace_buffers;
assert (sb);
if (count != ChanCount::ZERO) {
assert(sb->available() >= count);
sb->set_count (count);
} else {
sb->set_count (sb->available());
}
return *sb;
}
BufferSet&
ProcessThread::get_route_buffers (ChanCount count, bool silence)
{

View file

@ -5938,6 +5938,12 @@ Session::get_scratch_buffers (ChanCount count, bool silence)
return ProcessThread::get_scratch_buffers (count, silence);
}
BufferSet&
Session::get_noinplace_buffers (ChanCount count)
{
return ProcessThread::get_noinplace_buffers (count);
}
BufferSet&
Session::get_route_buffers (ChanCount count, bool silence)
{

View file

@ -30,6 +30,7 @@ using namespace std;
ThreadBuffers::ThreadBuffers ()
: silent_buffers (new BufferSet)
, scratch_buffers (new BufferSet)
, noinplace_buffers (new BufferSet)
, route_buffers (new BufferSet)
, mix_buffers (new BufferSet)
, gain_automation_buffer (0)
@ -71,6 +72,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany, size_t custom)
}
scratch_buffers->ensure_buffers (*t, count, size);
noinplace_buffers->ensure_buffers (*t, count + count, size); // in + out
mix_buffers->ensure_buffers (*t, count, size);
silent_buffers->ensure_buffers (*t, count, size);
route_buffers->ensure_buffers (*t, count, size);