From 8c6c0802aa0149c55225e8ce3f41c2d85fbb1e39 Mon Sep 17 00:00:00 2001 From: cxh Date: Tue, 14 Oct 2025 17:29:53 +0800 Subject: [PATCH] temp --- src/main.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d5628a7..b13b314 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -10,7 +10,7 @@ #include // 可通过这些开关快速启用/禁用线程进行调试 -constexpr bool ENABLE_RTSP_THREAD = true; // 设置为 false 禁用 RTSP 线程 +constexpr bool ENABLE_RTMP_THREAD = true; // 设置为 false 禁用 RTSP 线程 constexpr bool ENABLE_MQTT_THREAD = true; // 设置为 false 禁用 MQTT 线程 std::atomic g_running(true); @@ -54,7 +54,7 @@ int main() std::atomic mqtt_thread_exited(false); // 先在主线程初始化 GStreamer - RTSPManager::init(); + RTMPManager::init(); std::thread rtsp_thread; std::thread mqtt_thread; @@ -98,20 +98,6 @@ int main() const auto poll_interval = std::chrono::milliseconds(100); auto deadline = std::chrono::steady_clock::now() + max_wait; - if (ENABLE_RTSP_THREAD) - { - RTSPManager::stop(); - - auto stop_deadline = std::chrono::steady_clock::now() + std::chrono::seconds(10); - while (RTSPManager::is_any_streaming() && std::chrono::steady_clock::now() < stop_deadline) - { - std::this_thread::sleep_for(std::chrono::milliseconds(50)); - } - - if (rtsp_thread.joinable()) - rtsp_thread.join(); - } - // 重置 MQTT 线程等待的截止时间 deadline = std::chrono::steady_clock::now() + max_wait;