first commit
This commit is contained in:
parent
58f991fe2b
commit
ef8217467e
13
src/main.cpp
13
src/main.cpp
@ -2,6 +2,8 @@
|
|||||||
#include "app_config.hpp"
|
#include "app_config.hpp"
|
||||||
#include "rtsp_manager.hpp"
|
#include "rtsp_manager.hpp"
|
||||||
#include "logger.hpp"
|
#include "logger.hpp"
|
||||||
|
#include "mqtt_client_wrapper.hpp"
|
||||||
|
#include <thread>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
|
||||||
@ -31,8 +33,17 @@ int main()
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 启动 RTSP
|
||||||
RTSPManager::init();
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user