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