From 507b110299ad49f9aba29b48f7bc59e51bb26d00 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 12 Apr 2021 00:31:47 +0200 Subject: [PATCH] DATV demod: FIFO status event: pass data by copy instead of reference --- plugins/channelrx/demoddatv/datvdemodgui.cpp | 12 ++++++------ plugins/channelrx/demoddatv/datvdemodgui.h | 2 +- plugins/channelrx/demoddatv/datvideostream.cpp | 6 +++--- plugins/channelrx/demoddatv/datvideostream.h | 2 +- plugins/channelrx/demoddatv/datvudpstream.cpp | 5 ++--- plugins/channelrx/demoddatv/datvudpstream.h | 3 +-- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index dc4255097..26be36d5a 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -750,18 +750,18 @@ QString DATVDemodGUI::formatBytes(qint64 intBytes) } -void DATVDemodGUI::on_StreamDataAvailable(int *intBytes, int *intPercent, qint64 *intTotalReceived) +void DATVDemodGUI::on_StreamDataAvailable(int intBytes, int intPercent, qint64 intTotalReceived) { - ui->lblStatus->setText(QString("Data: %1B").arg(formatBytes(*intTotalReceived))); - m_intLastDecodedData = *intTotalReceived; + ui->lblStatus->setText(QString("Data: %1B").arg(formatBytes(intTotalReceived))); + m_intLastDecodedData = intTotalReceived; - if((*intPercent)<100) { - ui->prgSynchro->setValue(*intPercent); + if ((intPercent)<100) { + ui->prgSynchro->setValue(intPercent); } else { ui->prgSynchro->setValue(100); } - m_intReadyDecodedData = *intBytes; + m_intReadyDecodedData = intBytes; } void DATVDemodGUI::on_deltaFrequency_changed(qint64 value) diff --git a/plugins/channelrx/demoddatv/datvdemodgui.h b/plugins/channelrx/demoddatv/datvdemodgui.h index 4b16d02ca..a2f1966fd 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.h +++ b/plugins/channelrx/demoddatv/datvdemodgui.h @@ -78,7 +78,7 @@ private slots: void on_chkAllowDrift_clicked(); void on_fullScreen_clicked(); void on_mouseEvent(QMouseEvent* obj); - void on_StreamDataAvailable(int *intBytes, int *intPercent, qint64 *intTotalReceived); + void on_StreamDataAvailable(int intBytes, int intPercent, qint64 intTotalReceived); void on_StreamMetaDataChanged(DataTSMetaData2 *objMetaData); void on_chkFastlock_clicked(); void on_cmbFilter_currentIndexChanged(int index); diff --git a/plugins/channelrx/demoddatv/datvideostream.cpp b/plugins/channelrx/demoddatv/datvideostream.cpp index de268e945..e4d0481a2 100644 --- a/plugins/channelrx/demoddatv/datvideostream.cpp +++ b/plugins/channelrx/demoddatv/datvideostream.cpp @@ -56,7 +56,7 @@ void DATVideostream::cleanUp() void DATVideostream::resetTotalReceived() { m_totalReceived = 0; - emit fifoData(&m_bytesWaiting, &m_percentBuffer, &m_totalReceived); + emit fifoData(m_bytesWaiting, m_percentBuffer, m_totalReceived); } void DATVideostream::setMultiThreaded(bool multiThreaded) @@ -100,7 +100,7 @@ int DATVideostream::pushData(const char * chrData, int intSize) m_percentBuffer = m_percentBuffer > 100 ? 100 : m_percentBuffer; if (m_packetReceived % 10 == 1) { - emit fifoData(&m_bytesWaiting, &m_percentBuffer, &m_totalReceived); + emit fifoData(m_bytesWaiting, m_percentBuffer, m_totalReceived); } return intSize; @@ -209,7 +209,7 @@ qint64 DATVideostream::readData(char *data, qint64 len) m_percentBuffer = m_percentBuffer > 100 ? 100 : m_percentBuffer; if (m_packetReceived % 10 == 0) { - emit fifoData(&m_bytesWaiting, &m_percentBuffer, &m_totalReceived); + emit fifoData(m_bytesWaiting, m_percentBuffer, m_totalReceived); } //Next available DATA diff --git a/plugins/channelrx/demoddatv/datvideostream.h b/plugins/channelrx/demoddatv/datvideostream.h index 4d8cbc3ab..4b872dd07 100644 --- a/plugins/channelrx/demoddatv/datvideostream.h +++ b/plugins/channelrx/demoddatv/datvideostream.h @@ -50,7 +50,7 @@ public: signals: void dataAvailable(); - void fifoData(int *intDataBytes, int *intPercentBuffer, qint64 *intTotalReceived); + void fifoData(int intDataBytes, int intPercentBuffer, qint64 intTotalReceived); protected: virtual qint64 readData(char *data, qint64 len); diff --git a/plugins/channelrx/demoddatv/datvudpstream.cpp b/plugins/channelrx/demoddatv/datvudpstream.cpp index 3d997ff7c..065f40dac 100644 --- a/plugins/channelrx/demoddatv/datvudpstream.cpp +++ b/plugins/channelrx/demoddatv/datvudpstream.cpp @@ -28,7 +28,6 @@ DATVUDPStream::DATVUDPStream(int tsBlockSize) : m_tsBlockSize(tsBlockSize), m_tsBlockIndex(0), m_dataBytes(0), - m_percentBuffer(0), m_totalBytes(0), m_fifoSignalCount(0) { @@ -62,7 +61,7 @@ void DATVUDPStream::pushData(const char *chrData, int nbTSBlocks) if (++m_fifoSignalCount == 10) { - emit fifoData(&m_dataBytes, &m_percentBuffer, &m_totalBytes); + emit fifoData(m_dataBytes, 0, m_totalBytes); m_fifoSignalCount = 0; } @@ -75,5 +74,5 @@ void DATVUDPStream::pushData(const char *chrData, int nbTSBlocks) void DATVUDPStream::resetTotalReceived() { m_totalBytes = 0; - emit fifoData(&m_dataBytes, &m_percentBuffer, &m_totalBytes); + emit fifoData(m_dataBytes, 0, m_totalBytes); } diff --git a/plugins/channelrx/demoddatv/datvudpstream.h b/plugins/channelrx/demoddatv/datvudpstream.h index ec164df1a..d577c2813 100644 --- a/plugins/channelrx/demoddatv/datvudpstream.h +++ b/plugins/channelrx/demoddatv/datvudpstream.h @@ -41,7 +41,7 @@ public: static const int m_tsBlocksPerFrame; signals: - void fifoData(int *dataBytes, int *percentBuffer, qint64 *totalReceived); + void fifoData(int dataBytes, int percentBuffer, qint64 totalReceived); private: bool m_active; @@ -52,7 +52,6 @@ private: int m_tsBlockIndex; char *m_tsBuffer; int m_dataBytes; - int m_percentBuffer; qint64 m_totalBytes; int m_fifoSignalCount; };