123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #ifndef _DISPOSITION_HPP_
- #define _DISPOSITION_HPP_
- #include <iostream>
- #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>;
- ~Disposition(){
- this->Destroy();
- }
- /**
- * @description: getPtr
- * @return {*}
- */
- static std::shared_ptr<Disposition> getPtr(){
- static Disposition::Ptr m_dispostion = nullptr;
- if(m_dispostion == nullptr) m_dispostion = std::shared_ptr<Disposition>(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
|