From 7e9690e621fc62a995a361597ceee772204e427e Mon Sep 17 00:00:00 2001 From: cxh Date: Wed, 15 Oct 2025 13:22:20 +0800 Subject: [PATCH] temp --- src/mqtt_client_wrapper.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/mqtt_client_wrapper.cpp b/src/mqtt_client_wrapper.cpp index 38dca02..c76df18 100644 --- a/src/mqtt_client_wrapper.cpp +++ b/src/mqtt_client_wrapper.cpp @@ -67,22 +67,18 @@ static void on_mqtt_message_received(const std::string &topic, const std::string StreamType type = (streamType == 0) ? StreamType::MAIN : StreamType::SUB; auto channels = data.value("channels", std::vector{}); - nlohmann::json resp_data = nlohmann::json::array(); - for (int ch : channels) { if (ch < 0 || ch >= static_cast(g_app_config.cameras.size())) continue; Camera &cam = g_app_config.cameras[ch]; - bool op_result = false; if (switch_val == 0) { if (!RTMPManager::is_streaming(cam.name, type)) { RTMPManager::start_camera(cam, type, seqNo); - op_result = true; } } else @@ -90,25 +86,9 @@ static void on_mqtt_message_received(const std::string &topic, const std::string if (RTMPManager::is_streaming(cam.name, type)) { RTMPManager::stop_camera(cam.name, type, seqNo); - op_result = true; } } - - nlohmann::json ch_resp; - ch_resp["loc"] = ch; - ch_resp["url"] = op_result ? RTMPManager::get_stream_url(cam.name, type) : ""; - ch_resp["result"] = op_result ? 0 : 1; - ch_resp["reason"] = op_result ? "" : "already in requested state"; - - resp_data.push_back(ch_resp); } - - nlohmann::json reply; - reply["type"] = "response"; - reply["seqNo"] = seqNo; - reply["data"] = resp_data; - - mqtt_client->publish(topic, reply.dump()); } } catch (const std::exception &e)