添加广播MDNS服务
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
#include <QFile>
|
||||
#include <QThread>
|
||||
#include <QElapsedTimer>
|
||||
#include <QLineEdit>
|
||||
#include <QTextEdit>
|
||||
#include "../Media/Media.h"
|
||||
#include "../ParseDataHandler/msgID.h"
|
||||
#include "../Media/VideoDecoder/FFmpegDecoder.h"
|
||||
@@ -30,7 +32,8 @@ class DataHandler : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DataHandler(QLabel* leftLens_imageLabel, QLabel* rightLens_imageLabel, QLabel* videoLabel, QObject* parent = nullptr);
|
||||
explicit DataHandler(QLabel* leftLens_imageLabel, QLabel* rightLens_imageLabel, QLabel* videoLabel,
|
||||
QTextEdit* licenseHwInfoEdit, QMap<QString, QLineEdit*>* devInfoLineEdits, QObject* parent = nullptr);
|
||||
~DataHandler();
|
||||
|
||||
public slots:
|
||||
@@ -45,6 +48,7 @@ private:
|
||||
QLabel* leftLens_m_imageLabel;
|
||||
QLabel* rightLens_m_imageLabel;
|
||||
QLabel* videoLabel;
|
||||
QTextEdit* licenseHwInfoEdit;
|
||||
QByteArray allRecvData; // 完整的一帧数据
|
||||
int remain = 0;
|
||||
int start_run = 0;
|
||||
@@ -52,6 +56,8 @@ private:
|
||||
FFmpegDecoder* ffmpegDecoder;
|
||||
QByteArray *buffer;
|
||||
QHash<QString, unsigned char> clientLastMsgId;
|
||||
QMap<QString, QLineEdit*>* devInfoLineEdits;
|
||||
QMap<int, QString> msgIdToCmdMap;
|
||||
|
||||
// 如果接收十六进制数据,转为二进制
|
||||
QByteArray hexStringToByteArray(const QString& hexString);
|
||||
@@ -59,7 +65,10 @@ private:
|
||||
void clearAllRecvData();
|
||||
void handleCmd(int msg_id, const QString& client, QByteArray actual_data);
|
||||
void handleFrontCmd(int msg_id, const QString& client, QByteArray actual_data);
|
||||
void handleDevInfo(int msg_id, const QString& client, QByteArray actual_data);
|
||||
void handleBackCmd(int msg_id, const QString& client, QByteArray actual_data);
|
||||
void initializeMsgIdToCmdMap();
|
||||
void updateLineEdit(int msg_id, const QByteArray& actual_data);
|
||||
};
|
||||
|
||||
#endif // DATAHANDLER_H
|
||||
|
||||
Reference in New Issue
Block a user