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

@@ -145,7 +145,7 @@ void DataHandler::handleData(const QString& client, const QByteArray& recv
(static_cast<unsigned char>(buffer->at(7)) << 8) |
(static_cast<unsigned char>(buffer->at(6)));
//qDebug() << "---Received dataSize:" << dataSize;
qDebug() << "---Received buffer->size():" << buffer->size();
//qDebug() << "---Received buffer->size():" << buffer->size();
//qDebug() << "---msg_id:" << QString::number(msg_id, 16).toUpper();
// 第11字节为返回 OK/NG
bool success = (static_cast<unsigned char>(buffer->at(10)) != 0x00);
@@ -159,7 +159,7 @@ void DataHandler::handleData(const QString& client, const QByteArray& recv
break;
}
}
qDebug() << "---Received totalSize:" << totalSize;
//qDebug() << "---Received totalSize:" << totalSize;
if (buffer->size() >= totalSize) {
// 调试查看收到的前19个字节
/*for (int i = 0; i < 19; i++) {
@@ -233,7 +233,9 @@ std::map<QString, int> commandValueMap = {
{"FACE_ANGLE_RANGE", FACE_ANGLE_RANGE},
{"GET_BACK_MAC", GET_BACK_MAC},
{"WRITE_BACK_UID_SN", WRITE_BACK_UID_SN}
{"WRITE_BACK_UID_SN", WRITE_BACK_UID_SN},
{"VIDEO_TEST", VIDEO_TEST},
};
bool DataHandler::getCommandNameFromValue(int receivedValue) {
@@ -559,10 +561,10 @@ void DataHandler::handleBackCmd(int msg_id, const QString& client, QByteArray ac
}
}
QJsonObject jsonObject = jsonArray[itemJsonIndex].toObject();
if (jsonObject["val"] == 0) {
if (jsonObject["val"] == 1 || jsonObject["val"] == 2) {
showVideo(client, actual_data);
}
else if (jsonObject["val"] == 1) {
else if (jsonObject["val"] == 0) {
isStartVideo = false;
emit statusUpdated(1, client, true, jsonArray, itemJsonIndex);
qDebug() << "--- STOP_VIDEO";