From ef8217467ea054a6739c75f5a1dff72b55d93040 Mon Sep 17 00:00:00 2001 From: cxh Date: Mon, 8 Sep 2025 15:25:59 +0800 Subject: [PATCH] first commit --- src/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index fcf8c8d..4c7cd1d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,6 +2,8 @@ #include "app_config.hpp" #include "rtsp_manager.hpp" #include "logger.hpp" +#include "mqtt_client_wrapper.hpp" +#include #include #include @@ -31,8 +33,17 @@ int main() return -1; } + // 启动 RTSP RTSPManager::init(); - RTSPManager::start(g_app_config.cameras); + std::thread rtsp_thread([&]() + { RTSPManager::start(g_app_config.cameras); }); + + // 启动 MQTT 客户端线程 + std::thread mqtt_thread(mqtt_client_thread_func); + + // 等待退出信号 + rtsp_thread.join(); + mqtt_thread.join(); return 0; } \ No newline at end of file