#ifndef _DISPOSITION_HPP_ #define _DISPOSITION_HPP_ #include #include "Util/util.h" #include "Util/logger.h" #include "Util/TimeTicker.h" #include "Poller/Timer.h" #include "inifile.h" using namespace std; using namespace toolkit; using namespace inifile; namespace gsd_ds{ struct gsdRtsp{ // rtsp int rtsp_post = 8554; int bitrate = 4000000; int iframeinterval = 50; std::string rtsp_uri = "/live"; }; class Disposition{ private: Disposition(){ Init(); } public: using Ptr = std::shared_ptr; ~Disposition(){ this->Destroy(); } /** * @description: getPtr * @return {*} */ static std::shared_ptr getPtr(){ static Disposition::Ptr m_dispostion = nullptr; if(m_dispostion == nullptr) m_dispostion = std::shared_ptr(new Disposition); return m_dispostion; } /** * @description: 初始化 * @param {*} * @return {*} */ int8_t Init(){ return 0; } /** * @description: 释放 * @return {*} */ void Destroy(){ } /** * @description: 是否正常 * @param {*} * @return {*} */ bool isNormally(){ return true; } /** * @description: 更新数据 * @return {*} */ int8_t updateData(); /** * @description: getGsdIP * @return {*} */ std::string getGsdIP(); /** * @description: getGsdPort * @return {*} */ int getGsdPort(); /** * @description: getMysqlIP * @return {*} */ std::string getMysqlIP(); /** * @description: getMysqlPort * @return {*} */ int getMysqlPort(); /** * @description: getRtsp * @return {*} */ gsdRtsp getRtsp(); /** * @description: getUser * @return {*} */ std::string getUser(); /** * @description: getPassword * @return {*} */ std::string getPassword(); /** * @description: 获取outDir * @return {*} */ std::string getOutDir(); /** * @description: getFrameInterval * @return {*} */ int getFrameInterval(); /** * @description: setFrameInterval * @param {int} interval * @return {*} */ void setFrameInterval(int interval); private: IniFile m_ini; // gsd std::string gsd_IP = "127.0.0.1"; int gsd_Port = 9980; // mysql std::string mysql_IP = "127.0.0.1"; int mysql_Port = 3306; // rtsp gsdRtsp gsdrtsp; std::string user = "root"; std::string password = "sunwin2022"; // video std::string outDir = "/opt/datas/video/"; int frame_interval = 2; #ifndef RELEASE std::string ConfigFile = "../source/config/config.ini"; #else std::string ConfigFile = "../config/config.ini"; #endif }; } // gsd_ds #endif