mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-07 16:34:45 -04:00
Remote Input: added option to join a multicast group. Implements #611
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include <QMutex>
|
||||
#include <QElapsedTimer>
|
||||
|
||||
#include "util/messagequeue.h"
|
||||
#include "remoteinputbuffer.h"
|
||||
|
||||
#define REMOTEINPUT_THROTTLE_MS 50
|
||||
@@ -63,7 +64,7 @@ public:
|
||||
void setMessageQueueToGUI(MessageQueue *queue) { m_messageQueueToGUI = queue; }
|
||||
void start();
|
||||
void stop();
|
||||
void configureUDPLink(const QString& address, quint16 port);
|
||||
void configureUDPLink(const QString& address, quint16 port, const QString& multicastAddress, bool multicastJoin);
|
||||
void getRemoteAddress(QString& s) const { s = m_remoteAddress.toString(); }
|
||||
int getNbOriginalBlocks() const { return RemoteNbOrginalBlocks; }
|
||||
bool isStreaming() const { return m_masterTimerConnected; }
|
||||
@@ -77,6 +78,35 @@ public slots:
|
||||
void dataReadyRead();
|
||||
|
||||
private:
|
||||
class MsgUDPAddressAndPort : public Message {
|
||||
MESSAGE_CLASS_DECLARATION
|
||||
|
||||
public:
|
||||
const QString& getAddress() const { return m_address; }
|
||||
quint16 getPort() const { return m_port; }
|
||||
const QString& getMulticastAddress() const { return m_multicastAddress; }
|
||||
bool getMulticastJoin() const { return m_multicastJoin; }
|
||||
|
||||
static MsgUDPAddressAndPort* create(const QString& address, quint16 port, const QString& multicastAddress, bool multicastJoin)
|
||||
{
|
||||
return new MsgUDPAddressAndPort(address, port, multicastAddress, multicastJoin);
|
||||
}
|
||||
|
||||
private:
|
||||
QString m_address;
|
||||
quint16 m_port;
|
||||
QString m_multicastAddress;
|
||||
bool m_multicastJoin;
|
||||
|
||||
MsgUDPAddressAndPort(const QString& address, quint16 port, const QString& multicastAddress, bool multicastJoin) :
|
||||
Message(),
|
||||
m_address(address),
|
||||
m_port(port),
|
||||
m_multicastAddress(multicastAddress),
|
||||
m_multicastJoin(multicastJoin)
|
||||
{ }
|
||||
};
|
||||
|
||||
DeviceAPI *m_deviceAPI;
|
||||
const QTimer& m_masterTimer;
|
||||
bool m_masterTimerConnected;
|
||||
@@ -87,6 +117,8 @@ private:
|
||||
QHostAddress m_dataAddress;
|
||||
QHostAddress m_remoteAddress;
|
||||
quint16 m_dataPort;
|
||||
QHostAddress m_multicastAddress;
|
||||
bool m_multicast;
|
||||
bool m_dataConnected;
|
||||
char *m_udpBuf;
|
||||
qint64 m_udpReadBytes;
|
||||
@@ -109,13 +141,18 @@ private:
|
||||
bool m_throttleToggle;
|
||||
bool m_autoCorrBuffer;
|
||||
|
||||
MessageQueue m_inputMessageQueue;
|
||||
|
||||
void connectTimer();
|
||||
void disconnectTimer();
|
||||
void processData();
|
||||
void adjustNbDecoderSlots(const RemoteMetaDataFEC& metaData);
|
||||
void applyUDPLink(const QString& address, quint16 port, const QString& multicastAddress, bool muticastJoin);
|
||||
bool handleMessage(const Message& message);
|
||||
|
||||
private slots:
|
||||
void tick();
|
||||
void handleMessages();
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user