mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
Fixed possible sample device pointer not set yet when DSPMIMOSignalNotification message arrives. Fixes #1529
This commit is contained in:
parent
b387de17bc
commit
12deb59bf4
@ -1186,69 +1186,72 @@ void DSPDeviceMIMOEngine::handleInputMessages()
|
|||||||
(*it)->pushMessage(message);
|
(*it)->pushMessage(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sourceElseSink)
|
if (m_deviceSampleMIMO)
|
||||||
{
|
{
|
||||||
if ((istream < m_deviceSampleMIMO->getNbSourceStreams()))
|
if (sourceElseSink)
|
||||||
{
|
{
|
||||||
|
if ((istream < m_deviceSampleMIMO->getNbSourceStreams()))
|
||||||
// forward source changes to ancillary sinks
|
|
||||||
if (istream < m_basebandSampleSinks.size())
|
|
||||||
{
|
{
|
||||||
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[istream].begin(); it != m_basebandSampleSinks[istream].end(); ++it)
|
|
||||||
|
// forward source changes to ancillary sinks
|
||||||
|
if (istream < m_basebandSampleSinks.size())
|
||||||
{
|
{
|
||||||
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
|
for (BasebandSampleSinks::const_iterator it = m_basebandSampleSinks[istream].begin(); it != m_basebandSampleSinks[istream].end(); ++it)
|
||||||
qDebug() << "DSPDeviceMIMOEngine::handleInputMessages: starting " << (*it)->getSinkName().toStdString().c_str();
|
{
|
||||||
(*it)->pushMessage(message);
|
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
|
||||||
|
qDebug() << "DSPDeviceMIMOEngine::handleInputMessages: starting " << (*it)->getSinkName().toStdString().c_str();
|
||||||
|
(*it)->pushMessage(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// forward changes to MIMO GUI input queue
|
// forward changes to MIMO GUI input queue
|
||||||
MessageQueue *guiMessageQueue = m_deviceSampleMIMO->getMessageQueueToGUI();
|
MessageQueue *guiMessageQueue = m_deviceSampleMIMO->getMessageQueueToGUI();
|
||||||
qDebug("DeviceMIMOEngine::handleInputMessages: DSPMIMOSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
qDebug("DeviceMIMOEngine::handleInputMessages: DSPMIMOSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
||||||
|
|
||||||
if (guiMessageQueue) {
|
if (guiMessageQueue) {
|
||||||
DSPMIMOSignalNotification* rep = new DSPMIMOSignalNotification(*notif); // make a copy for the MIMO GUI
|
DSPMIMOSignalNotification* rep = new DSPMIMOSignalNotification(*notif); // make a copy for the MIMO GUI
|
||||||
guiMessageQueue->push(rep);
|
guiMessageQueue->push(rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
// forward changes to spectrum sink if currently active
|
// forward changes to spectrum sink if currently active
|
||||||
if (m_spectrumSink && m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
if (m_spectrumSink && m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
||||||
{
|
{
|
||||||
DSPSignalNotification *spectrumNotif = new DSPSignalNotification(sampleRate, centerFrequency);
|
DSPSignalNotification *spectrumNotif = new DSPSignalNotification(sampleRate, centerFrequency);
|
||||||
m_spectrumSink->pushMessage(spectrumNotif);
|
m_spectrumSink->pushMessage(spectrumNotif);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((istream < m_deviceSampleMIMO->getNbSinkStreams()))
|
|
||||||
{
|
{
|
||||||
|
if ((istream < m_deviceSampleMIMO->getNbSinkStreams()))
|
||||||
// forward source changes to channel sources with immediate execution (no queuing)
|
|
||||||
if (istream < m_basebandSampleSources.size())
|
|
||||||
{
|
{
|
||||||
for (BasebandSampleSources::const_iterator it = m_basebandSampleSources[istream].begin(); it != m_basebandSampleSources[istream].end(); ++it)
|
|
||||||
|
// forward source changes to channel sources with immediate execution (no queuing)
|
||||||
|
if (istream < m_basebandSampleSources.size())
|
||||||
{
|
{
|
||||||
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
|
for (BasebandSampleSources::const_iterator it = m_basebandSampleSources[istream].begin(); it != m_basebandSampleSources[istream].end(); ++it)
|
||||||
qDebug() << "DSPDeviceMIMOEngine::handleSinkMessages: forward message to BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
|
{
|
||||||
(*it)->pushMessage(message);
|
DSPSignalNotification *message = new DSPSignalNotification(sampleRate, centerFrequency);
|
||||||
|
qDebug() << "DSPDeviceMIMOEngine::handleSinkMessages: forward message to BasebandSampleSource(" << (*it)->getSourceName().toStdString().c_str() << ")";
|
||||||
|
(*it)->pushMessage(message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// forward changes to MIMO GUI input queue
|
// forward changes to MIMO GUI input queue
|
||||||
MessageQueue *guiMessageQueue = m_deviceSampleMIMO->getMessageQueueToGUI();
|
MessageQueue *guiMessageQueue = m_deviceSampleMIMO->getMessageQueueToGUI();
|
||||||
qDebug("DSPDeviceMIMOEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
qDebug("DSPDeviceMIMOEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
||||||
|
|
||||||
if (guiMessageQueue) {
|
if (guiMessageQueue) {
|
||||||
DSPMIMOSignalNotification* rep = new DSPMIMOSignalNotification(*notif); // make a copy for the source GUI
|
DSPMIMOSignalNotification* rep = new DSPMIMOSignalNotification(*notif); // make a copy for the source GUI
|
||||||
guiMessageQueue->push(rep);
|
guiMessageQueue->push(rep);
|
||||||
}
|
}
|
||||||
|
|
||||||
// forward changes to spectrum sink if currently active
|
// forward changes to spectrum sink if currently active
|
||||||
if (m_spectrumSink && !m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
if (m_spectrumSink && !m_spectrumInputSourceElseSink && (m_spectrumInputIndex == istream))
|
||||||
{
|
{
|
||||||
DSPSignalNotification *spectrumNotif = new DSPSignalNotification(sampleRate, centerFrequency);
|
DSPSignalNotification *spectrumNotif = new DSPSignalNotification(sampleRate, centerFrequency);
|
||||||
m_spectrumSink->pushMessage(spectrumNotif);
|
m_spectrumSink->pushMessage(spectrumNotif);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -267,8 +267,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoIdle()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_deviceSampleSink == 0)
|
if (!m_deviceSampleSink) {
|
||||||
{
|
|
||||||
return StIdle;
|
return StIdle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,8 +303,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoInit()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_deviceSampleSink == 0)
|
if (!m_deviceSampleSink) {
|
||||||
{
|
|
||||||
return gotoError("DSPDeviceSinkEngine::gotoInit: No sample source configured");
|
return gotoError("DSPDeviceSinkEngine::gotoInit: No sample source configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,7 +360,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_deviceSampleSink == 0) {
|
if (!m_deviceSampleSink) {
|
||||||
return gotoError("DSPDeviceSinkEngine::gotoRunning: No sample source configured");
|
return gotoError("DSPDeviceSinkEngine::gotoRunning: No sample source configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,8 +368,7 @@ DSPDeviceSinkEngine::State DSPDeviceSinkEngine::gotoRunning()
|
|||||||
|
|
||||||
// Start everything
|
// Start everything
|
||||||
|
|
||||||
if(!m_deviceSampleSink->start())
|
if (!m_deviceSampleSink->start()) {
|
||||||
{
|
|
||||||
return gotoError("DSPDeviceSinkEngine::gotoRunning: Could not start sample sink");
|
return gotoError("DSPDeviceSinkEngine::gotoRunning: Could not start sample sink");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,15 +530,17 @@ void DSPDeviceSinkEngine::handleInputMessages()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// forward changes to listeners on DSP output queue
|
// forward changes to listeners on DSP output queue
|
||||||
|
if (m_deviceSampleSink)
|
||||||
|
{
|
||||||
|
MessageQueue *guiMessageQueue = m_deviceSampleSink->getMessageQueueToGUI();
|
||||||
|
qDebug("DSPDeviceSinkEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
||||||
|
|
||||||
MessageQueue *guiMessageQueue = m_deviceSampleSink->getMessageQueueToGUI();
|
if (guiMessageQueue)
|
||||||
qDebug("DSPDeviceSinkEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
{
|
||||||
|
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the output queue
|
||||||
if (guiMessageQueue)
|
guiMessageQueue->push(rep);
|
||||||
{
|
}
|
||||||
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the output queue
|
}
|
||||||
guiMessageQueue->push(rep);
|
|
||||||
}
|
|
||||||
|
|
||||||
delete message;
|
delete message;
|
||||||
}
|
}
|
||||||
|
@ -392,8 +392,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoIdle()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_deviceSampleSource == 0)
|
if (!m_deviceSampleSource) {
|
||||||
{
|
|
||||||
return StIdle;
|
return StIdle;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,8 +427,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoInit()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_deviceSampleSource == 0)
|
if (!m_deviceSampleSource) {
|
||||||
{
|
|
||||||
return gotoError("No sample source configured");
|
return gotoError("No sample source configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,7 +485,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_deviceSampleSource == NULL) {
|
if (!m_deviceSampleSource) {
|
||||||
return gotoError("DSPDeviceSourceEngine::gotoRunning: No sample source configured");
|
return gotoError("DSPDeviceSourceEngine::gotoRunning: No sample source configured");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -495,8 +493,7 @@ DSPDeviceSourceEngine::State DSPDeviceSourceEngine::gotoRunning()
|
|||||||
|
|
||||||
// Start everything
|
// Start everything
|
||||||
|
|
||||||
if(!m_deviceSampleSource->start())
|
if (!m_deviceSampleSource->start()) {
|
||||||
{
|
|
||||||
return gotoError("Could not start sample source");
|
return gotoError("Could not start sample source");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -532,7 +529,7 @@ void DSPDeviceSourceEngine::handleSetSource(DeviceSampleSource* source)
|
|||||||
|
|
||||||
m_deviceSampleSource = source;
|
m_deviceSampleSource = source;
|
||||||
|
|
||||||
if(m_deviceSampleSource != 0)
|
if (m_deviceSampleSource)
|
||||||
{
|
{
|
||||||
qDebug("DSPDeviceSourceEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
|
qDebug("DSPDeviceSourceEngine::handleSetSource: set %s", qPrintable(source->getDeviceDescription()));
|
||||||
connect(m_deviceSampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
connect(m_deviceSampleSource->getSampleFifo(), SIGNAL(dataReady()), this, SLOT(handleData()), Qt::QueuedConnection);
|
||||||
@ -673,17 +670,17 @@ void DSPDeviceSourceEngine::handleInputMessages()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// forward changes to source GUI input queue
|
// forward changes to source GUI input queue
|
||||||
|
if (m_deviceSampleSource)
|
||||||
|
{
|
||||||
|
MessageQueue *guiMessageQueue = m_deviceSampleSource->getMessageQueueToGUI();
|
||||||
|
qDebug("DSPDeviceSourceEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
||||||
|
|
||||||
MessageQueue *guiMessageQueue = m_deviceSampleSource->getMessageQueueToGUI();
|
if (guiMessageQueue)
|
||||||
qDebug("DSPDeviceSourceEngine::handleInputMessages: DSPSignalNotification: guiMessageQueue: %p", guiMessageQueue);
|
{
|
||||||
|
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the source GUI
|
||||||
if (guiMessageQueue)
|
guiMessageQueue->push(rep);
|
||||||
{
|
}
|
||||||
DSPSignalNotification* rep = new DSPSignalNotification(*notif); // make a copy for the source GUI
|
}
|
||||||
guiMessageQueue->push(rep);
|
|
||||||
}
|
|
||||||
|
|
||||||
//m_outputMessageQueue.push(rep);
|
|
||||||
|
|
||||||
delete message;
|
delete message;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user