From d683c90c43bccdccc6c48d68e53d3cb1e1cdac25 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 27 Mar 2018 09:23:42 +0200 Subject: [PATCH] Removed copy to UDP/RTP from AudioFifo --- sdrbase/audio/audiofifo.cpp | 20 ++------------------ sdrbase/audio/audiofifo.h | 11 ----------- 2 files changed, 2 insertions(+), 29 deletions(-) diff --git a/sdrbase/audio/audiofifo.cpp b/sdrbase/audio/audiofifo.cpp index efd24a9e6..ba9fe589e 100644 --- a/sdrbase/audio/audiofifo.cpp +++ b/sdrbase/audio/audiofifo.cpp @@ -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; diff --git a/sdrbase/audio/audiofifo.h b/sdrbase/audio/audiofifo.h index 22da64b53..defdd3658 100644 --- a/sdrbase/audio/audiofifo.h +++ b/sdrbase/audio/audiofifo.h @@ -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 *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 *m_udpSink; - AudioNetSink *m_audioNetSink; - bool m_copyToUDP; - bool create(uint32_t numSamples); };