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

Removed copy to UDP/RTP from AudioFifo

This commit is contained in:
f4exb 2018-03-27 09:23:42 +02:00
parent d67c3adeb4
commit d683c90c43
2 changed files with 2 additions and 29 deletions

View File

@ -25,10 +25,7 @@
AudioFifo::AudioFifo() :
m_fifo(0),
m_sampleSize(sizeof(AudioSample)),
//m_udpSink(0),
m_audioNetSink(0),
m_copyToUDP(false)
m_sampleSize(sizeof(AudioSample))
{
m_size = 0;
m_fill = 0;
@ -38,10 +35,7 @@ AudioFifo::AudioFifo() :
AudioFifo::AudioFifo(uint32_t numSamples) :
m_fifo(0),
m_sampleSize(sizeof(AudioSample)),
//m_udpSink(0),
m_audioNetSink(0),
m_copyToUDP(false)
m_sampleSize(sizeof(AudioSample))
{
QMutexLocker mutexLocker(&m_mutex);
@ -218,16 +212,6 @@ uint AudioFifo::read(quint8* data, uint32_t numSamples, int timeout_ms)
copyLen = MIN(copyLen, m_size - m_head);
memcpy(data, m_fifo + (m_head * m_sampleSize), copyLen * m_sampleSize);
if (m_copyToUDP && m_audioNetSink)
{
for (quint8 *p = data; p < data + copyLen* m_sampleSize;)
{
AudioSample *a = (AudioSample *) p;
m_audioNetSink->write((a->l + a->r)/2);
p += m_sampleSize;
}
}
m_head += copyLen;
m_head %= m_size;
m_fill -= copyLen;

View File

@ -24,9 +24,6 @@
#include "dsp/dsptypes.h"
#include "export.h"
//#include "util/udpsink.h"
class AudioNetSink;
class SDRBASE_API AudioFifo : public QObject {
Q_OBJECT
@ -49,10 +46,6 @@ public:
inline bool isFull() const { return m_fill == m_size; }
inline uint32_t size() const { return m_size; }
//void setUDPSink(UDPSink<AudioSample> *udpSink) { m_udpSink = udpSink; }
void setAudioNetSink(AudioNetSink *audioNetSink) { m_audioNetSink = audioNetSink; }
void setCopyToUDP(bool copyToUDP) { m_copyToUDP = copyToUDP; }
private:
QMutex m_mutex;
@ -70,10 +63,6 @@ private:
QWaitCondition m_writeWaitCondition;
QWaitCondition m_readWaitCondition;
//UDPSink<AudioSample> *m_udpSink;
AudioNetSink *m_audioNetSink;
bool m_copyToUDP;
bool create(uint32_t numSamples);
};