diff --git a/src/main.cpp b/src/main.cpp index b28d89e..8860aef 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,8 +35,14 @@ int main() return -1; } + // 先在主线程初始化 GStreamer + RTSPManager::init(); + + // 启动 RTSP server(loop 可在子线程) std::thread rtsp_thread([&]() { RTSPManager::start(g_app_config.cameras); }); + + // 启动 MQTT 客户端线程 std::thread mqtt_thread(mqtt_client_thread_func); // 等待退出信号