fix(media): fix backboard camera display and mdns connection."

This commit is contained in:
2025-09-18 17:05:23 +08:00
parent 4a25fb0e80
commit aa1d0a6579
12 changed files with 98 additions and 34 deletions

View File

@@ -150,9 +150,9 @@ void SerialPortHandler::onSendHeartBeatData(const QByteArray& data, bool heartBe
serialPort->flush(); // 确保数据立即发送
}
else {
qDebug() << "Serial port is not open!";
//qDebug() << "Serial port is not open!";
}
qDebug() << "当前时间:" << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz");
//qDebug() << "当前时间:" << QDateTime::currentDateTime().toString("yyyy-MM-dd HH:mm:ss.zzz");
}
void readBmpFile_1(const QString& filePath) {
@@ -370,7 +370,7 @@ void SerialPortHandler::updateAvailablePorts() {
QStringList currentPorts;
foreach(const QSerialPortInfo & info, QSerialPortInfo::availablePorts()) {
currentPorts.append(info.portName());
qDebug() << "info.portName(): " << info.portName();
//qDebug() << "info.portName(): " << info.portName();
}
//qDebug() << "Available ports: " << currentPorts;
@@ -550,16 +550,32 @@ void SerialPortHandler::sendJsonItem(const QJsonArray& jsonArray, int itemIndex,
QJsonObject tempItem = jsonArray[itemIndex].toObject();
if (tempItem["cmd"] == "VIDEO_TEST") {
if (tempItem["val"] == 0) {
#if 0
isSingleSend = false;
isClickedSend = false;
isRecvVideoData = true;
isStartVideo = true;
//startReadVideoDataTimer(isBackBoardOrAllBoard);
#endif
isRecvVideoData = false;
isStartVideo = false;
}
else if (tempItem["val"] == 1) {
#if 0
isRecvVideoData = false;
isStartVideo = false;
//stopReadVideoDataTimer(isBackBoardOrAllBoard);
#endif
isSingleSend = false;
isClickedSend = false;
isRecvVideoData = true;
isStartVideo = true;
}
else if (tempItem["val"] == 2) {
isSingleSend = false;
isClickedSend = false;
isRecvVideoData = true;
isStartVideo = true;
}
}
}

View File

@@ -1,3 +1,4 @@
#include "crc32.h"
#include <stdio.h>
static const unsigned int crc_table[256] = {

View File

@@ -1,6 +1,8 @@
#ifndef _crc32_h_
#ifndef _crc32_h_
#define _crc32_h_
#include <stdint.h>
#pragma pack(push, 1)
struct BMPHeader {
char bfType[2];
@@ -21,17 +23,17 @@ struct BMPHeader {
uint32_t biClrImportant;
};
#pragma pack(pop)
#ifdef __cplusplus
extern "C" {
#endif
unsigned int crc32(unsigned int crc, const void *buf, size_t len);
void crc32init(unsigned int *crc);
void crc32update(unsigned int *crc, const void * b, size_t len);
void crc32final(unsigned int *crc);
unsigned int crcsimple(const void *buf, size_t len);
#ifdef __cplusplus
}
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
unsigned int crc32(unsigned int crc, const void *buf, size_t len);
void crc32init(unsigned int *crc);
void crc32update(unsigned int *crc, const void * b, size_t len);
void crc32final(unsigned int *crc);
unsigned int crcsimple(const void *buf, size_t len);
#ifdef __cplusplus
}
#endif
#endif