1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 10:05:46 -05:00

Plugins: RTP cleanup

This commit is contained in:
f4exb 2018-03-27 09:20:23 +02:00
parent ebf3b1fc4b
commit d67c3adeb4
24 changed files with 4 additions and 220 deletions

View File

@ -87,11 +87,6 @@ AMDemod::~AMDemod()
delete m_channelizer;
}
bool AMDemod::isAudioNetSinkRTPCapable() const
{
return m_audioNetSink && m_audioNetSink->isRTPCapable();
}
void AMDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst __attribute__((unused)))
{
Complex ci;

View File

@ -129,8 +129,6 @@ public:
m_magsqCount = 0;
}
bool isAudioNetSinkRTPCapable() const;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -103,11 +103,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;
@ -436,7 +431,6 @@ void NFMDemod::applySettings(const NFMDemodSettings& settings, bool force)
<< " m_ctcssOn: " << settings.m_ctcssOn
<< " m_audioMute: " << settings.m_audioMute
<< " m_copyAudioToUDP: " << settings.m_copyAudioToUDP
<< " m_copyAudioUseRTP: " << settings.m_copyAudioUseRTP
<< " m_udpAddress: " << settings.m_udpAddress
<< " m_udpPort: " << settings.m_udpPort
<< " force: " << force;
@ -501,26 +495,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;
}
@ -580,9 +554,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();
}
@ -662,7 +633,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);

View File

@ -163,8 +163,6 @@ public:
m_magsqCount = 0;
}
bool isAudioNetSinkRTPCapable() const;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -210,12 +210,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,10 +314,6 @@ NFMDemodGUI::NFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
QChar delta = QChar(0x94, 0x03);
ui->deltaSquelch->setText(delta);
if (!m_nfmDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->hide();
}
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
displaySettings();
@ -402,10 +392,6 @@ void NFMDemodGUI::displaySettings()
ui->ctcss->setCurrentIndex(m_settings.m_ctcssIndex);
if (m_nfmDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP);
}
blockApplySettings(false);
}

View File

@ -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();

View File

@ -53,16 +53,7 @@
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>2</number>
</property>
<item>
@ -611,16 +602,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useRTP">
<property name="toolTip">
<string>Use RTP protocol for audio copy to UDP</string>
</property>
<property name="text">
<string>R</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>

View File

@ -51,7 +51,6 @@ void NFMDemodSettings::resetToDefaults()
m_ctcssIndex = 0;
m_audioSampleRate = DSPEngine::instance()->getDefaultAudioSampleRate();
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;
}

View File

@ -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;

View File

@ -113,11 +113,6 @@ SSBDemod::~SSBDemod()
delete m_channelizer;
}
bool SSBDemod::isAudioNetSinkRTPCapable() const
{
return m_audioNetSink && m_audioNetSink->isRTPCapable();
}
void SSBDemod::configure(MessageQueue* messageQueue,
Real Bandwidth,
Real LowCutoff,
@ -396,7 +391,6 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
<< " m_dsb: " << settings.m_dsb
<< " m_audioMute: " << settings.m_audioMute
<< " m_copyAudioToUDP: " << settings.m_copyAudioToUDP
<< " m_copyAudioUseRTP: " << settings.m_copyAudioUseRTP
<< " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2
@ -496,26 +490,6 @@ void SSBDemod::applySettings(const SSBDemodSettings& settings, bool force)
m_audioNetSink->setDestination(settings.m_udpAddress, settings.m_udpPort);
}
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_spanLog2 = settings.m_spanLog2;
m_audioBinaual = settings.m_audioBinaural;
m_audioFlipChannels = settings.m_audioFlipChannels;

View File

@ -134,8 +134,6 @@ public:
m_magsqCount = 0;
}
bool isAudioNetSinkRTPCapable() const;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -203,12 +203,6 @@ void SSBDemodGUI::on_copyAudioToUDP_toggled(bool checked)
applySettings();
}
void SSBDemodGUI::on_useRTP_toggled(bool checked)
{
m_settings.m_copyAudioUseRTP = checked;
applySettings();
}
void SSBDemodGUI::onMenuDialogCalled(const QPoint &p)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
@ -288,9 +282,6 @@ SSBDemodGUI::SSBDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this);
if (!m_ssbDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->hide();
}
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
@ -523,10 +514,6 @@ void SSBDemodGUI::displaySettings()
ui->agcThresholdGateText->setText(s);
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
if (m_ssbDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP);
}
blockApplySettings(false);
}

View File

@ -96,7 +96,6 @@ private slots:
void on_spanLog2_valueChanged(int value);
void on_flipSidebands_clicked(bool checked);
void on_copyAudioToUDP_toggled(bool copy);
void on_useRTP_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void tick();

View File

@ -53,16 +53,7 @@
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>2</number>
</property>
<item>
@ -873,16 +864,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useRTP">
<property name="toolTip">
<string>Use RTP protocol for audio copy to UDP</string>
</property>
<property name="text">
<string>R</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioMute">
<property name="toolTip">
@ -921,16 +902,7 @@
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>3</number>
</property>
<property name="topMargin">
<number>3</number>
</property>
<property name="rightMargin">
<number>3</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>3</number>
</property>
<item>

View File

