From 69a382a12c5659229ffc80eb99ddca3d1818e2c7 Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 6 Feb 2018 02:01:22 +0100 Subject: [PATCH] Revert "NFM demod: GUI button and setting to use RTP over UDP for copy to audio" This reverts commit 2beba446f3e0e3d072cf42ec95fb10edf6b7ae40. --- plugins/channelrx/demodnfm/nfmdemod.cpp | 35 ++++--------------- plugins/channelrx/demodnfm/nfmdemod.h | 2 -- plugins/channelrx/demodnfm/nfmdemodgui.cpp | 11 ------ plugins/channelrx/demodnfm/nfmdemodgui.h | 1 - plugins/channelrx/demodnfm/nfmdemodgui.ui | 13 ------- .../channelrx/demodnfm/nfmdemodsettings.cpp | 3 -- plugins/channelrx/demodnfm/nfmdemodsettings.h | 1 - sdrbase/audio/audionetsink.cpp | 9 ----- sdrbase/audio/audionetsink.h | 1 - sdrbase/resources/webapi/doc/html2/index.html | 5 +-- .../webapi/doc/swagger/include/NFMDemod.yaml | 2 -- .../api/swagger/include/NFMDemod.yaml | 2 -- swagger/sdrangel/code/html2/index.html | 5 +-- .../code/qt5/client/SWGNFMDemodSettings.cpp | 14 -------- .../code/qt5/client/SWGNFMDemodSettings.h | 4 --- 15 files changed, 8 insertions(+), 100 deletions(-) diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index aee0c751d..3069428c7 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -81,6 +81,12 @@ NFMDemod::NFMDemod(DeviceSourceAPI *devieAPI) : m_audioNetSink = new AudioNetSink(this); m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort); + if (m_audioNetSink->selectType(AudioNetSink::SinkRTP)) { + qDebug("NFMDemod::NFMDemod: set audio sink to RTP mode"); + } else { + qWarning("NFMDemod::NFMDemod: RTP support for audio sink not available. Fall back too UDP"); + } + m_channelizer = new DownChannelizer(this); m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this); m_deviceAPI->addThreadedSink(m_threadedChannelizer); @@ -100,11 +106,6 @@ NFMDemod::~NFMDemod() delete m_channelizer; } -bool NFMDemod::isAudioNetSinkRTPCapable() const -{ - return m_audioNetSink && m_audioNetSink->isRTPCapable(); -} - float arctan2(Real y, Real x) { Real coeff_1 = M_PI / 4; @@ -479,26 +480,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force) setSelectedCtcssIndex(settings.m_ctcssIndex); } - if ((settings.m_copyAudioUseRTP != m_settings.m_copyAudioUseRTP) || force) - { - if (settings.m_copyAudioUseRTP) - { - if (m_audioNetSink->selectType(AudioNetSink::SinkRTP)) { - qDebug("NFMDemod::applySettings: set audio sink to RTP mode"); - } else { - qWarning("NFMDemod::applySettings: RTP support for audio sink not available. Fall back too UDP"); - } - } - else - { - if (m_audioNetSink->selectType(AudioNetSink::SinkUDP)) { - qDebug("NFMDemod::applySettings: set audio sink to UDP mode"); - } else { - qWarning("NFMDemod::applySettings: failed to set audio sink to UDP mode"); - } - } - } - m_settings = settings; } @@ -557,9 +538,6 @@ int NFMDemod::webapiSettingsPutPatch( if (channelSettingsKeys.contains("copyAudioToUDP")) { settings.m_copyAudioToUDP = response.getNfmDemodSettings()->getCopyAudioToUdp() != 0; } - if (channelSettingsKeys.contains("copyAudioUseRTP")) { - settings.m_copyAudioUseRTP = response.getNfmDemodSettings()->getCopyAudioUseRtp() != 0; - } if (channelSettingsKeys.contains("ctcssIndex")) { settings.m_ctcssIndex = response.getNfmDemodSettings()->getCtcssIndex(); } @@ -629,7 +607,6 @@ void NFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getNfmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0); response.getNfmDemodSettings()->setAudioSampleRate(settings.m_audioSampleRate); response.getNfmDemodSettings()->setCopyAudioToUdp(settings.m_copyAudioToUDP ? 1 : 0); - response.getNfmDemodSettings()->setCopyAudioUseRtp(settings.m_copyAudioUseRTP ? 1 : 0); response.getNfmDemodSettings()->setCtcssIndex(settings.m_ctcssIndex); response.getNfmDemodSettings()->setCtcssOn(settings.m_ctcssOn ? 1 : 0); response.getNfmDemodSettings()->setDeltaSquelch(settings.m_deltaSquelch ? 1 : 0); diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index 490481ea0..ac5bfeae7 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -159,8 +159,6 @@ public: m_magsqCount = 0; } - bool isAudioNetSinkRTPCapable() const; - static const QString m_channelIdURI; static const QString m_channelId; diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.cpp b/plugins/channelrx/demodnfm/nfmdemodgui.cpp index 5e209e4ca..a2fad4346 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodgui.cpp @@ -211,12 +211,6 @@ void NFMDemodGUI::on_copyAudioToUDP_toggled(bool checked) applySettings(); } -void NFMDemodGUI::on_useRTP_toggled(bool checked) -{ - m_settings.m_copyAudioUseRTP = checked; - applySettings(); -} - void NFMDemodGUI::on_ctcss_currentIndexChanged(int index) { m_settings.m_ctcssIndex = index; @@ -320,7 +314,6 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban QChar delta = QChar(0x94, 0x03); ui->deltaSquelch->setText(delta); - ui->useRTP->setEnabled(m_nfmDemod->isAudioNetSinkRTPCapable()); connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages())); @@ -400,10 +393,6 @@ void NFMDemodGUI::displaySettings() ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex); - if (m_nfmDemod->isAudioNetSinkRTPCapable()) { - ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP); - } - blockApplySettings(false); } diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.h b/plugins/channelrx/demodnfm/nfmdemodgui.h index 3b4b0e68d..4920c7b54 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.h +++ b/plugins/channelrx/demodnfm/nfmdemodgui.h @@ -79,7 +79,6 @@ private slots: void on_ctcssOn_toggled(bool checked); void on_audioMute_toggled(bool checked); void on_copyAudioToUDP_toggled(bool checked); - void on_useRTP_toggled(bool checked); void onWidgetRolled(QWidget* widget, bool rollDown); void onMenuDialogCalled(const QPoint& p); void handleInputMessages(); diff --git a/plugins/channelrx/demodnfm/nfmdemodgui.ui b/plugins/channelrx/demodnfm/nfmdemodgui.ui index c798abb3f..0abea44fa 100644 --- a/plugins/channelrx/demodnfm/nfmdemodgui.ui +++ b/plugins/channelrx/demodnfm/nfmdemodgui.ui @@ -611,19 +611,6 @@ - - - - Use RTP protocol for sending audio via UDP - - - R - - - true - - - diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp index c1efda589..6699524da 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.cpp +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.cpp @@ -51,7 +51,6 @@ void NFMDemodSettings::resetToDefaults() m_ctcssIndex = 0; m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate(); m_copyAudioToUDP = false; - m_copyAudioUseRTP = false; m_udpAddress = "127.0.0.1"; m_udpPort = 9998; m_rgbColor = QColor(255, 0, 0).rgb(); @@ -78,7 +77,6 @@ QByteArray NFMDemodSettings::serialize() const } s.writeString(14, m_title); - s.writeBool(15, m_copyAudioUseRTP); return s.final(); } @@ -122,7 +120,6 @@ bool NFMDemodSettings::deserialize(const QByteArray& data) d.readS32(11, &m_squelchGate, 5); d.readBool(12, &m_deltaSquelch, false); d.readString(14, &m_title, "NFM Demodulator"); - d.readBool(15, &m_copyAudioUseRTP, false); return true; } diff --git a/plugins/channelrx/demodnfm/nfmdemodsettings.h b/plugins/channelrx/demodnfm/nfmdemodsettings.h index 578f7cdd6..a758edb58 100644 --- a/plugins/channelrx/demodnfm/nfmdemodsettings.h +++ b/plugins/channelrx/demodnfm/nfmdemodsettings.h @@ -40,7 +40,6 @@ struct NFMDemodSettings int m_ctcssIndex; uint32_t m_audioSampleRate; bool m_copyAudioToUDP; - bool m_copyAudioUseRTP; QString m_udpAddress; uint16_t m_udpPort; quint32 m_rgbColor; diff --git a/sdrbase/audio/audionetsink.cpp b/sdrbase/audio/audionetsink.cpp index 042557e3f..76415347d 100644 --- a/sdrbase/audio/audionetsink.cpp +++ b/sdrbase/audio/audionetsink.cpp @@ -56,15 +56,6 @@ AudioNetSink::~AudioNetSink() #endif } -bool AudioNetSink::isRTPCapable() const -{ -#ifdef HAS_JRTPLIB - return true; -#else - return false; -#endif -} - bool AudioNetSink::selectType(SinkType type) { if (type == SinkUDP) diff --git a/sdrbase/audio/audionetsink.h b/sdrbase/audio/audionetsink.h index 08dc27618..d1b1218e0 100644 --- a/sdrbase/audio/audionetsink.h +++ b/sdrbase/audio/audionetsink.h @@ -43,7 +43,6 @@ public: void write(qint16 sample); void write(const AudioSample& sample); - bool isRTPCapable() const; bool selectType(SinkType type); static const int m_udpBlockSize; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index fb2087c12..7879d98fd 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -1371,9 +1371,6 @@ margin-bottom: 20px; "copyAudioToUDP" : { "type" : "integer" }, - "copyAudioUseRTP" : { - "type" : "integer" - }, "udpAddress" : { "type" : "string" }, @@ -16924,7 +16921,7 @@ except ApiException as e:
- Generated 2018-02-05T00:57:57.193+01:00 + Generated 2018-01-25T00:10:31.068+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml index c83d72e4e..e644936fe 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/NFMDemod.yaml @@ -32,8 +32,6 @@ NFMDemodSettings: type: integer copyAudioToUDP: type: integer - copyAudioUseRTP: - type: integer udpAddress: type: string udpPort: diff --git a/swagger/sdrangel/api/swagger/include/NFMDemod.yaml b/swagger/sdrangel/api/swagger/include/NFMDemod.yaml index c83d72e4e..e644936fe 100644 --- a/swagger/sdrangel/api/swagger/include/NFMDemod.yaml +++ b/swagger/sdrangel/api/swagger/include/NFMDemod.yaml @@ -32,8 +32,6 @@ NFMDemodSettings: type: integer copyAudioToUDP: type: integer - copyAudioUseRTP: - type: integer udpAddress: type: string udpPort: diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index fb2087c12..7879d98fd 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -1371,9 +1371,6 @@ margin-bottom: 20px; "copyAudioToUDP" : { "type" : "integer" }, - "copyAudioUseRTP" : { - "type" : "integer" - }, "udpAddress" : { "type" : "string" }, @@ -16924,7 +16921,7 @@ except ApiException as e:
- Generated 2018-02-05T00:57:57.193+01:00 + Generated 2018-01-25T00:10:31.068+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp index d323c99c6..5e1bd88b8 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.cpp @@ -50,7 +50,6 @@ SWGNFMDemodSettings::init() { ctcss_index = 0; audio_sample_rate = 0; copy_audio_to_udp = 0; - copy_audio_use_rtp = 0; udp_address = new QString(""); udp_port = 0; rgb_color = 0; @@ -73,7 +72,6 @@ SWGNFMDemodSettings::cleanup() { - if(udp_address != nullptr) { delete udp_address; } @@ -109,7 +107,6 @@ SWGNFMDemodSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&ctcss_index, pJson["ctcssIndex"], "qint32", ""); ::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", ""); ::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", ""); - ::SWGSDRangel::setValue(©_audio_use_rtp, pJson["copyAudioUseRTP"], "qint32", ""); ::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString"); ::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", ""); ::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", ""); @@ -156,8 +153,6 @@ SWGNFMDemodSettings::asJsonObject() { obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp)); - obj->insert("copyAudioUseRTP", QJsonValue(copy_audio_use_rtp)); - toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString")); obj->insert("udpPort", QJsonValue(udp_port)); @@ -286,15 +281,6 @@ SWGNFMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) { this->copy_audio_to_udp = copy_audio_to_udp; } -qint32 -SWGNFMDemodSettings::getCopyAudioUseRtp() { - return copy_audio_use_rtp; -} -void -SWGNFMDemodSettings::setCopyAudioUseRtp(qint32 copy_audio_use_rtp) { - this->copy_audio_use_rtp = copy_audio_use_rtp; -} - QString* SWGNFMDemodSettings::getUdpAddress() { return udp_address; diff --git a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h index 619bad4c3..d030653e5 100644 --- a/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGNFMDemodSettings.h @@ -81,9 +81,6 @@ public: qint32 getCopyAudioToUdp(); void setCopyAudioToUdp(qint32 copy_audio_to_udp); - qint32 getCopyAudioUseRtp(); - void setCopyAudioUseRtp(qint32 copy_audio_use_rtp); - QString* getUdpAddress(); void setUdpAddress(QString* udp_address); @@ -111,7 +108,6 @@ private: qint32 ctcss_index; qint32 audio_sample_rate; qint32 copy_audio_to_udp; - qint32 copy_audio_use_rtp; QString* udp_address; qint32 udp_port; qint32 rgb_color;