1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-05 11:09:13 -04:00

DATV demod: rationalize usage of DATVideostream

This commit is contained in:
f4exb 2021-03-29 03:57:17 +02:00
parent 66ff64f654
commit 011d5fbf60
5 changed files with 23 additions and 20 deletions

View File

@ -77,7 +77,8 @@ public:
void setCNRLabel(QLabel *cnrLabel) { m_basebandSink->setCNRLabel(cnrLabel); }
void setMERMeter(LevelMeterSignalDB *merMeter) { m_basebandSink->setMERMeter(merMeter); }
void setCNRMeter(LevelMeterSignalDB *cnrMeter) { m_basebandSink->setCNRMeter(cnrMeter); }
DATVideostream *SetVideoRender(DATVideoRender *objScreen) { return m_basebandSink->SetVideoRender(objScreen); }
void SetVideoRender(DATVideoRender *objScreen) { m_basebandSink->SetVideoRender(objScreen); }
DATVideostream *getVideoStream() { return m_basebandSink->getVideoStream(); }
bool audioActive() { return m_basebandSink->audioActive(); }
bool audioDecodeOK() { return m_basebandSink->audioDecodeOK(); }
bool videoActive() { return m_basebandSink->videoActive(); }

View File

@ -94,7 +94,8 @@ public:
void setCNRMeter(LevelMeterSignalDB *cnrMeter) { m_sink.setCNRMeter(cnrMeter); }
void setMessageQueueToGUI(MessageQueue *messageQueue) { m_sink.setMessageQueueToGUI(messageQueue); }
void setBasebandSampleRate(int sampleRate); //!< To be used when supporting thread is stopped
DATVideostream *SetVideoRender(DATVideoRender *objScreen) { return m_sink.SetVideoRender(objScreen); }
void SetVideoRender(DATVideoRender *objScreen) { m_sink.SetVideoRender(objScreen); }
DATVideostream *getVideoStream() { return m_sink.getVideoStream(); }
bool audioActive() { return m_sink.audioActive(); }
bool audioDecodeOK() { return m_sink.audioDecodeOK(); }
bool videoActive() { return m_sink.videoActive(); }

View File

@ -210,8 +210,9 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba
m_objDATVDemod->setCNRLabel(ui->cnrText);
m_objDATVDemod->setMERMeter(ui->merMeter);
m_objDATVDemod->setCNRMeter(ui->cnrMeter);
m_objDATVDemod->SetVideoRender(ui->screenTV_2);
connect(m_objDATVDemod->SetVideoRender(ui->screenTV_2), &DATVideostream::onDataPackets, this, &DATVDemodGUI::on_StreamDataAvailable);
connect(m_objDATVDemod->getVideoStream(), &DATVideostream::onDataPackets, this, &DATVDemodGUI::on_StreamDataAvailable);
connect(ui->screenTV_2, &DATVideoRender::onMetaDataChanged, this, &DATVDemodGUI::on_StreamMetaDataChanged);
m_intPreviousDecodedData=0;

View File

@ -35,7 +35,7 @@ DATVDemodSink::DATVDemodSink() :
m_blnNeedConfigUpdate(false),
m_objRegisteredTVScreen(nullptr),
m_objRegisteredVideoRender(nullptr),
m_objVideoStream(nullptr),
m_objVideoStream(new DATVideostream()),
m_udpStream(leansdr::tspacket::SIZE),
m_objRenderThread(nullptr),
m_merLabel(nullptr),
@ -54,24 +54,24 @@ DATVDemodSink::DATVDemodSink() :
//*************** DATV PARAMETERS ***************
m_blnInitialized=false;
ResetDATVFrameworkPointers();
m_objVideoStream = new DATVideostream();
m_objRFFilter = new fftfilt(-256000.0 / 1024000.0, 256000.0 / 1024000.0, m_rfFilterFftLength);
}
DATVDemodSink::~DATVDemodSink()
{
m_blnInitialized=false;
m_blnInitialized = false;
if (m_objVideoStream)
{
//Immediately exit from DATVideoStream if waiting for data before killing thread
m_objVideoStream->ThreadTimeOut = 0;
m_objVideoStream->deleteLater();
}
//Immediately exit from DATVideoStream if waiting for data before killing thread
m_objVideoStream->ThreadTimeOut = 0;
m_objVideoStream->deleteLater();
stopVideo();
CleanUpDATVFramework();
if (m_objRenderThread) {
delete m_objRenderThread;
}
delete m_objRFFilter;
}
@ -110,12 +110,11 @@ void DATVDemodSink::setCNRMeter(LevelMeterSignalDB *cnrMeter) {
m_cnrMeter = cnrMeter;
}
DATVideostream *DATVDemodSink::SetVideoRender(DATVideoRender *objScreen)
void DATVDemodSink::SetVideoRender(DATVideoRender *objScreen)
{
m_objRegisteredVideoRender = objScreen;
m_objRegisteredVideoRender->setAudioFIFO(&m_audioFifo);
m_objRenderThread = new DATVideoRenderThread(m_objRegisteredVideoRender, m_objVideoStream);
return m_objVideoStream;
}
bool DATVDemodSink::audioActive()
@ -453,8 +452,8 @@ void DATVDemodSink::ResetDATVFrameworkPointers()
// OUTPUT PREPROCESSED DATA
sampler = nullptr;
coeffs_sampler=nullptr;
ncoeffs_sampler=0;
coeffs_sampler = nullptr;
ncoeffs_sampler = 0;
p_symbols = nullptr;
p_freq = nullptr;
@ -472,8 +471,8 @@ void DATVDemodSink::ResetDATVFrameworkPointers()
m_objDemodulator = nullptr;
//DECONVOLUTION AND SYNCHRONIZATION
p_bytes=nullptr;
r_deconv=nullptr;
p_bytes = nullptr;
r_deconv = nullptr;
r = nullptr;
p_descrambled = nullptr;
@ -1312,7 +1311,7 @@ void DATVDemodSink::feed(const SampleVector::const_iterator& begin, const Sample
{
m_objScheduler->step();
m_lngReadIQ=0;
m_lngReadIQ = 0;
delete p_rawiq_writer;
p_rawiq_writer = new leansdr::pipewriter<leansdr::cf32>(*p_rawiq);
}

View File

@ -63,7 +63,8 @@ public:
void setCNRLabel(QLabel *cnrLabel);
void setMERMeter(LevelMeterSignalDB *merMeter);
void setCNRMeter(LevelMeterSignalDB *cnrMeter);
DATVideostream * SetVideoRender(DATVideoRender *objScreen);
void SetVideoRender(DATVideoRender *objScreen);
DATVideostream *getVideoStream() { return m_objVideoStream; }
bool audioActive();
bool audioDecodeOK();
bool videoActive();