1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-13 11:18:48 -04:00

Use a simplified version of sample FIFO (sample vector) in the threaded baseband sample sink

This commit is contained in:
f4exb
2019-08-24 04:54:07 +02:00
parent ac8a73c529
commit ae07fba863
5 changed files with 116 additions and 2 deletions
+16 -2
View File
@@ -8,7 +8,8 @@
ThreadedBasebandSampleSinkFifo::ThreadedBasebandSampleSinkFifo(BasebandSampleSink *sampleSink, std::size_t size) :
m_sampleSink(sampleSink)
{
connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleFifoData()));
//connect(&m_sampleFifo, SIGNAL(dataReady()), this, SLOT(handleFifoData()));
connect(&m_sampleVector, SIGNAL(dataReady()), this, SLOT(handleVectorData()));
m_sampleFifo.setSize(size);
}
@@ -19,7 +20,20 @@ ThreadedBasebandSampleSinkFifo::~ThreadedBasebandSampleSinkFifo()
void ThreadedBasebandSampleSinkFifo::writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end)
{
m_sampleFifo.write(begin, end);
//m_sampleFifo.write(begin, end);
m_sampleVector.write(begin, end);
}
void ThreadedBasebandSampleSinkFifo::handleVectorData()
{
SampleVector::const_iterator vbegin;
SampleVector::const_iterator vend;
if (m_sampleSink)
{
m_sampleVector.read(vbegin, vend);
m_sampleSink->feed(vbegin, vend, false);
}
}
void ThreadedBasebandSampleSinkFifo::handleFifoData() // FIXME: Fixed? Move it to the new threadable sink class