-add feeding buffer for PocSAC-decoder

git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@409 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2019-01-11 17:13:28 +00:00
parent f84d381603
commit 9ae1cbddbc
2 changed files with 14 additions and 1 deletions
+12 -1
View File
@@ -48,6 +48,7 @@ preamble_sync_impl::preamble_sync_impl()
, m_wordCount(0)
, m_wordSize(1)
, m_dataCount(0)
, bufferWi(0)
{
}
@@ -203,8 +204,18 @@ int preamble_sync_impl::general_work (int noutput_items, gr_vector_int &ninput_i
// each input stream.
consume_each (i);
memcpy(&buffer[bufferWi], out, j);
bufferWi += j;
if (bufferWi >= sizeof(buffer)/2)
{
size_t numProcessed = dec.process(buffer, bufferWi);
bufferWi -= numProcessed;
memcpy(buffer, &buffer[numProcessed], bufferWi);
}
// Tell runtime system how many output items we produced.
dec.process(out, j);
return j;
}