1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-01 21:54:55 -04:00

Remote input buffer size rework: member name changes. Adjust sample sink fifo size from sample rate

This commit is contained in:
f4exb
2020-06-28 06:56:21 +02:00
parent b7284b6b5c
commit 16364d604a
6 changed files with 76 additions and 28 deletions
@@ -48,13 +48,16 @@ MESSAGE_CLASS_DEFINITION(RemoteInput::MsgStartStop, Message)
RemoteInput::RemoteInput(DeviceAPI *deviceAPI) :
m_deviceAPI(deviceAPI),
m_sampleRate(48000),
m_fileSink(nullptr),
m_settings(),
m_remoteInputUDPHandler(0),
m_deviceDescription(),
m_startingTimeStamp(0)
{
m_sampleFifo.setSize(96000 * 4);
m_sampleFifo.setSize(m_sampleRate * 8);
m_remoteInputUDPHandler = new RemoteInputUDPHandler(&m_sampleFifo, m_deviceAPI);
m_remoteInputUDPHandler->setMessageQueueToInput(&m_inputMessageQueue);
m_fileSink = new FileRecord(QString("test_%1.sdriq").arg(m_deviceAPI->getDeviceUID()));
m_deviceAPI->setNbSourceStreams(1);
@@ -167,6 +170,21 @@ bool RemoteInput::handleMessage(const Message& message)
DSPSignalNotification& notif = (DSPSignalNotification&) message;
return m_fileSink->handleMessage(notif); // forward to file sink
}
else if (RemoteInputUDPHandler::MsgReportSampleRateChange::match(message))
{
RemoteInputUDPHandler::MsgReportSampleRateChange& notif = (RemoteInputUDPHandler::MsgReportSampleRateChange&) message;
int sampleRate = notif.getSampleRate();
if (sampleRate != m_sampleRate)
{
qDebug("RemoteInput::handleMessage: RemoteInputUDPHandler::MsgReportSampleRateChange: %d", sampleRate);
QMutexLocker mutexLocker(&m_mutex);
m_sampleFifo.setSize(sampleRate * 8);
m_sampleRate = sampleRate;
}
return true;
}
else if (MsgFileRecord::match(message))
{
MsgFileRecord& conf = (MsgFileRecord&) message;