#pragma once #include #include // ZLMediaKit #include "Util/logger.h" #include "Util/NoticeCenter.h" #include "Poller/EventPoller.h" #include "Player/PlayerProxy.h" #include "Rtmp/RtmpPusher.h" #include "Common/config.h" #include "Pusher/MediaPusher.h" #include "Extension/Frame.h" #include "Util/SqlPool.h" #include "Network/TcpClient.h" #include "Poller/Timer.h" #include "TCPClient.h" #include "inifile.h" #include #include #include #include "inference.h" #include "Stream.h" // dataType #include "SendLogin.h" #include "NettyServerCommandEnum.h" #include "NettyServerResultMsg.h" #include "NettyClientResultMsg.h" #include "SendLogin.h" #include "NettyClientCommandEnum.h" using namespace toolkit; using namespace mediakit; using namespace inifile; using namespace std; #define ERR -1 #define OK 0 // 推理广播 #define NOTICE_INFER "NOTICE_INFER" namespace MIVA { class UserApp { public: static std::shared_ptr CreateNew(); UserApp(); ~UserApp(); int32_t Init(std::string appName); void Destroy(); void StartTask(); private: IniFile m_ini; std::string m_appName; const std::string m_configSrc = "../config/config.ini"; private: // Natty std::string Netty_ip; int32_t Netty_port; std::string Netty_idName; // PIS std::string PIS_ip; int32_t PIS_port; std::string PIS_IdName; // Mysql std::string sql_ip; int32_t sql_port; std::string user; std::string password; std::string character; int device_id; private: // 负责链接Netty的Socker std::shared_ptr m_tcpClient; std::list DataList; Timer::Ptr m_timer0; private: void ListenInfer(int Source_id, int num); void ConnectNetty(); }; }