@ -45,7 +45,6 @@ void SSBDemodSettings::resetToDefaults()
m_agc = false;
m_agcClamping = false;
m_copyAudioToUDP = false;
m_copyAudioUseRTP = false;
m_agcPowerThreshold = -40;
m_agcThresholdGate = 4;
m_agcTimeLog2 = 7;
@ -84,7 +83,6 @@ QByteArray SSBDemodSettings::serialize() const
s.writeS32(14, m_agcThresholdGate);
s.writeBool(15, m_agcClamping);
s.writeString(16, m_title);
s.writeBool(17, m_copyAudioUseRTP);
return s.final();
}
@ -129,7 +127,6 @@ bool SSBDemodSettings::deserialize(const QByteArray& data)
d.readS32(14, &m_agcThresholdGate, 4);
d.readBool(15, &m_agcClamping, false);
d.readString(16, &m_title, "SSB Demodulator");
d.readBool(17, &m_copyAudioUseRTP, false);
return true;
}

View File

@ -34,7 +34,6 @@ struct SSBDemodSettings
bool m_dsb;
bool m_audioMute;
bool m_copyAudioToUDP;
bool m_copyAudioUseRTP;
bool m_agc;
bool m_agcClamping;
int m_agcTimeLog2;

View File

@ -88,11 +88,6 @@ WFMDemod::~WFMDemod()
delete m_channelizer;
}
bool WFMDemod::isAudioNetSinkRTPCapable() const
{
return m_audioNetSink && m_audioNetSink->isRTPCapable();
}
void WFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool firstOfBurst __attribute__((unused)))
{
Complex ci;
@ -334,26 +329,6 @@ void WFMDemod::applySettings(const WFMDemodSettings& settings, bool force)
m_audioNetSink->setDestination(settings.m_udpAddress, settings.m_udpPort);
}
if ((settings.m_copyAudioUseRTP != m_settings.m_copyAudioUseRTP) || force)
{
if (settings.m_copyAudioUseRTP)
{
if (m_audioNetSink->selectType(AudioNetSink::SinkRTP)) {
qDebug("WFMDemod::applySettings: set audio sink to RTP mode");
} else {
qWarning("WFMDemod::applySettings: RTP support for audio sink not available. Fall back too UDP");
}
}
else
{
if (m_audioNetSink->selectType(AudioNetSink::SinkUDP)) {
qDebug("WFMDemod::applySettings: set audio sink to UDP mode");
} else {
qWarning("WFMDemod::applySettings: failed to set audio sink to UDP mode");
}
}
}
m_settings = settings;
}

View File

@ -119,8 +119,6 @@ public:
m_magsqCount = 0;
}
bool isAudioNetSinkRTPCapable() const;
static const QString m_channelIdURI;
static const QString m_channelId;

View File

@ -137,12 +137,6 @@ void WFMDemodGUI::on_copyAudioToUDP_toggled(bool checked)
applySettings();
}
void WFMDemodGUI::on_useRTP_toggled(bool checked)
{
m_settings.m_copyAudioUseRTP = checked;
applySettings();
}
void WFMDemodGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
{
}
@ -213,10 +207,6 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
m_deviceUISet->addChannelMarker(&m_channelMarker);
m_deviceUISet->addRollupWidget(this);
if (!m_wfmDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->hide();
}
connect(&m_channelMarker, SIGNAL(changedByCursor()), this, SLOT(channelMarkerChangedByCursor()));
connect(&m_channelMarker, SIGNAL(highlightedByCursor()), this, SLOT(channelMarkerHighlightedByCursor()));
@ -279,10 +269,6 @@ void WFMDemodGUI::displaySettings()
ui->squelch->setValue(m_settings.m_squelch);
ui->squelchText->setText(QString("%1 dB").arg(m_settings.m_squelch));
if (m_wfmDemod->isAudioNetSinkRTPCapable()) {
ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP);
}
blockApplySettings(false);
}

View File

@ -81,7 +81,6 @@ private slots:
void on_squelch_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_copyAudioToUDP_toggled(bool copy);
void on_useRTP_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void tick();

View File

@ -59,16 +59,7 @@
<property name="spacing">
<number>3</number>
</property>
<property name="leftMargin">
<number>2</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>2</number>
</property>
<property name="bottomMargin">
<property name="margin">
<number>2</number>
</property>
<item>
@ -384,16 +375,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="useRTP">
<property name="toolTip">
<string>Use RTP protocol for audio copy to UDP</string>
</property>
<property name="text">
<string>R</string>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioMute">
<property name="text">

View File

@ -44,7 +44,6 @@ void WFMDemodSettings::resetToDefaults()
m_audioMute = false;
m_audioSampleRate = DSPEngine::instance()->getDefaultAudioSampleRate();
m_copyAudioToUDP = false;
m_copyAudioUseRTP = false;
m_udpAddress = "127.0.0.1";
m_udpPort = 9999;
m_rgbColor = QColor(0, 0, 255).rgb();

View File

@ -32,7 +32,6 @@ struct WFMDemodSettings
bool m_audioMute;
quint32 m_audioSampleRate;
bool m_copyAudioToUDP;
bool m_copyAudioUseRTP;
QString m_udpAddress;
quint16 m_udpPort;
quint32 m_rgbColor;

View File

@ -37,8 +37,6 @@ NFMDemodSettings:
type: integer
copyAudioToUDP:
type: integer
copyAudioUseRTP:
type: integer
udpAddress:
type: string
udpPort: