mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-27 15:26:33 -04:00
SDRdaemon plugin: report LZ4 compression ratio
This commit is contained in:
parent
23750b10f6
commit
e5f2a49835
@ -74,6 +74,7 @@ public:
|
||||
bool isSyncLocked() const { return m_syncLock; }
|
||||
uint32_t getFrameSize() const { return m_frameSize; }
|
||||
bool isLz4Compressed() const { return m_lz4; }
|
||||
float getCompressionRatio() const { return (m_frameSize ? (float) m_lz4InSize / (float) m_frameSize : 1.0); }
|
||||
|
||||
static const int m_udpPayloadSize;
|
||||
static const int m_sampleSize;
|
||||
|
@ -202,6 +202,7 @@ bool SDRdaemonGui::handleMessage(const Message& message)
|
||||
m_syncLocked = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getSyncLock();
|
||||
m_frameSize = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getFrameSize();
|
||||
m_lz4 = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4Compression();
|
||||
m_compressionRatio = ((SDRdaemonInput::MsgReportSDRdaemonStreamTiming&)message).getLz4Compression();
|
||||
updateWithStreamTime();
|
||||
return true;
|
||||
}
|
||||
@ -319,6 +320,9 @@ void SDRdaemonGui::updateWithStreamTime()
|
||||
} else {
|
||||
ui->lz4Compressed->setStyleSheet("QToolButton { background:rgb(79,79,79); }");
|
||||
}
|
||||
|
||||
s = QString::number(m_compressionRatio, 'f', 2);
|
||||
ui->compressionRatioText->setText(tr("%1").arg(s));
|
||||
}
|
||||
|
||||
void SDRdaemonGui::tick()
|
||||
|
@ -62,6 +62,7 @@ private:
|
||||
bool m_syncLocked;
|
||||
uint32_t m_frameSize;
|
||||
bool m_lz4;
|
||||
float m_compressionRatio;
|
||||
|
||||
int m_samplesCount;
|
||||
std::size_t m_tickCount;
|
||||
|
@ -4,7 +4,7 @@
|
||||
<widget class="QWidget" name="SDRdaemonGui">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>360</width>
|
||||
<width>340</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
@ -472,7 +472,7 @@
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<width>80</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -176,13 +176,15 @@ public:
|
||||
uint32_t tv_usec,
|
||||
bool syncLock,
|
||||
uint32_t frameSize,
|
||||
bool lz4)
|
||||
bool lz4,
|
||||
float compressionRatio)
|
||||
{
|
||||
return new MsgReportSDRdaemonStreamTiming(tv_sec,
|
||||
tv_usec,
|
||||
syncLock,
|
||||
frameSize,
|
||||
lz4);
|
||||
lz4,
|
||||
compressionRatio);
|
||||
}
|
||||
|
||||
protected:
|
||||
@ -191,18 +193,21 @@ public:
|
||||
bool m_syncLock;
|
||||
uint32_t m_frameSize;
|
||||
bool m_lz4;
|
||||
float m_compressionRatio;
|
||||
|
||||
MsgReportSDRdaemonStreamTiming(uint32_t tv_sec,
|
||||
uint32_t tv_usec,
|
||||
bool syncLock,
|
||||
uint32_t frameSize,
|
||||
bool lz4) :
|
||||
bool lz4,
|
||||
float compressionRatio) :
|
||||
Message(),
|
||||
m_tv_sec(tv_sec),
|
||||
m_tv_usec(tv_usec),
|
||||
m_syncLock(syncLock),
|
||||
m_frameSize(frameSize),
|
||||
m_lz4(lz4)
|
||||
m_lz4(lz4),
|
||||
m_compressionRatio(compressionRatio)
|
||||
{ }
|
||||
};
|
||||
|
||||
|
@ -211,7 +211,8 @@ void SDRdaemonUDPHandler::tick()
|
||||
m_tv_usec,
|
||||
m_sdrDaemonBuffer.isSyncLocked(),
|
||||
m_sdrDaemonBuffer.getFrameSize(),
|
||||
m_sdrDaemonBuffer.isLz4Compressed());
|
||||
m_sdrDaemonBuffer.isLz4Compressed(),
|
||||
m_sdrDaemonBuffer.getCompressionRatio());
|
||||
m_outputMessageQueueToGUI->push(report);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user