mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-15 12:51:49 -05:00
Revert "AM demod: implemented use RTP protocol for audio over UDP"
This reverts commit 9cf57f5aca
.
This commit is contained in:
parent
0d2c0ca117
commit
44552e26ef
@ -57,8 +57,7 @@ AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
|
||||
m_magsq = 0.0;
|
||||
|
||||
DSPEngine::instance()->addAudioSink(&m_audioFifo);
|
||||
m_audioNetSink = new AudioNetSink(this);
|
||||
m_audioNetSink->setDestination(m_settings.m_udpAddress, m_settings.m_udpPort);
|
||||
m_udpBufferAudio = new UDPSink<qint16>(this, m_udpBlockSize, m_settings.m_udpPort);
|
||||
|
||||
m_channelizer = new DownChannelizer(this);
|
||||
m_threadedChannelizer = new ThreadedBasebandSampleSink(m_channelizer, this);
|
||||
@ -72,18 +71,13 @@ AMDemod::AMDemod(DeviceSourceAPI *deviceAPI) :
|
||||
AMDemod::~AMDemod()
|
||||
{
|
||||
DSPEngine::instance()->removeAudioSink(&m_audioFifo);
|
||||
delete m_audioNetSink;
|
||||
delete m_udpBufferAudio;
|
||||
m_deviceAPI->removeChannelAPI(this);
|
||||
m_deviceAPI->removeThreadedSink(m_threadedChannelizer);
|
||||
delete m_threadedChannelizer;
|
||||
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;
|
||||
@ -220,7 +214,6 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
|
||||
<< " m_audioMute: " << settings.m_audioMute
|
||||
<< " m_bandpassEnable: " << settings.m_bandpassEnable
|
||||
<< " m_copyAudioToUDP: " << settings.m_copyAudioToUDP
|
||||
<< " m_copyAudioUseRTP" << settings.m_copyAudioUseRTP
|
||||
<< " m_udpAddress: " << settings.m_udpAddress
|
||||
<< " m_udpPort: " << settings.m_udpPort
|
||||
<< " force: " << force;
|
||||
@ -245,27 +238,8 @@ void AMDemod::applySettings(const AMDemodSettings& settings, bool force)
|
||||
if ((m_settings.m_udpAddress != settings.m_udpAddress)
|
||||
|| (m_settings.m_udpPort != settings.m_udpPort) || 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("AMDemod::applySettings: set audio sink to RTP mode");
|
||||
} else {
|
||||
qWarning("AMDemod::applySettings: RTP support for audio sink not available. Fall back too UDP");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_audioNetSink->selectType(AudioNetSink::SinkUDP)) {
|
||||
qDebug("AMDemod::applySettings: set audio sink to UDP mode");
|
||||
} else {
|
||||
qWarning("AMDemod::applySettings: failed to set audio sink to UDP mode");
|
||||
}
|
||||
}
|
||||
m_udpBufferAudio->setAddress(const_cast<QString&>(settings.m_udpAddress));
|
||||
m_udpBufferAudio->setPort(settings.m_udpPort);
|
||||
}
|
||||
|
||||
m_settings = settings;
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include "dsp/agc.h"
|
||||
#include "dsp/bandpass.h"
|
||||
#include "audio/audiofifo.h"
|
||||
#include "audio/audionetsink.h"
|
||||
#include "util/message.h"
|
||||
#include "amdemodsettings.h"
|
||||
|
||||
@ -114,8 +113,6 @@ public:
|
||||
m_magsqCount = 0;
|
||||
}
|
||||
|
||||
bool isAudioNetSinkRTPCapable() const;
|
||||
|
||||
static const QString m_channelIdURI;
|
||||
static const QString m_channelId;
|
||||
|
||||
@ -153,7 +150,7 @@ private:
|
||||
AudioVector m_audioBuffer;
|
||||
uint32_t m_audioBufferFill;
|
||||
AudioFifo m_audioFifo;
|
||||
AudioNetSink *m_audioNetSink;
|
||||
UDPSink<qint16> *m_udpBufferAudio;
|
||||
|
||||
static const int m_udpBlockSize;
|
||||
|
||||
@ -209,18 +206,14 @@ private:
|
||||
|
||||
Real attack = (m_squelchCount - 0.05f * m_settings.m_audioSampleRate) / (0.05f * m_settings.m_audioSampleRate);
|
||||
sample = demod * attack * 2048 * m_settings.m_volume;
|
||||
if (m_settings.m_copyAudioToUDP) {
|
||||
m_audioNetSink->write(demod * attack * SDR_RX_SCALEF);
|
||||
}
|
||||
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(demod * attack * SDR_RX_SCALEF);
|
||||
|
||||
m_squelchOpen = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
sample = 0;
|
||||
if (m_settings.m_copyAudioToUDP) {
|
||||
m_audioNetSink->write(0);
|
||||
}
|
||||
if (m_settings.m_copyAudioToUDP) m_udpBufferAudio->write(0);
|
||||
m_squelchOpen = false;
|
||||
}
|
||||
|
||||
|
@ -153,12 +153,6 @@ void AMDemodGUI::on_copyAudioToUDP_toggled(bool checked)
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void AMDemodGUI::on_useRTP_toggled(bool checked)
|
||||
{
|
||||
m_settings.m_copyAudioUseRTP = checked;
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void AMDemodGUI::onWidgetRolled(QWidget* widget __attribute__((unused)), bool rollDown __attribute__((unused)))
|
||||
{
|
||||
/*
|
||||
@ -209,7 +203,6 @@ AMDemodGUI::AMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandS
|
||||
ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||
ui->deltaFrequency->setValueRange(false, 7, -9999999, 9999999);
|
||||
ui->channelPowerMeter->setColorTheme(LevelMeterSignalDB::ColorGreenAndBlue);
|
||||
ui->useRTP->setEnabled(m_amDemod->isAudioNetSinkRTPCapable());
|
||||
|
||||
m_channelMarker.blockSignals(true);
|
||||
m_channelMarker.setColor(Qt::yellow);
|
||||
@ -292,10 +285,6 @@ void AMDemodGUI::displaySettings()
|
||||
ui->bandpassEnable->setChecked(m_settings.m_bandpassEnable);
|
||||
ui->copyAudioToUDP->setChecked(m_settings.m_copyAudioToUDP);
|
||||
|
||||
if (m_amDemod->isAudioNetSinkRTPCapable()) {
|
||||
ui->useRTP->setChecked(m_settings.m_copyAudioUseRTP);
|
||||
}
|
||||
|
||||
blockApplySettings(false);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,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();
|
||||
|
@ -199,19 +199,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="useRTP">
|
||||
<property name="toolTip">
|
||||
<string>Use RTP protocol for copy audio to UDP</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>R</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
||||
QString("AM Demodulator"),
|
||||
QString("3.12.0"),
|
||||
QString("3.10.1"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
@ -37,7 +37,6 @@ void AMDemodSettings::resetToDefaults()
|
||||
m_audioMute = false;
|
||||
m_bandpassEnable = false;
|
||||
m_copyAudioToUDP = false;
|
||||
m_copyAudioUseRTP = false;
|
||||
m_udpAddress = "127.0.0.1";
|
||||
m_udpPort = 9999;
|
||||
m_rgbColor = QColor(255, 255, 0).rgb();
|
||||
@ -59,8 +58,6 @@ QByteArray AMDemodSettings::serialize() const
|
||||
s.writeU32(7, m_rgbColor);
|
||||
s.writeBool(8, m_bandpassEnable);
|
||||
s.writeString(9, m_title);
|
||||
s.writeBool(10, m_copyAudioUseRTP);
|
||||
|
||||
return s.final();
|
||||
}
|
||||
|
||||
@ -96,7 +93,6 @@ bool AMDemodSettings::deserialize(const QByteArray& data)
|
||||
d.readU32(7, &m_rgbColor);
|
||||
d.readBool(8, &m_bandpassEnable, false);
|
||||
d.readString(9, &m_title, "AM Demodulator");
|
||||
d.readBool(15, &m_copyAudioUseRTP, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -31,7 +31,6 @@ struct AMDemodSettings
|
||||
bool m_audioMute;
|
||||
bool m_bandpassEnable;
|
||||
bool m_copyAudioToUDP;
|
||||
bool m_copyAudioUseRTP;
|
||||
QString m_udpAddress;
|
||||
quint16 m_udpPort;
|
||||
quint32 m_rgbColor;
|
||||
|
Loading…
Reference in New Issue
Block a user