1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 16:08:39 -05:00

RxTx semantic move: renamed SampleFifo to SampleSinkFifo

This commit is contained in:
f4exb 2016-10-06 19:18:02 +02:00
parent 12ac603741
commit 36aeaa3ea5
28 changed files with 86 additions and 76 deletions

View File

@ -114,7 +114,7 @@ set(sdrbase_SOURCES
sdrbase/dsp/nco.cpp
sdrbase/dsp/pidcontroller.cpp
sdrbase/dsp/phaselock.cpp
sdrbase/dsp/samplefifo.cpp
sdrbase/dsp/samplesinkfifo.cpp
sdrbase/dsp/samplesinkfifodoublebuffered.cpp
sdrbase/dsp/basebandsamplesink.cpp
sdrbase/dsp/nullsink.cpp
@ -205,7 +205,7 @@ set(sdrbase_HEADERS
sdrbase/dsp/phasediscri.h
sdrbase/dsp/phaselock.h
sdrbase/dsp/pidcontroller.h
sdrbase/dsp/samplefifo.h
sdrbase/dsp/samplesinkfifo.h
sdrbase/dsp/samplesinkfifodoublebuffered.h
sdrbase/dsp/samplesinkfifodecimator.h
sdrbase/dsp/basebandsamplesink.h

View File

@ -18,11 +18,12 @@
#include <errno.h>
#include "airspythread.h"
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
AirspyThread *AirspyThread::m_this = 0;
AirspyThread::AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QObject* parent) :
AirspyThread::AirspyThread(struct airspy_device* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
m_dev(dev),

View File

@ -21,7 +21,8 @@
#include <QMutex>
#include <QWaitCondition>
#include <libairspy/airspy.h>
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "dsp/decimators.h"
#define AIRSPY_BLOCKSIZE (1<<17)
@ -30,7 +31,7 @@ class AirspyThread : public QThread {
Q_OBJECT
public:
AirspyThread(struct airspy_device* dev, SampleFifo* sampleFifo, QObject* parent = NULL);
AirspyThread(struct airspy_device* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~AirspyThread();
void startWork();
@ -47,7 +48,7 @@ private:
struct airspy_device* m_dev;
qint16 m_buf[2*AIRSPY_BLOCKSIZE];
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
int m_samplerate;
unsigned int m_log2Decim;

View File

@ -16,12 +16,12 @@
#include <stdio.h>
#include <errno.h>
#include "dsp/samplefifo.h"
#include "bladerfthread.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
BladerfThread::BladerfThread(struct bladerf* dev, SampleFifo* sampleFifo, QObject* parent) :
BladerfThread::BladerfThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
m_dev(dev),

View File

@ -21,7 +21,7 @@
#include <QMutex>
#include <QWaitCondition>
#include <libbladeRF.h>
#include "dsp/samplefifo.h"
#include "dsp/samplesinkfifo.h"
//#include "dsp/inthalfbandfilter.h"
#include "dsp/decimators.h"
@ -31,7 +31,7 @@ class BladerfThread : public QThread {
Q_OBJECT
public:
BladerfThread(struct bladerf* dev, SampleFifo* sampleFifo, QObject* parent = NULL);
BladerfThread(struct bladerf* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~BladerfThread();
void startWork();
@ -48,7 +48,7 @@ private:
struct bladerf* m_dev;
qint16 m_buf[2*BLADERF_BLOCKSIZE];
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
int m_samplerate;
unsigned int m_log2Decim;

View File

@ -18,11 +18,12 @@
#include <QDebug>
#include <stdio.h>
#include <errno.h>
#include "dsp/samplefifo.h"
#include "fcdprothread.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "fcdtraits.h"
FCDProThread::FCDProThread(SampleFifo* sampleFifo, QObject* parent) :
FCDProThread::FCDProThread(SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
fcd_handle(NULL),
m_running(false),

View File

@ -20,15 +20,15 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include "dsp/samplefifo.h"
#include "dsp/inthalfbandfilter.h"
#include <alsa/asoundlib.h>
#include "../../../sdrbase/dsp/samplesinkfifo.h"
class FCDProThread : public QThread {
Q_OBJECT
public:
FCDProThread(SampleFifo* sampleFifo, QObject* parent = NULL);
FCDProThread(SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~FCDProThread();
void startWork();
@ -44,7 +44,7 @@ private:
bool m_running;
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
void run();
int work(int n_items);

View File

@ -24,11 +24,12 @@
#include <stdio.h>
#include <errno.h>
#include "dsp/samplefifo.h"
#include "fcdproplusreader.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "fcdtraits.h"
FCDProPlusReader::FCDProPlusReader(SampleFifo* sampleFifo, QObject* parent) :
FCDProPlusReader::FCDProPlusReader(SampleSinkFifo* sampleFifo, QObject* parent) :
QObject(parent),
m_fcdAudioInput(0),
m_fcdInput(0),

View File

@ -22,7 +22,7 @@
#include <QWaitCondition>
#include <QByteArray>
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "dsp/inthalfbandfilter.h"
class QAudioInput;
@ -33,7 +33,7 @@ class FCDProPlusReader : public QObject {
Q_OBJECT
public:
FCDProPlusReader(SampleFifo* sampleFifo, QObject* parent = NULL);
FCDProPlusReader(SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~FCDProPlusReader();
void startWork();
@ -49,7 +49,7 @@ private:
SampleVector m_convertBuffer;
QByteArray m_fcdBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
void openFcdAudio(const QAudioDeviceInfo& fcdAudioDeviceInfo);

View File

@ -18,11 +18,12 @@
#include <QDebug>
#include <stdio.h>
#include <errno.h>
#include "dsp/samplefifo.h"
#include "fcdproplusthread.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "fcdtraits.h"
FCDProPlusThread::FCDProPlusThread(SampleFifo* sampleFifo, QObject* parent) :
FCDProPlusThread::FCDProPlusThread(SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
fcd_handle(NULL),
m_running(false),

View File

@ -21,15 +21,15 @@
#include <QThread>
#include <QMutex>
#include <QWaitCondition>
#include "dsp/samplefifo.h"
#include "dsp/inthalfbandfilter.h"
#include <alsa/asoundlib.h>
#include "../../../sdrbase/dsp/samplesinkfifo.h"
class FCDProPlusThread : public QThread {
Q_OBJECT
public:
FCDProPlusThread(SampleFifo* sampleFifo, QObject* parent = NULL);
FCDProPlusThread(SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~FCDProPlusThread();
void startWork();
@ -45,7 +45,7 @@ private:
bool m_running;
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
void run();
int work(int n_items);

View File

@ -17,12 +17,12 @@
#include <stdio.h>
#include <errno.h>
#include <assert.h>
#include "dsp/samplefifo.h"
#include <QDebug>
#include "filesourcethread.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
FileSourceThread::FileSourceThread(std::ifstream *samplesStream, SampleFifo* sampleFifo, QObject* parent) :
FileSourceThread::FileSourceThread(std::ifstream *samplesStream, SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
m_ifstream(samplesStream),

View File

@ -25,7 +25,8 @@
#include <iostream>
#include <fstream>
#include <cstdlib>
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "dsp/inthalfbandfilter.h"
#define FILESOURCE_THROTTLE_MS 50
@ -34,7 +35,7 @@ class FileSourceThread : public QThread {
Q_OBJECT
public:
FileSourceThread(std::ifstream *samplesStream, SampleFifo* sampleFifo, QObject* parent = NULL);
FileSourceThread(std::ifstream *samplesStream, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~FileSourceThread();
void startWork();
@ -56,7 +57,7 @@ private:
quint8 *m_buf;
std::size_t m_bufsize;
std::size_t m_chunksize;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
std::size_t m_samplesCount;
int m_samplerate;

View File

@ -17,12 +17,12 @@
#include <stdio.h>
#include <errno.h>
#include "dsp/samplefifo.h"
#include "hackrfthread.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
HackRFThread *HackRFThread::m_this = 0;
HackRFThread::HackRFThread(hackrf_device* dev, SampleFifo* sampleFifo, QObject* parent) :
HackRFThread::HackRFThread(hackrf_device* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
m_dev(dev),

View File

@ -21,7 +21,8 @@
#include <QMutex>
#include <QWaitCondition>
#include <libhackrf/hackrf.h>
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "dsp/decimators.h"
#define HACKRF_BLOCKSIZE (1<<17)
@ -30,7 +31,7 @@ class HackRFThread : public QThread {
Q_OBJECT
public:
HackRFThread(hackrf_device* dev, SampleFifo* sampleFifo, QObject* parent = NULL);
HackRFThread(hackrf_device* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~HackRFThread();
void startWork();
@ -47,7 +48,7 @@ private:
hackrf_device* m_dev;
qint16 m_buf[2*HACKRF_BLOCKSIZE];
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
int m_samplerate;
unsigned int m_log2Decim;

View File

@ -18,11 +18,12 @@
#include <stdio.h>
#include <errno.h>
#include "rtlsdrthread.h"
#include "dsp/samplefifo.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#define FCD_BLOCKSIZE 16384
RTLSDRThread::RTLSDRThread(rtlsdr_dev_t* dev, SampleFifo* sampleFifo, QObject* parent) :
RTLSDRThread::RTLSDRThread(rtlsdr_dev_t* dev, SampleSinkFifo* sampleFifo, QObject* parent) :
QThread(parent),
m_running(false),
m_dev(dev),

View File

@ -22,15 +22,15 @@
#include <QMutex>
#include <QWaitCondition>
#include <rtl-sdr.h>
#include "dsp/samplefifo.h"
//#include "dsp/inthalfbandfilter.h"
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "dsp/decimators.h"
class RTLSDRThread : public QThread {
Q_OBJECT
public:
RTLSDRThread(rtlsdr_dev_t* dev, SampleFifo* sampleFifo, QObject* parent = NULL);
RTLSDRThread(rtlsdr_dev_t* dev, SampleSinkFifo* sampleFifo, QObject* parent = NULL);
~RTLSDRThread();
void startWork();
@ -46,7 +46,7 @@ private:
rtlsdr_dev_t* m_dev;
SampleVector m_convertBuffer;
SampleFifo* m_sampleFifo;
SampleSinkFifo* m_sampleFifo;
int m_samplerate;
unsigned int m_log2Decim;

View File

@ -21,8 +21,8 @@
#include <cstring>
#include <cstddef>
#include <lz4.h>
#include "../../../sdrbase/dsp/samplesinkfifo.h"
#include "util/CRC64.h"
#include "dsp/samplefifo.h"
class SDRdaemonBufferOld
{

View File

@ -25,7 +25,7 @@
#include "sdrdaemonudphandler.h"
#include "sdrdaemoninput.h"
SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *devieAPI) :
SDRdaemonUDPHandler::SDRdaemonUDPHandler(SampleSinkFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *devieAPI) :
m_deviceAPI(devieAPI),
m_sdrDaemonBuffer(m_rateDivider),
m_dataSocket(0),

View File

@ -27,7 +27,7 @@
#define SDRDAEMON_THROTTLE_MS 50
class SampleFifo;
class SampleSinkFifo;
class MessageQueue;
class QTimer;
class DeviceAPI;
@ -36,7 +36,7 @@ class SDRdaemonUDPHandler : public QObject
{
Q_OBJECT
public:
SDRdaemonUDPHandler(SampleFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *deviceAPI);
SDRdaemonUDPHandler(SampleSinkFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *deviceAPI);
~SDRdaemonUDPHandler();
void connectTimer(const QTimer* timer);
void start();
@ -59,7 +59,7 @@ private:
bool m_dataConnected;
char *m_udpBuf;
qint64 m_udpReadBytes;
SampleFifo *m_sampleFifo;
SampleSinkFifo *m_sampleFifo;
uint32_t m_samplerate;
uint32_t m_centerFrequency;
uint32_t m_tv_sec;

View File

@ -25,7 +25,7 @@
#include "sdrdaemonfecinput.h"
#include "sdrdaemonfecudphandler.h"
SDRdaemonFECUDPHandler::SDRdaemonFECUDPHandler(SampleFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *devieAPI) :
SDRdaemonFECUDPHandler::SDRdaemonFECUDPHandler(SampleSinkFifo *sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *devieAPI) :
m_deviceAPI(devieAPI),
m_sdrDaemonBuffer(m_rateDivider),
m_dataSocket(0),

View File

@ -27,7 +27,7 @@
#define SDRDAEMONFEC_THROTTLE_MS 50
class SampleFifo;
class SampleSinkFifo;
class MessageQueue;
class QTimer;
class DeviceAPI;
@ -36,7 +36,7 @@ class SDRdaemonFECUDPHandler : public QObject
{
Q_OBJECT
public:
SDRdaemonFECUDPHandler(SampleFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *deviceAPI);
SDRdaemonFECUDPHandler(SampleSinkFifo* sampleFifo, MessageQueue *outputMessageQueueToGUI, DeviceAPI *deviceAPI);
~SDRdaemonFECUDPHandler();
void connectTimer(const QTimer* timer);
void start();
@ -57,7 +57,7 @@ private:
bool m_dataConnected;
char *m_udpBuf;
qint64 m_udpReadBytes;
SampleFifo *m_sampleFifo;
SampleSinkFifo *m_sampleFifo;
uint32_t m_samplerate;
uint32_t m_centerFrequency;
uint32_t m_tv_sec;

View File

@ -19,7 +19,8 @@
#define INCLUDE_SAMPLESOURCE_H
#include <QtGlobal>
#include "dsp/samplefifo.h"
#include "samplesinkfifo.h"
#include "util/message.h"
#include "util/messagequeue.h"
#include "util/export.h"
@ -42,13 +43,13 @@ public:
MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
MessageQueue *getOutputMessageQueueToGUI() { return &m_outputMessageQueueToGUI; }
SampleFifo* getSampleFifo() { return &m_sampleFifo; }
SampleSinkFifo* getSampleFifo() { return &m_sampleFifo; }
protected slots:
void handleInputMessages();
protected:
SampleFifo m_sampleFifo;
SampleSinkFifo m_sampleFifo;
MessageQueue m_inputMessageQueue; //!< Input queue to the source
MessageQueue m_outputMessageQueueToGUI; //!< Output queue specialized for the source GUI
};

View File

@ -22,8 +22,8 @@
#include <dsp/downchannelizer.h>
#include <stdio.h>
#include <QDebug>
#include "dsp/samplefifo.h"
#include "dsp/dspcommands.h"
#include "samplesinkfifo.h"
#include "threadedbasebandsamplesink.h"
DSPDeviceSourceEngine::DSPDeviceSourceEngine(uint uid, QObject* parent) :
@ -242,7 +242,7 @@ void DSPDeviceSourceEngine::imbalance(SampleVector::iterator begin, SampleVector
void DSPDeviceSourceEngine::work()
{
SampleFifo* sampleFifo = m_deviceSampleSource->getSampleFifo();
SampleSinkFifo* sampleFifo = m_deviceSampleSource->getSampleFifo();
std::size_t samplesDone = 0;
bool positiveOnly = false;

View File

@ -15,11 +15,11 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#include "dsp/samplefifo.h"
#include "samplesinkfifo.h"
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
void SampleFifo::create(uint s)
void SampleSinkFifo::create(uint s)
{
m_size = 0;
m_fill = 0;
@ -33,7 +33,7 @@ void SampleFifo::create(uint s)
qCritical("SampleFifo: out of memory");
}
SampleFifo::SampleFifo(QObject* parent) :
SampleSinkFifo::SampleSinkFifo(QObject* parent) :
QObject(parent),
m_data()
{
@ -44,7 +44,7 @@ SampleFifo::SampleFifo(QObject* parent) :
m_tail = 0;
}
SampleFifo::SampleFifo(int size, QObject* parent) :
SampleSinkFifo::SampleSinkFifo(int size, QObject* parent) :
QObject(parent),
m_data()
{
@ -53,21 +53,21 @@ SampleFifo::SampleFifo(int size, QObject* parent) :
create(size);
}
SampleFifo::~SampleFifo()
SampleSinkFifo::~SampleSinkFifo()
{
QMutexLocker mutexLocker(&m_mutex);
m_size = 0;
}
bool SampleFifo::setSize(int size)
bool SampleSinkFifo::setSize(int size)
{
create(size);
return m_data.size() == (uint)size;
}
uint SampleFifo::write(const quint8* data, uint count)
uint SampleSinkFifo::write(const quint8* data, uint count)
{
QMutexLocker mutexLocker(&m_mutex);
uint total;
@ -110,7 +110,7 @@ uint SampleFifo::write(const quint8* data, uint count)
return total;
}
uint SampleFifo::write(SampleVector::const_iterator begin, SampleVector::const_iterator end)
uint SampleSinkFifo::write(SampleVector::const_iterator begin, SampleVector::const_iterator end)
{
QMutexLocker mutexLocker(&m_mutex);
uint count = end - begin;
@ -152,7 +152,7 @@ uint SampleFifo::write(SampleVector::const_iterator begin, SampleVector::const_i
return total;
}
uint SampleFifo::read(SampleVector::iterator begin, SampleVector::iterator end)
uint SampleSinkFifo::read(SampleVector::iterator begin, SampleVector::iterator end)
{
QMutexLocker mutexLocker(&m_mutex);
uint count = end - begin;
@ -178,7 +178,7 @@ uint SampleFifo::read(SampleVector::iterator begin, SampleVector::iterator end)
return total;
}
uint SampleFifo::readBegin(uint count,
uint SampleSinkFifo::readBegin(uint count,
SampleVector::iterator* part1Begin, SampleVector::iterator* part1End,
SampleVector::iterator* part2Begin, SampleVector::iterator* part2End)
{
@ -216,7 +216,7 @@ uint SampleFifo::readBegin(uint count,
return total;
}
uint SampleFifo::readCommit(uint count)
uint SampleSinkFifo::readCommit(uint count)
{
QMutexLocker mutexLocker(&m_mutex);

View File

@ -24,7 +24,7 @@
#include "dsp/dsptypes.h"
#include "util/export.h"
class SDRANGEL_API SampleFifo : public QObject {
class SDRANGEL_API SampleSinkFifo : public QObject {
Q_OBJECT
private:
@ -42,9 +42,9 @@ private:
void create(uint s);
public:
SampleFifo(QObject* parent = NULL);
SampleFifo(int size, QObject* parent = NULL);
~SampleFifo();
SampleSinkFifo(QObject* parent = NULL);
SampleSinkFifo(int size, QObject* parent = NULL);
~SampleSinkFifo();
bool setSize(int size);
inline uint size() const { return m_size; }

View File

@ -20,7 +20,8 @@
#include <dsp/basebandsamplesink.h>
#include <QMutex>
#include "dsp/samplefifo.h"
#include "samplesinkfifo.h"
#include "util/messagequeue.h"
#include "util/export.h"
@ -40,7 +41,7 @@ public:
void writeToFifo(SampleVector::const_iterator& begin, SampleVector::const_iterator& end);
BasebandSampleSink* m_sampleSink;
SampleFifo m_sampleFifo;
SampleSinkFifo m_sampleFifo;
public slots:
void handleFifoData();

View File

@ -55,7 +55,7 @@ SOURCES += mainwindow.cpp\
dsp/nco.cpp\
dsp/pidcontroller.cpp\
dsp/phaselock.cpp\
dsp/samplefifo.cpp\
dsp/samplesinkfifo.cpp\
dsp/samplesinkfifodoublebuffered.cpp\
dsp/basebandsamplesink.cpp\
dsp/nullsink.cpp\
@ -136,7 +136,7 @@ HEADERS += mainwindow.h\
dsp/phasediscri.h\
dsp/phaselock.h\
dsp/pidcontroller.h\
dsp/samplefifo.h\
dsp/samplesinkfifo.h\
dsp/samplesinkfifodoublebuffered.h\
dsp/samplesinkfifodecimator.h\
dsp/basebandsamplesink.h\